Subscription Integration - Paypal using Nodejs and ReactJS

十年热恋 提交于 2020-03-25 14:24:52

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!