Closed lucashu1 closed 4 years ago
I'm happy to put in a PR for this if you'd like, @Luehang!
Hi,
There has been an update for that recently.
Type in the following to the command line to update the package.
$ npm install react-paypal-button-v2@2.6.0 --save
or
$ yarn add react-paypal-button-v2@2.6.0
And follow the section for Subscription Example.
Is your feature request related to a problem? Please describe. PayPal's checkout buttons support a
createSubscription
function for recurring payments. Currently, thePayPalButton
component in this repo does not support thecreateSubscription
function. It only supportscreateOrder
, for one-time payments.Describe the solution you'd like Allow the
PayPalButton
component to take in acreateSubscription
prop that then gets passed into PayPal's button component. The user should be able to pass increateSubscription
orcreateOrder
as a prop to the button component, but not both.Describe alternatives you've considered
createSubscription
(instead ofcreateOrder
) as a prop to this repo'sPayPalButton
component. This didn't work, because thePayPalButton
component does not acceptcreateSubscription
as a prop.createOrder
function, but callingactions.subscription.create()
instead ofactions.order.create()
. This didn't work, because theaction
object that gets passed intocreateOrder
does not support theactions.subscription.create()
function.Additional context See more information about the
createSubscription
function here: https://developer.paypal.com/docs/subscriptions/integrate/#4-create-a-subscription.You should be able to pass in
createSubscription
like so: