问题
I am trying to integrate Paypal subscriptions into a ReactJS and NodeJS website.
I have the following code on the client:
window.paypal.Buttons({
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': 'P-5WJ4336006859111JLWVUDTQ'
});
},
onCancel: function (data) {
this.props.handleResponse({error: "The user cancelled"});
},
onApprove: function(data, actions) {
alert('You have successfully created subscription ' + data.subscriptionID);
}
}).render('#paypal-button');
What code do I need on the server (node) side to make this work?
Can someone please point me in the right direction?
来源:https://stackoverflow.com/questions/58533129/subscription-integration-paypal-using-nodejs-and-reactjs