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
I am implementing subscription based payment in reactjs project and i have created product and plan id and below is my code