帮助pay_status PayPal退款(部分撤消IPN) [英] Help with payment_status PayPal Refunded Reversed Partially Refuned IPNs

查看:188
本文介绍了帮助pay_status PayPal退款(部分撤消IPN)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果成员正在订阅和/或支付一次付款并且他们要求退款,冲销或部分退款,那么以下脚本将与IPN发送的IPN消息一起使用吗?

Will this script below work with the IPN Messages Sent with IPNs if the member is on a subscription and/or pay once payment and they request a Refund, Reversal, or Partial Refund?

if($payment_status == "Refunded" || $payment_status == "Reversed" || $payment_status == "Partially Refunded"){
mysql_query("UPDATE members SET month_date = '$gettoday', subscr_id = '$subscr_id', subscr_cancel = 'Y', active = 'N', prepay = 'N' WHERE id='$id'");
}

如果没有,我可以使用什么或如何用PHP编写脚本以使我的系统读取所有人的IPN payment_status并知道哪个订户(通过他们的PayPal订户ID或我的系统中的会员ID)或付款人((他们的会员ID在我的系统中),以便在其中之一发送时执行操作?

If not, what can I use or how do I script it in PHP to make my system read the IPN payment_status of all and know what subscriber (by their PayPal Subscribe ID or Member ID in my system) or payer ((By their Member ID in my system) to perform actions on when one of these are sent?

此外,如果我想检查订阅ID,这样做会更聪明吗?

Also, If I wanted to check for a subscribe ID will it be smarter to do it like this?

if($payment_status == "Refunded" || $payment_status == "Reversed" || $payment_status == "Partially Refunded"){

if($subscr_id){

mysql_query("UPDATE members SET month_date = '$gettoday', subscr_id = '$subscr_id', subscr_cancel = 'Y', active = 'N', prepay = 'N' WHERE id='$id'");

} else {

mysql_query("UPDATE members SET month_date = '$gettoday', subscr_cancel = 'Y', active = 'N', prepay = 'N' WHERE id='$id'");

}}

推荐答案

Paypal将首先发送一个IPN,该IPN的付款状态将被撤销,然后再发送另一个IPN,并将其状态退款.因此,我不会像您在原始示例中所做的那样包括退款和退款.

Paypal will first send an IPN that the payment status is reversed, followed by another IPN with the status refunded. So, I would not include both reversed and refunded as you did in your original example.

对于测试user_id来说,这始终是一致的,每个IPN都包含付款人的Paypal电子邮件,其中包括已撤消/已退款的消息.

As for testing for the user_id, that's always consistent, every IPN includes the payers paypal email including the reversed/refunded messages.

这篇关于帮助pay_status PayPal退款(部分撤消IPN)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆