Choose your API version:
If you get a redirect action.type
:
-
Get the
action.url
from the /payments response: -
Redirect the shopper to the
action.url
with the HTTP method fromaction.method
.-
For redirect payment methods, the
action.method
is GET:curl https://test.adyen.com/hpp/redirectIdeal.shtml?brandCode=ideal¤cyCode=EUR&issuerId=1121... \
-
For 3D Secure redirect, the
action.method
is POST:curl https://test.adyen.com/hpp/3d/validate.shtml \ --data-urlencode 'PaReq=eNpVUttygjAQ/RXbDyAXBYRZ00HpTH3wUosPfe...' \ --data-urlencode 'TermUrl=https://example.com/checkout?shopperOrder=12xy..' \ --data-urlencode 'MD=OEVudmZVMUlkWjd0MDNwUWs2bmhSdz09...'
The shopper is redirected to a page where they need to take additional action, depending on the payment method.
For security reasons, when displaying the redirect in the app, we recommend that you use SFSafariViewController for iOS or Chrome Custom Tabs for Android, instead of WebView objects. Also refer to the security best practices for WebView.
After the shopper completes the payment, they are redirected back to your
returnUrl
with HTTP GET. ThereturnUrl
is appended with a Base64-encodedredirectResult
:GET /?shopperOrder=12xy..&&redirectResult=X6XtfGC3%21Y... HTTP/1.1 Host: www.your-company.com/checkout
-
-
Get the
redirectResult
appended to the URL and pass it to your back end to verify the payment result in the next step.If a shopper completed the payment but failed to return to your website or app, you will receive the outcome of the payment in a notification webhook.
-
From your server, make a /payments/details request, specifying:
details
: Object that contains the URL-decodedredirectResult
.
The response contains:
resultCode
: Use this to present the result to your shopper.pspReference
: Our unique identifier for the transaction.