Next Action widget
Continue a pending DEUNA order through 3DS or another required customer action on Web, iOS, Android, and React Native.
On this page
Use Next Action when an existing order requires the customer to complete an additional step, such as a supported 3DS challenge or redirect. Reuse the original order token.
For 3DS, the returned experience may first collect browser and device signals, then continue without a challenge or display the issuer's challenge. A loading view does not mean the customer must authenticate manually. Keep the widget mounted while it manages the flow, and verify the original order after a callback or return. See the 3DS purchase flow for the stages and payment outcomes.
Decision flow#
order_token; do not create another order.See the customer experience#
Next Action works with both DEUNA payment widgets and merchant-owned payment forms. After your backend submits the payment, open Next Action only when the response requires another customer step. The widget then presents the supported 3DS challenge or alternative payment method (APM) redirect and reports the outcome through its callbacks.
The following walkthrough shows how the experience continues from a merchant checkout into the required post-payment action:
The video illustrates the customer-facing transition. Your integration must still use the payment response, callbacks, and backend reconciliation described below; do not infer the final payment state from what the customer sees in the widget.
Open Next Action#
await DeunaSDK.initNextAction({
orderToken,
callbacks: {
onSuccess: () => verifyOriginalOrder(),
onError: (error) => recoverAfterVerification(error),
onClosed: () => recoverAfterVerification(),
},
});await deunaSDK.initNextAction({
orderToken,
mode: 'modal',
callbacks: {
onSuccess: verifyOriginalOrder,
onError: recoverAfterVerification,
onClosed: recoverAfterVerification,
},
});let callbacks = NextActionCallbacks()
callbacks.onSuccess = { _ in verifyOriginalOrder() }
callbacks.onError = { error in recoverAfterVerification(error) }
callbacks.onClosed = { _ in recoverAfterVerification(nil) }
deunaSDK.initNextAction(
orderToken: orderToken,
callbacks: callbacks,
language: "en"
)val callbacks = NextActionCallbacks().apply {
onSuccess = { verifyOriginalOrder() }
onError = { error -> recoverAfterVerification(error) }
onClosed = { recoverAfterVerification(null) }
}
deunaSDK.initNextAction(
context = this,
orderToken = orderToken,
callbacks = callbacks,
language = "en"
)Parameters#
| Parameter | Platforms | Required | Purpose |
|---|---|---|---|
orderToken | All | Yes | Original token for the order awaiting customer action. |
callbacks | All | Yes | Success, error, close, event, and resize handlers supported by the base callback contract. |
language | All | No | Localizes the hosted experience. |
mode | React Native | Yes | Chooses modal or supported embedded presentation. |
fraudCredentials | Native + React Native | No | Only for a configured device-data integration. |
customUserAgent | iOS + Android | No | Approved WebView user-agent override. |
domain | All | No | Controlled environment override; omit in normal production use. |
Handle every outcome#
| Outcome | What it means | Correct action |
|---|---|---|
onSuccess | The customer-facing step completed. | Retrieve the original order and render from its current state. |
onError | The SDK or challenge reported a normalized error. | Log safe metadata, retrieve state, then offer an eligible retry. |
onClosed | The customer or SDK closed the experience. | Treat as ambiguous until the backend state is known. |
| Timeout or app interruption | No reliable client outcome reached your handler. | Reconcile from the backend; do not automatically submit again. |
Redirect and popup requirements#
- Allow the SDK to open its supported external authentication surface.
- Preserve app lifecycle state while the customer leaves and returns.
- On Web, open from a customer gesture and do not sandbox the widget in a way that blocks popups or top-level navigation.
- On React Native, keep the SDK renderer mounted while its external redirect controller is active.
- On iOS and Android, use the maintained SDK modal or embedded component instead of recreating the internal WebView bridge.
- Test successful challenge, rejection, customer cancellation, issuer timeout, network loss, and returning from the background.
Embedded presentation#
The Web SDK supports mode: 'target' plus target; iOS and Android expose embedded widget components; React Native uses its DeunaWidget renderer. Reserve enough initial height, respond to size changes, and ensure the host does not hide challenge controls behind a sticky footer or on-screen keyboard.
3DS iframe loading fallback#
When DEUNA presents a 3DS challenge inside an iframe, Next Action monitors the loading state of the issuer view.
- If the iframe loads successfully within the first 5 seconds, the flow continues normally and no additional recovery actions are displayed.
- If the view does not finish loading after 5 seconds, the Did the view fail to load? option appears.
When expanded, the shopper can:
- Reload view: retries loading the 3DS challenge.
- Change payment method: allows the shopper to leave the current challenge and select another payment method, after confirming the action.
If the iframe finishes loading while the fallback is visible, the recovery options are automatically hidden and the shopper can continue with the challenge.
Integration behavior
| Action | Behavior | Callback / event |
|---|---|---|
| Payment goes to 3DS view | 3DS embedded view is displayed, or user is redirected to another tab. | paymentMethods3dsInitiated event. |
| Iframe loads | The 3DS challenge continues normally | No additional merchant action is required |
| Change payment method | The current experience is abandoned after confirmation | apmCancelPayment event. |
| Challenge completed | The normal Next Action flow continues | onSuccess callback / purchase event / corresponding result |
| Challenge denied / expired | Challenge denied in the redirect, flow finishes here. | purchaseError event / onError callback |
The merchant should continue using the Next Action callbacks and the authoritative order status to determine the final payment outcome.