Redirection methods
Any method the session marks template = "redirection" or integration_mode = "redirection" renders nothing in your screen: the PSP's hosted page is the payment step. Bank transfers (Fintecture), BNPL providers (Oney, Sequra, Alma…), local schemes (Bizum, iDEAL, Bancontact…), and any card method you configure in redirection mode all take this path.
Setup
| Artifact | eu.purse:headless-checkout-android, nothing else |
| Dashboard | The method activated on the entity in redirection mode. Its return URL is part of the client session |
| Manifest | Nothing. The redirect Activity and its return scheme, ${applicationId}.redirect, ship in the SDK |
| Keys | None in the app |
Switching a method to redirection mode in the dashboard is how you offer, on Android, a method the SDK has no native plugin for: a PSP-hosted card form, Riverty, Alma, MB Way… The Supported payment methods table marks them.
Render and pay
Create the element when the shopper selects the method: creation runs POST /init, which consumes a step of the session.
val element = rememberPaymentElement(checkout, method, listener) // /init on creation
LaunchedEffect(method.id) { checkout.setPrimary(method) }
Button(onClick = { element.submit() }, enabled = element.ready) { Text("Pay") }
hasUi is false: there is nothing to place, only your Pay button. element.ready turns true once /init answered. submit() runs /validate and opens the PSP page in the SDK's Activity: an in-app WebView restricted to https, which finishes when the page reaches the app's return scheme or the session's return URL.
To know whether a listed method is one of these, ask the registry rather than reading the session yourself:
val isRedirection = PluginRegistry.getPlugin(method.partner, method.method, checkout.session.source) is RedirectionPlugin
Outcomes
| Outcome | When |
|---|---|
ReturnedFromRedirect | The normal case: the shopper came back from the PSP page. Not an outcome. Show a processing state; your backend confirms the payment |
Completed | /validate returned no page to open. Legitimate for some PSPs, logged as a warning |
Canceled | The shopper dismissed the page without completing |
Failed | /init or /validate failed, or the page could not open |
A return is never an outcome: the PSP's final page is not something the app can read. Get the final status from your backend, through webhooks or Get a client session.
Open the page yourself
The onRedirection hook receives the resolved RedirectAction (Get(url), PostForm, PostHtml) before the SDK opens its Activity. Return true to open it yourself, in a Custom Tab for a Get for instance; detecting the shopper's return is then yours. See Hooks.
Process death
Android may kill the app while the shopper is in a bank app. Snapshot the checkout with saveState() and rebuild it with restore(): the return then reaches the recreated element as ReturnedFromRedirect, and a session already submitted refuses a second submit. See Sessions.
Troubleshooting
| Symptom | Cause |
|---|---|
| The method never appears | The session does not mark it as redirection (a near-miss template value such as redirection_suffix does not match) |
Completed right after Pay, nothing opened | /validate returned no redirect. Check the method's configuration with Purse support |
| The PSP page refuses to render in the app | Some providers block embedded WebViews. Take the redirect over with onRedirection and a Custom Tab |
Failed with API_ERROR, message mentions redirection init not successful | The /init was refused for this item |
Failed with METHOD_NOT_IMPLEMENTED | The item resolved to no plugin at all: the method is neither natively supported nor in redirection mode |