How can I immediately start charging a user for a PayPal payment agreement?
Here is what I have so far.
- Create a tariff plan (POST ... / payments / billing-plans /)
- Make it active (PATCH ... / payments / billing-plans /)
- Create billing aggregation (POST ... / payments / billing agreements /)
- Send user approval url, user approves, redirects to return url
- Fulfill agreement (POST ... / payments / billing agreements // agreement-fulfill)
It all works, but I want to charge the user right now and every month in the future. If I set start_date in step 3, I get an error, it should be in the future. If I install it in the future, the user will not be charged.
Do I need to “Set Amounts of Unpaid Agreements” and then “Debt under a cashless agreement” for the initial payment?
In addition, with regard to monthly payments, do they need some action or do they just happen, as indicated in the Invoicing Plan?
Update
I am testing this around 2014-09-16T20:06:30+0000
If I send start_date as the current UTC time, in step 2 an error message will appear, which should be in the future.
If I send the current date +30 seconds or +2 hours, I will go to step 5, which returns a 400 response: UNKNOWN_ERROR "An unknown error has occurred"
If I send the current date +4 hours, everything will work. The current UTC time is 8pm, so adding 4 hours means start_date will be tomorrow.
Does this mean that I can’t charge the user today? Should start_date be the next day or even the next business day?
paypal
Jake
source share