Not exactly a bug report but I cannot find any way to get this question answered by anyone at PayPal!
Per documentation at https://developer.paypal.com/docs/api/payments.billing-agreements/v1/ Billing Agreements have been deprecated and replaced with subscriptions (https://developer.paypal.com/docs/api/subscriptions/v1/)
However, I cannot figure out how to integrate these replacements into checkout.
I've tried returning the ba_token from subscription creation but there's no way to execute that.
Are there plans to upgrade Checkout to allow usage/execution of the new subscriptions?
Thanks
Yes, support is planned. @ravishekhar can provide some more details.
@thomasplevy Yes, The Recurring Payments API https://developer.paypal.com/docs/api/payments.billing-agreements/v1/ is deprecated.
You can read more about next generation Subscriptions APIs in these docs.
https://developer.paypal.com/docs/subscriptions/
https://developer.paypal.com/docs/api/catalog-products/v1/
https://developer.paypal.com/docs/api/subscriptions/v1/
The support for Subscriptions in the PayPal Checkout Buttons will be available in next few weeks. I will keep you posted.
Thanks @bluepnume & @ravishekhar
Is #1100 what we're talking about here? Should I be waiting for updates in documentation or would it be "safe" to start using the methods merged in that pr?
Yes #1100 is the PR. Presently waiting for one of API dependencies to go live before anyone can use the feature. I will update and close this issue once its live.
Thanks @ravishekhar
Hi @ravishekhar , I checked that #1100 is already merged in the 5.0.30 version. Is there now a way to use new subscriptions via Checkout?
Is there any way to workaround this limitation today? I have attempted using the createBillingAgreement callback and returning the billing agreements token ( "BA-..." ) from the subscriptions api through my server's endpoint, but that does not seem to work either.
At present it is not possible to use createBillingAgreement to create subscription id. We are working on introducing subscription related callbacks in button. I will update this issue once the feature is live, in a week or two.
Any update on this? We are eagerly looking to integrate with checkout.js and subscriptions. I can see that there's a significant amount of subscription code already in the library.
This feature is now live. Please feel to try it out while we are getting the Developer Docs updated.
Sample code
<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&vault=true"></script>
<div class="paypal-button" id="paypal-button-container"></div>
paypal.Buttons({
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': 'P-YOUR_PLAN_ID'
});
},
onApprove: function(data, actions) {
alert('You have successfully created subscription ' + data.subscriptionID);
}
}).render('#paypal-button-container');
Closing this issue. Please let me know in case of any issues.
It will appreciable if you can share any feedback or suggestions.
@ravishekhar following your example, i'm unclear how a subscription would be created in the case of a recurring donation, where the amount (aka plan) is essentially "dynamic" (the amount and the possibility of an end-date are determined by the payer). Using this new feature, how would one go about creating a plan "on the fly"? Is that even the correct approach?
Unfortunately dynamic amounts is not supported in this Subscriptions product. You can take a look at WPS variation https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/#recurring-payment-variables
@blinder
I'm creating "dynamic" plans but just creating a new plan on the fly whenever one is needed via an additional AJAX call to my server. I pass in the required information, create the plan, pass the plan id back and then use that to create the subscription.
Additionally I'm saving plan information in a local database so that if a "dynamic plan" already exists I don't have to recreate a duplicate one.
Hope that helps
@thomasplevy that's an interesting approach. I think that's what I'll end up doing. It was either that or creating 3 "canned" plans but that just felt really awkward, especially given the fact that our system is for collecting gifts. Thanks for this!
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
This feature is now live. Please feel to try it out while we are getting the Developer Docs updated.
Sample code
Closing this issue. Please let me know in case of any issues.
It will appreciable if you can share any feedback or suggestions.