PayPal 计费协议 REST API - 如何立即开始 [英] PayPal billing agreements REST API - how to start immediately
问题描述
如何立即开始向用户收取 PayPal 结算协议的费用?
How can I start charging a user the user immediately for a PayPal billing agreement?
这是我目前所掌握的.
- 创建计费计划 (POST .../payments/billing-plans/)
- 激活它(PATCH .../payments/billing-plans/)
- 创建账单协议(POST .../payments/billing-agreements/)
- 将用户发送到approval_url,用户批准,重定向到返回url
- 执行协议(POST .../payments/billing-agreements//agreement-execute)
这一切似乎都有效,但我想现在和将来每个月都向用户收费.如果我在步骤 3 中将 start_date
设置为现在,我会收到一个错误,它一定是在将来.如果我将来设置它,则不会向用户收费.
This all seems to work, but I want to charge the user right now and every month in the future. If I set start_date
to now in step 3 I get an error, it must be in the future. If I set it in the future the user is not charged.
对于首期付款,我是否需要先设置未付协议金额",然后再支付未付协议金额"?
Do I need to 'Set outstanding agreement amounts' then 'Bill outstanding agreement amounts' for the initial payment?
此外,每月付款情况如何,是否需要采取某些措施,还是只是按照账单计划中的规定发生?
Also, what about monthly payments, do they require some action or do they just happen as specified in the Billing Plan?
更新
我正在围绕 2014-09-16T20:06:30+0000
如果我将 start_date
作为当前 UTC 时间发送,它会在第 2 步出现错误,告诉我它一定是在未来.
If I send start_date
as the current UTC time it get an error at step 2 telling me it must be in the future.
如果我发送当前日期 +30 秒或 +2 小时,我会进入第 5 步,它返回 400 响应:UNKNOWN_ERROR发生未知错误"
If I send the current date +30 secs or +2 hours I get through to step 5 which returns a 400 response: UNKNOWN_ERROR "An unknown error has occurred"
如果我发送当前日期 +4 小时,则一切正常.当前 UTC 时间是晚上 8 点,因此增加 4 小时意味着 start_date
是明天.
If I send the current date +4 hours it all works. The current UTC time is 8pm so adding 4 hours means the start_date
is tomorrow.
这是否意味着我今天无法向用户收费?start_date
是否必须在第二天甚至下一个工作日?
Does this mean I can't charge the user today? Does the start_date
have to be in next day or even the next business day?
推荐答案
我曾与 PayPal 代表交谈,发现 start_date
必须是明天或更晚.他们将把这个添加到文档中.
I've talked to a PayPal rep and found that start_date
must be tomorrow or later. They are going to add this to the docs.
如果您想立即开始按月计费,您可以通过将开始日期设置为一个月后并收取第一个月的设置费来实现.我没有测试过这个,因为它不是我想要的.
If you want to start monthly billing immediately you might be able to do it by setting the start date to be in one months time and charging a setup fee to cover the first month. I haven't tested this as it's not what I want.
这篇关于PayPal 计费协议 REST API - 如何立即开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!