我制定了如下 49 美元的 Paypal 计划:
{
'id': 'P-PAYPAL-ID',
'name': "My Plan",
'description': 'My description of the plan',
'type': 'INFINITE',
'merchant_preferences': {
'auto_bill_amount': 'YES',
"initial_fail_amount_action": "CONTINUE",
"max_fail_attempts": "3",
"return_url": "https://example.com/paypal/response",
"cancel_url": "https://example.com/paypal/response"
},
'payment_definitions': [{
'name': 'Monthly payment',
'type': 'REGULAR',
'frequency': 'MONTH',
'frequency_interval': 1,
'cycles': 0,
'amount': {
'value': '49',
'currency': 'USD'
}
}]
}
我已经创建了计划并在 documentation here 之后启用了它.
然后我创建了一个 Billing Agreement按照以下步骤:
- 创建结算协议(protocol)
- 将用户重定向到 Paypal 页面以接受协议(protocol)
- 根据我在 1 中获得的 URL 执行协议(protocol)。
一切正常,在我的沙盒用户帐户中,我可以看到标记为有效的“定期付款详细信息”。
我为我的服务器订阅了 webhooks。
我的问题如下:付款没有立即完成?我已经等了一个小时了,什么都没付!
我是否忘记提出“执行已执行协议(protocol)”的请求...?
最佳答案
简短而甜蜜的回答是,这是不可能的。在协议(protocol)中,您可以选择设置开始日期值。根据我的经验,以下陈述是我得出的结论。
看起来付款只是根据当前日期 07:00 UTC 之前或之后的日期处理。
例如。当前日期时间是 2017-05-04T04:50:00.00Z 我将开始日期设置为当前 UTC 日期时间加 30 秒。因为协议(protocol)日期设置为大于当前日期时间的值,API 不会抛出错误,但它不会将您的时间设置为您指定的时间。而是将其设置为 2017-05-04T07:00:00Z。
现在,如果您有相同的日期时间 2017-05-04T04:50:00.00Z,而不是添加 30 秒,而是添加 24 小时,您会认为您的时间将设置为 2017-05-05T04 :50:00.00Z。但是不,时间将设置为 2017-05-05T07:00:00Z。
所以这些似乎只是在每天 07:00 UTC 处理,除了日期你不能指定任何东西。
关于Paypal结算协议(protocol)没有快速支付?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40023361/