-
Notifications
You must be signed in to change notification settings - Fork 90
Billing agreements: taking the first payment immediately #180
Comments
I've forwarded this question to the API team and will let you know as soon as I hear back from them. :) |
Thank you! :) |
One more thought: Does it even make sense to define this in the billing agreement? Shouldn't things like start date and trial period be defined in the plan? Here's how I think of it: The Plan is a template for creating a subscription. It contains all of the logic about how much to charge, how often, when to start, whether to offer a trial, and so on. The Agreement is where you ask users for permission to sign them up to a plan. The agreement also contains any user-specific data that Paypal or the merchant requires. For example, you might need to pass a user ID from the merchant's database to Paypal's page, which Paypal would return via IPN; this would be done using the Agreement. |
You're correct to think of it that way - that the plan is a template for creating a subscription agreement. However, the plan is (from the API's perspective) intended to be something that can be setup well in advance of creating an agreement. The agreement To your point of an agreement representing asking users for permission to sign up with the plan, the agreement is also the part where your users agree exactly when their plan will begin (and how long their trial period will be and what date, specifically, the trial period will end). Granted, most agreements will likely include a |
Ah yes, you're right of course. It does potentially need the start date to be specified in the agreement. ...assuming that the start date is an actual date, rather than an offset. But even then, it's probably more flexible to put a date in the agreement, rather than an offset in the plan. For example, a company might require more setup time over Christmas when staff are on holiday. |
+1 for this, with the added difficulty that I'd like to initially charge a variable amount (so for instance a user signs up with a 50% off your first month code). Is this a viable way to do it?:
Seems unbelievably complicated to me but I can't see any other way to do this without forcing the user to authenticate twice (once to authorise a payment, then once to authorise the billing agreement) |
From what I can see, this could be possible with Future Payments (provided they could be handled on the server-side) but I can only see access to that through the mobile SDK. |
Also, the Ruby API ref docs don't have example calls for dealing with Plans. |
Thanks for sharing your use case, @sjmog - we'll include that scenario in our discussions with the Subscription API team and get back to you when we know the answer. I agree that the whole thing is overly complicated in its current form, and we're looking to see if we can help mitigate that complexity a bit by providing more samples and possibly more helper methods in the SDK. On that note, the PayPal SDK team is currently compiling a list of use cases to discuss with the Subscription API team so we can update our sample projects with descriptions and code walkthroughs of how to handle various types of plans and agreements. Please continue to share any other use cases you might want or need clarification on so we can provide better samples & guidance. :) As for the developer docs page on Billing Plans & Agreements, it looks like Ruby isn't alone in lacking examples - every other language is missing them as well (except for the cURL calls). I'll notify the docs team to see if we can begin the process of getting those code samples for each language. |
+1 |
Another question – when setting up a If taken instantly, it could accommodate what I'm trying to do. |
@sjmog @MikeHopley Good news !! As per @sjmog suggestion, you could use setup_fee to make the first charge. This is the response from the internal API Team:
Note: The setup_fee will get processed when the agreement is executed (and not created) in paypal as funding source. (Once buyer agrees to agreement in the flow) Let me know if you have any follow up questions around this. |
OK great, thanks. Would be sensible to be able to change the name of setup_fee so it could be use case-dependent. |
This is far from intuitive. The documentation will need to be explicit and show examples, or so many people are going to be confused. I remember Worldpay pulling something like this with free trials, where my customers got charged immediately despite being on a free trial. I was not a happy bunny. Just to get this clear, could I go through two scenarios? This is what I think will happen; please confirm or correct: Scenario 1: with setup feeI create a billing agreement for $5 each month. I set the Outcome: the customer is charged $5 immediately, and then $5 a month later, and so on. Scenario 2: no setup feeI create a billing agreement for $5 each month, but I leave Outcome: the customer is charged nothing at first, but will be charged $5 a month later, and so on. |
@MikeHopley that's what I understand will happen. You have to set the recurring date for the agreement in the future. As it stands, the only way PayPal can account for variably-priced initial subscriptions (e.g. checkout codes and so on) is if each new subscription has its own plan. And its own agreement. So users will have two objects, a plan and an agreement – which seems needlessly complex, but it's better than not being able to do variable pricing at all. |
Thanks @sjmog ! |
Btw, if you checkout the api docs for creating an agreement, you will see they have an So, generally, what I would suggest is to get the subscription start date as for e.g. 1st of every month, and pro-rate the remaining days (charge them for remaining days from the day they sign up the agreement) as a |
@jaypatel512 excellent so long as the user has no checkout code or discount! |
That logic should work but it seems on the sandbox (developer mode) payments are not processed at all. I have a setup_fee which is pending since beginning of December 2014 and several agreements not generating any transactions despite being active. Basically neither setup_fee or monthly payments transactions get sent from test buyer to test facilitator. Is there something special about the sandbox which freezes subscriptions? Are they simply not scheduled at all? I could try directly in production to see if it works but I would prefer to validate the whole logic in sandbox first. |
@nitrotm there is a known problem with billing plans and agreement on IPN reporting on sandbox as far as i know. |
@ulkas thanks for the info. In my case it's not only the IPN notifications which are not working but also the execution of the agreement itself. If I log on paypal sandbox and check my accounts (facilitator and/or buyer) the subscriptions are active but no payment is made at all. Maybe it's related to the IPN in some ways but so far I fail to connect these two issues. |
@ulkas ah, ok! What is the known problem? |
Hi @nitrotm, have you figured out the pending issue? Does this issue exists in the live environment as well? |
@gregwym After going live, I found the initial payment was not processed reliably in production. So I implemented a server-side check to make sure the agreement is in 'active' state as a confirmation that the subscription is still valid, until I can receive and confirm a transaction. Eventually the initial payment is made, but that could be up to a day later. |
Internal tickets for tracking |
Hi, |
Hi @ppmtscory, Could you please throw some light at why did you close this request? Reading through this and other related threads, I can see that setup_fee is being discussed as workaround to take first payment immediately. So, are you guys ever going to introduce whatever permanent solution? As I understand original request implies this. |
@aquarelius-, please see #504. |
what happens if the customer has 0 balance in his account. If I charge a |
@viper-pranish that's the entire point of #504 . The fix will (hopefully) be live on August 22nd. |
@omarkilani Paypal rest api asks for start date in ISO8601 and I sent the |
@viper-pranish this is an unfortunate "feature" of the PayPal API. The fact that they return timestamps in PDT instead of UTC like any sane service tells you all you need to know about how much they care about this. :) I think the real issue here is that all this stuff is built on a legacy core, which probably can never be touched because of how entrenched PayPal is. |
@omarkilani are you sure about the time zone returned by PayPal ? |
I have a large amount of customers not being able to get passed the initial payment (state of "cancelled") is passed back, which is what I want. Why are so many people not able to make the initial payment? |
And what if I have next_billing_date as a past date? |
+1 same as @viper-pranish, |
I'm experiencing the same issue as @viper-pranish. I tried both live and in sandbox. Sandbox
Live
What am I supposed to do? I just want to subscription to start as soon as users subscribe, by charging them as soon as possible. Is there a document clarifying these issues? @viper-pranish reported this issue months ago. Has it been solved? Is there a workaround? Since it looks like an issue related to time-zones, I live in UK (UTC). |
I'm using the JS API and it has the same issue. Does Recurring Billing even support different times? Is this an undocumented "feature" P.S the setup_fee workaround is not acceptable as I need to charge the customers actual setup fees! |
Yes this is a "feature". It aligns it with midnight in America/Los_Angeles because... I'm sure that's just how it was built 15 years ago or whatever. There is no solution apart from setup fee. |
Could you add the two charges together (actual setup fee + initial subscription charge), and use this value for the It's a hack, of course. Welcome to Paypal development. ;) Alternatively, could you make two Paypal charges in separate API calls? One is the subscription with the initial payment using the |
There are ways to code around the issue but they deliver customer experiences that you have to talk around: Why am I charged a setup fee when I accept the agreement as well as separately on the invoice? It's not elegant and as your pricing structure gets more complex you create a bigger your barrier to sales. |
And that's why we primarily use Stripe, and have PayPal as a backup for those who enjoy painful experiences. :) |
I want to give some example of how to "fix" this This is a test plan I created
This is the list of events I received
I hope this help some |
Is next_billing_date still always 10:00:00Z? Why not other time? |
In my understanding it is the date that is the important piece. The REST API implementation is built on the same engine as the Classic API, where time was not provided for this value, only the date.
More details can be found in this thread #681 |
hi can anyone let me know how can i get the transaction fee for the setup fee. |
@usamamashkoor I believe you have an answer in another issue but if that is not the case please create one and we will look further. |
@pp-randy yes thanks randy i have the answer. |
Can somebody please point to the topic how to implement customer subscription solution with variable weekly amount. API fails when you try to update Billing Plan payment definition. |
@karabitski we are tracking the ability here. Depending on the amount you can use the Classic API with the same Billing Agreements https://github.com/paypal/PayPal-REST-API-issues/issues/24 You can use https://developer.paypal.com/docs/classic/api/merchant/UpdateRecurringPaymentsProfile_API_Operation_NVP/ with the Billing Agreement Ids to modify prices, within some limitation though. |
Why you people dont use
https://www.goldieui.info/code-snippets/express-checkout-recurring-payment-initial-amount/ |
Again, this is for the REST API in general.
When creating a billing agreement, the
start_date
parameter is required. It is formatted as an ISO8601 timestamp.Generally when people sign up to a subscription, we want to take the first payment immediately. Indeed, my system listens specifically for payment IPNs rather than "subscription started" IPNs.
So what are we supposed to do here? Do we set the
start_date
to the exact current time? Do we set it in the past? Do we set it a few minutes in the future, hoping that we can guess how long the user will take to finish the Paypal signup?If we set it too far in the future (say, an hour), the user must wait a while before getting access to premium content. If we set it too soon (say, a minute), then the user may take too long filling in the form; when they come back to our website, we will attempt to start the billing agreement in the past. That worries me. How will Paypal respond if I ask them to take a payment in the past?
Could this parameter be made optional, so that default behaviour is "pay immediately" and delaying the payment is optional?
The text was updated successfully, but these errors were encountered: