Luehang / react-paypal-button-v2

An easy and simple to use React button component to implement PayPal Checkout with Smart Payment Buttons V2 (Version 2).
https://luehangs.site/lue_hang/projects/react-paypal-button-v2
MIT License
274 stars 81 forks source link

using subscription in paypal is always giving status as EXPIRED #98

Open bipindubey-technoark opened 3 years ago

bipindubey-technoark commented 3 years ago

I am implementing subscription based payment in reactjs project and i have created product and plan id and below is my code

<PayPalButton
                options={{
                    vault: true,
                    clientId: 'MYCLIENTID'
                }}
                createSubscription={(data, actions) => {
                    return actions.subscription.create({
                        plan_id: 'P-XXXXXXXXXXXXXXXXXXX',
                    });
                }}
                onApprove={(data, actions) => {
                    // Capture the funds from the transaction
                    return actions.subscription.get().then(function (details) {
                        // Show a success message to your buyer
                        console.log('data', JSON.stringify(data));
                        console.log('details', JSON.stringify(details));
                        alert('Subscription completed');
                        onSuccess(data, details);
                    });
                }}
                onError={(error) => {
                    console.log('1', error);
                }}
                catchError={(error) => {
                    console.log('2', error);
                }}
            />
        I have replaced client id and plan id with mine .. and payment is also working but it is giving the status as EXPIRED...
        What could be the issue here?? Please help me 

        Thanks
Anchalparas commented 3 years ago

@bipindubey-technoark did you find the solution to the above. I am getting the same issue

bipindubey-technoark commented 3 years ago

@Anchalparas not yet

bipindubey-technoark commented 3 years ago

@Anchalparas for now i am sending COMPLETED as status in BE database for test purpose.