PayPal计费协议REST API-如何立即开始 [英] PayPal billing agreements REST API - how to start immediately

查看:72
本文介绍了PayPal计费协议REST API-如何立即开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何开始立即向用户收取PayPal结算协议的费用?

How can I start charging a user the user immediately for a PayPal billing agreement?

这就是我到目前为止所拥有的.

Here's what I've got so far.

  1. 创建帐单计划(POST .../payments/billing-plans/)
  2. 启用它(PATCH .../付款/计费计划/)
  3. 创建帐单协议(POST .../payments/billing-agreements/)
  4. 发送用户到roval_url,用户批准,重定向到返回URL
  5. 执行协议(POST .../付款/计费协议//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屋!

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