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
- Using Paypal Smart Buttons for checkout sometimes fails with Debit/ Credit Cards Form in Braintree Client-side Integration (JS, iOS, Android SDKs)
- Getting errors when integrating standard checkout with my web site. Probably a beginner problem. in SDKs
- Need help to integrate PayPal Checkout with Ecwid in PayPal Upgrade Community
- PayPal Checkout golden buttons opens checkout window with different options in PayPal Upgrade Community
- User is asked for shipping address when creating a credit card order in REST APIs