Issue
With the oldest PayPal API, setting the return URL when a checkout is accomplishment, or when checkout is eliminated is easy, as described here:
Payment payment = new Payment();
RedirectUrls redirectUrls = new RedirectUrls();
redirectUrls.setCancelUrl(cancelUrl);
redirectUrls.setReturnUrl(successUrl);
payment.setRedirectUrls(redirectUrls);
How can I accomplished this goal with new PayPal API? I have already setting an url return (google.com for testing) in my sandbox account but it seems not work..
Solution
Which new API? There are several. Are you using the Checkout-Java-SDK? The best integrations do not use a redirect, and hence do not need a return URL.
Instead, implement two routes on your server that return JSON data -- one for 'Create Order' and one for 'Capture Order', documented here.
The approval flow to pair those two routes with is: https://developer.paypal.com/demo/checkout/#/pattern/server
This flow does not redirect away, hence there is no need or use for a return URL and if specified it will be ignored.
I have already setting an url return (google.com for testing) in my sandbox account but it seems not work.
That is for non-API integrations that use a link or HTML form post. There is no API integration that pays any attention to that profile setting.
Answered By - Preston PHX
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.