|
| 1 | +# Setting up the returnUrl |
| 2 | + |
| 3 | +The `returnUrl` is a **mandatory** configuration for handling payment redirections, such as 3DS2 web |
| 4 | +challenges or other redirect-based payment methods. It specifies the URL where the shopper should be |
| 5 | +redirected back to your app after completing an action. This URL must be **provided as a parameter |
| 6 | +in your `/sessions` or `/payments` request**. |
| 7 | + |
| 8 | +**Important considerations:** |
| 9 | + |
| 10 | +* When using the `/sessions` flow, you need to know the platform (Android or iOS) and the |
| 11 | + integration type (Drop-in or Components) upfront to correctly configure the `returnUrl`. |
| 12 | +* The maximum length for a `returnUrl` is **1024 characters**. |
| 13 | + |
| 14 | +## For Android: |
| 15 | + |
| 16 | +For Android, the returnUrl structure and prerequisites differ based on whether you are using the |
| 17 | +**Drop-in** or **Components** integration. |
| 18 | + |
| 19 | +### Android Drop-in |
| 20 | + |
| 21 | +When using the Drop-in solution, the returnUrl is **predefined**. |
| 22 | + |
| 23 | +* **Format:** `adyencheckout://` scheme, followed by your **package name**. |
| 24 | +* **Example:** `adyencheckout://com.adyen.adyen_checkout_example`. |
| 25 | + |
| 26 | +The `AdyenCheckout.instance.getReturnUrl()` method is available to provide this string value. You |
| 27 | +can also provide the string as a hardcoded constant. |
| 28 | + |
| 29 | +### Android Components |
| 30 | + |
| 31 | +For Components integration on Android, you need to define a **custom intent filter**. |
| 32 | + |
| 33 | +* **Format:** `adyencheckout://` scheme, followed by your **package name**. |
| 34 | +* **Path:** You **must add a path**. |
| 35 | +* **Example:** `adyencheckout://com.adyen.adyen_checkout_example/adyenPayment`. |
| 36 | + |
| 37 | +**Prerequisites for Android Components:** |
| 38 | + |
| 39 | +* **Add a [custom intent](https://github.com/Adyen/adyen-flutter/blob/main/example/android/app/src/main/AndroidManifest.xml#L29) filter** to your `Manifest.xml` file. |
| 40 | +* Providing an alternative custom scheme is not yet supported. |
| 41 | + |
| 42 | +## For iOS: |
| 43 | + |
| 44 | +For iOS, the returnUrl setup is **consistent for both Drop-in and Components** integrations. |
| 45 | + |
| 46 | +* **Format:** You need to **define a unique custom URL scheme** for your app. |
| 47 | +* **Example:** `com.mydomain.adyencheckout://`. |
| 48 | + |
| 49 | +**Prerequisites for iOS:** |
| 50 | + |
| 51 | +* **Add the [return URL handler](https://github.com/Adyen/adyen-flutter/blob/main/example/ios/Runner/AppDelegate.swift#L18)** to your `AppDelegate` in your native iOS layer. |
| 52 | +* **Configure the [custom URL scheme](https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app)** in your your `Info.plist` file. |
0 commit comments