当定期付款失败时,我需要模拟 IPN。然后,我的应用程序可以创建待处理发票并将其发送给客户。
我搜索并发现我需要设置将在下面处理的 IPNtxn_type
recurring_payment_skipped
recurring_payment_failed
这两个就足够了吗?
Also, Recently paypal has provided a new tool called IPN Simulator https://developer.paypal.com/webapps/developer/applications/ipn_simulator where you can send a sample IPN to a URL. It only supports below txn_type
s
我可以从哪里模拟这些?
请帮帮我。
您是对的,目前,IPN 模拟器不支持订阅的事务类型。昨天,2015 年 5 月 29 日,我在 PayPal-PHP-SDK github 上提出了这个请求
https://github.com/paypal/PayPal-PHP-SDK/issues/316 https://github.com/paypal/PayPal-PHP-SDK/issues/316
有一个解决方法,
对于 IPN Simulator,我选择一些交易类型,例如“购物车结账”。
然后在“自定义”字段中输入“sim”。
在我的 IPN 侦听器中,我有一个代码块,用于检查是否
“custom”字段设置为“sim”,如果是,那么我硬编码
测试值。
// if data is coming from the IPN Simulator then
// just hard code the data in here
if ( $rawData[custom] == "sim") {
$rawData[txn_type] = "recurring_payment";
$rawData[recurring_payment_id] = "I-ABCDEF123456";
}
如果“custom”未设置为“sim”,那么您的 IPN 侦听器会绕过此设置
代码块和功能正常。
注意:rawData是保存原始数据的数组。一开始
在 IPN 侦听器中,我获取所有原始数据并将其放入数组中。
这将使您的 IPN 脚本正常工作,
同时,不干扰任何其他真实IPN数据的传入。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)