Hey, I try to integrate the Subscriptions API to my website. First of all, I'm not sure if I should use this API or the billing agreement API, all I want is to bill my costumers with a fix amount each month... Anyway, I have created a product, a plan and a subscription, At the end I got an id (I-2PR5ANJT6J4C) I try to use this id in the PayPal button: <script src="https://www.paypal.com/sdk/js?client-id=sb¤cy=ILS"></script>
<script>paypal.Buttons({
style: {
shape: 'pill'
},
env: 'sandbox', // Or 'production'
// Set up the payment:
// 1. Add a payment callback
createOrder: function(data, actions) {
// 2. Make a request to your server
return new Promise(function(resolve) {
return resolve('I-2PR5ANJT6J4C');
})
},
// Execute the payment:
// 1. Add an onAuthorize callback
onAuthorize: function(data, actions) {
// 2. Make a request to your server
return actions.request.post('/my-api/execute-payment/', {
paymentID: data.paymentID,
payerID: data.payerID
})
.then(function(res) {
// 3. Show the buyer a confirmation message.
});
}
}).render('#paypal-button-container');</script> And I got this error: Uncaught Error: I-2PR5ANJT6J4C does not match pattern for order-id, ec-token or cart-id Anyone else faced this issue? How can I pass the subscription id to the button to work correctly? Thanks, Assaf
... View more