我想测试PayPal订阅IPN,包括在创建订阅时接收到的IPN和随后发送的下一笔付款的IPN(例如,如果每月订阅费用是$x,则为每月)。
然而,我不想等一个月或一天才能收到第二个IPN。是否有一种方法可以更快地发送IPN,例如每小时,使用PayPal或他们的沙箱?
文档中说,您只能将年、月、日和周指定为订阅期限。
我想测试PayPal订阅IPN,包括在创建订阅时接收到的IPN和随后发送的下一笔付款的IPN(例如,如果每月订阅费用是$x,则为每月)。
然而,我不想等一个月或一天才能收到第二个IPN。是否有一种方法可以更快地发送IPN,例如每小时,使用PayPal或他们的沙箱?
文档中说,您只能将年、月、日和周指定为订阅期限。
{
"txn_type"=>"subscr_signup",
"subscr_id"=>"unique_id",
"verify_sign"=>"random_gibberish",
"item_number"=>"your_subscription_name"
"subscr_date"=>"14:32:23 Feb 15, 2010 PST",
"btn_id"=>"1111111",
"item_name"=>"Your Subscription Description",
"recurring"=>"1",
"period1"=>"1 M",
# This example is from a "free trial" IPN notification-- if you don't have a
# free trial defined, there will only be 'period1' fields, and they'll
# have the data that appears here in the 'period3' fields.
"amount1"=>"0.00",
"mc_amount1"=>"0.00",
"period3"=>"1 M",
"amount3"=>"34.95",
"mc_amount3"=>"34.95",
"mc_currency"=>"USD",
"payer_status"=>"verified",
"payer_id"=>"payer_unique_id",
"first_name"=>"Test",
"last_name"=>"User",
"payer_email"=>"test_xxxx@example.com",
"residence_country"=>"US",
"business"=>"seller_xxxxxxx@example.com",
"receiver_email"=>"seller_xxxxxxx@example.com",
"reattempt"=>"1",
"charset"=>"windows-1252","notify_version"=>"2.9","test_ipn"=>"1",
}
{
"txn_type"=>"subscr_payment",
"subscr_id"=>"unique_id",
"verify_sign"=>"random_gibberish",
"txn_id"=>"payment_unique_id",
"payment_status"=>"Completed",
"payment_date"=>"12:45:33 Feb 16, 2010 PST",
"item_number"=>"your_subscription_name"
"subscr_date"=>"14:32:23 Feb 15, 2010 PST",
"custom"=>"data-you-sent-in-a-custom-field",
"id"=>"1",
"payment_gross"=>"34.95",
"mc_currency"=>"USD",
"payment_type"=>"instant",
"payment_fee"=>"1.31",
"payer_status"=>"verified",
"mc_fee"=>"1.31",
"mc_gross"=>"34.95",
"btn_id"=>"1111111",
"payer_id"=>"payer_unique_id",
"first_name"=>"Test",
"last_name"=>"User",
"payer_email"=>"test_xxxx@example.com",
"residence_country"=>"US",
"receiver_id"=>"your_merchant_id",
"business"=>"seller_xxxxxxx@example.com",
"receiver_email"=>"seller_xxxxxxx@example.com",
"protection_eligibility"=>"Ineligible",
"transaction_subject"=>"",
"charset"=>"windows-1252","notify_version"=>"2.9","test_ipn"=>"1",
}
所以你几乎可以在不用等待一天的情况下完成大部分测试。当你认为你已经掌握了它的时候,你将在第二天收到大量的订阅IPN消息。
此外,这里是PayPal的文档链接,供进一步参考。
过去,在测试服务器中,指定为天数的时间段会被视为分钟,因此当指定为“d3”时,您将每3分钟被调用一次。我认为他们已经删除了这个功能,我不知道是否有任何替代功能来测试订阅。
嘿,我想向尼尔喊话,因为那正是我在寻找的内容,而且我没有足够的声望来回复或点赞...
信不信由你,PayPal仍然不方便使用IPN文件进行订阅测试 :/
所以,只是因为我没有在这里看到它,并且原始发布者似乎认为只有两个可能的响应来自Papal--
如果其他人也遇到问题,以下是一些在我的测试中触发了IPN的其他txn_type:
//when paypal subscription profile is created for the subscriber
subscr_signup
//payment made for a given billing cycle
subscr_payment
//when subscription fails
subscr_failed
//user cancels subscription - not
subscr_cancel
//end of term - paypal is "done" with that subscriber
subscr_eot
//why I was looking for this thread to begin with lol
recurring_payment_suspended_due_to_max_failed_payment
今天早上有位测试用户的IPN调用失败。查找相关信息后发现,还可能出现以下错误:
recurring_payment_profile_created
recurring_payment_profile_cancel
recurring_payment_profile_modify
recurring_payment
recurring_payment_skipped
recurring_payment_failed
欢乐的头痛 :)
更新: 我刚刚解决了我的问题 - 所以只是为了让它听起来像我知道我在做什么,我会解释一下...
我认为PayPal的订阅沙箱环境正在逐渐消失。 我注意到前几天当我在sandbox.paypal.com上胡闹时,我经常遇到“致命失败”。 刷新页面通常可以纠正这种情况,尽管有时我必须刷新几次才能恢复屏幕。
从他们击中我的IPN文件中我得到了同样的回应,这解释了为什么今天所有的订阅都被暂停了。感谢Neil,我能够重新发送IPN响应并将其捕获到文本文件中(lol),然后我打开IPN文件并读取响应,再将其传递回PayPal(这实际上比我说的要复杂得多)。
无论如何,通过刷新页面,我可以在更多或更少的情况下启动Paypal握手,当我这样做时,它是50/50 - 有时我会得到VERIFIED,有时我会得到致命失败 - 就像在他们的沙箱网站上尝试做任何事情一样(致命失败)。
以下是我从他们那里收到的部分错误响应示例... 我得到了一个200,所以我相信与连接性无关,但我开始看到“致命失败”的模式,并且这指向更多是他们端口的问题而不是我的问题。
HTTP/1.1 200 OK
Date: Tue, 29 Sep 2015 02:41:00 GMT
Server: Apache
Fatal Failure