Subscription help / Node, React & react-paypal-button-v2

cjohnweb
Contributor
Contributor

I am trying to integrate PayPal subscription into my React app. I've run through the docs at https://developer.paypal.com/docs/subscriptions/integrate/ . I created a product and a plan. That seems to be fine.

I've installed the react-paypal-button-v2 and added my button:


```
<PayPalButton
options={{ vault: true, clientId: "sb", currency: "USD" }}
createSubscription={(data, actions) => {
return actions.subscription.create({
plan_id: 'P-#######xxxxxxxxx'
});
}}
onApprove={(data, actions) => {
// Capture the funds from the transaction
return actions.subscription.get().then(function (details) {
// Show a success message to your buyer
alert("Subscription completed");

// OPTIONAL: Call your server to save the subscription
return fetch("/paypal-subscription-complete", {
method: "post",
body: JSON.stringify({
orderID: data.orderID,
subscriptionID: data.subscriptionID
})
});
});
}}
/>
```

But I get an error immediately after I click any of the buttons that appear on the screen. The first error that I see is: POST https://www.sandbox.paypal.com/v1/billing/subscriptions 404 (Not Found)

Am I missing something? Is the library just broke? I'm not sure how to really debug this at this point.

Thanks
Login to Me Too
1 REPLY 1

MTS_Chiranjeevi
Moderator
Moderator

Hi @cjohnweb,

 

Thank you for contacting PayPal community.

 

We apologize for any inconvenience.

 

I request to please use billing plans and subscriptions to create subscriptions that process recurring PayPal payments for physical or digital goods, or services.

 

Please refer the detailed integration guide link.

 

Thank you for understanding and patience.

 

Sincerely,

Chiranjeevi

PayPal, Inc.

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.