Smart Payment Buttons redirect implementation.
felipejt
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Jul-09-2019
02:49 PM
Hi, actually I do a little implementation with Paypal Smart Buttons SDK and Paypal Checkout Java SDK, and I need to redirect to a success page. Can it is possible? Actually I'm tried to use Side Server application context configuration.
paypal.Buttons({ createOrder: (data, actions) => { // Set up the transaction return fetch('${contextPath}/paypalCreateOrder', { method: 'post', headers: { 'content-type': 'application/json' } }).then(function (res) { return res.json(); }).then(function (data) { return data.orderID; }); }, onApprove: (data, actions) => { // Capture the funds from the transaction return actions.order.capture().then(function (details) { // Show a success message to your buyer console.log('Transaction completed by ' + details.payer.name.given_name); return fetch('${contextPath}/paypalValidation', { method: 'post', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ orderID: data.orderID }) }).then(function (res){ return res.json(); }).then(function (data){ actions.redirect(); return data; }); }); }, onCancel: (data, actions) => { return actions.redirect(); } }).render('#paypal-checkout-buttons');
This implementation is development under a Spring Boot Application.
Labels:
Login to Me Too
- Labels:
-
Mobile SDKs
-
REST SDK
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.
Related Content
- What happened to PayPal Buttons?! in PayPal Payments Standard
- Require non-consumer email for guest checkout (Subscription) in NVP/SOAP APIs
- Woocommerce Elementor auto-redirect after payment in Sandbox Environment
- createOrder not being directed to OnApprove actions.redirect in PayPal Payments Standard
- Create Smart Button Redirect to Developer Guide in PayPal Payments Standard