PayPal checkout with subscribe, Things don’t appear to be working at the moment.

mbl-canary
Contributor
Contributor

 

I`m using PayPal checkout button with rest api (java) for regular billing on sandbox.

 

However, when the PayPal popup pops up, it doesn't show details like amount.

 

 

payment token id is

EC-4UF94209S66565250

 

 

at developer site, I can see api call history, web hook history both. (create, update)

what's wrong with me?

 

<script src="https://www.paypalobjects.com/api/checkout.js" data-version-4 data-log-level="warn"></script>

 

paypal.Button.render({
client: {
sandbox: 'AbByNC6gfa_Ku1W_et46uL5oXX6QQEiOWhXYezMmY5Vms_rSLYV7T1dlUoSDOMKwzSgzI-TPTuwOjCT-',
production: 'AWn0CydcmQ6T5GSMiaG-SyA1VgWD9HCkn4VNnLfkzryrHcGoNzIT8N3XfYkS8V6mG7z1byJmjJBAP6rr'
},
env: 'sandbox', // Or 'sandbox'
commit: true, // This will add the transaction amount to the PayPal button
payment: function(data, actions) {
// 2. Make a request to your server
return actions.request.post('/paypal/create-payment/')
.then(function(res) {
return res.id;
}).catch(function(err) {
console.log("catch " + err);
});
},
// Execute the payment:
// 1. Add an onAuthorize callback
onAuthorize: function(data, actions) {
// 2. Make a request to your server
return actions.request.post('/paypal/execute-payment/', {
paymentID: data.paymentID,
payerID: data.payerID
})
.then(function(res) {
// not yet
// 3. Show the buyer a confirmation message.
}).catch(function(err) {
console.log("catch : " +err);
});
}
}, '#paypal-button');

 

 and when onAuthorize, data.paymentId and data.payerId is undefined.

 

 

and... can't use PayPal checkout with subscribe?

there is no options for subscribe...

 

if so, I'm gonna make subscription by PayPal form button. 

its work. but I have to change amount every month with rest api.

can I do that? 

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

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