daslicht
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Jul-17-2018
05:15 AM
Hello,
the payment is working with server api.
But how to add additional POST parameters to the actions.request.post call ?
For example the Product id so that the server knows what to actually checkout ?
Cheers Marc
paypal.Button.render({ env: 'sandbox', locale: 'en_US', style: { size: 'small', color: 'gold', shape: 'pill', }, payment: function(data, actions) { return actions.request.post('/api/create-payment/') //<------- add post parameter here ? .then( function( res ) { return res.id; }); }, onAuthorize: function (data, actions) { return actions.request.post('/api/execute-payment/', { paymentID: data.paymentID, payerID: data.payerID }) .then( function( res ) { console.log('confirmation message',res); }); } }, '#paypal-button_{{@i.id}}');
Cheers Marc
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Accepted Solutions
daslicht
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul-17-2018
07:23 AM
[SOLVED]
it was as easy as :
return actions.request.post('/api/create-payment', { product_id: 999, })
1 REPLY 1
daslicht
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul-17-2018
07:23 AM
[SOLVED]
it was as easy as :
return actions.request.post('/api/create-payment', { product_id: 999, })

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- p is not a function error using the example downloaded from Paypal in SDKs
- Selected Shipping Method amount not updating to cart for card payment in SDKs
- Error payment in PayPal Payments Standard
- Inquiry About Documentation and Support for Tokenization and Future Payment in Payflow
- PayPal Express Error #10413 when people use a discount code on my Magento2 store in PayPal Payments Standard