Skip to main content
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#

Flow diagram
NoYesSuccessError or close1Create or submitpayment2Next actionreturned?3Handle current orderstate4Open Next Actionwith same ordertoken5Widget outcome6Reconcile order onbackend7Retrieve statebefore retry8Fulfill only fromverified final state
Result or outcomeReview or pending
01 · response
Detect required action
Use the payment response or documented order state.
02 · SDK
Open Next Action
Pass the original order_token; do not create another order.
03 · customer
Continue authentication
Let browser checks finish and present an issuer challenge only when required. Preserve redirects, popups, and app return behavior.
04 · backend
Verify the result
Retrieve the order or consume a verified webhook.

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:

Next Action presents the required customer step after payment initiation. Watch the video directly on YouTube if the embedded player is unavailable.

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(),
  },
});

Parameters#

ParameterPlatformsRequiredPurpose
orderTokenAllYesOriginal token for the order awaiting customer action.
callbacksAllYesSuccess, error, close, event, and resize handlers supported by the base callback contract.
languageAllNoLocalizes the hosted experience.
modeReact NativeYesChooses modal or supported embedded presentation.
fraudCredentialsNative + React NativeNoOnly for a configured device-data integration.
customUserAgentiOS + AndroidNoApproved WebView user-agent override.
domainAllNoControlled environment override; omit in normal production use.

Handle every outcome#

OutcomeWhat it meansCorrect action
onSuccessThe customer-facing step completed.Retrieve the original order and render from its current state.
onErrorThe SDK or challenge reported a normalized error.Log safe metadata, retrieve state, then offer an eligible retry.
onClosedThe customer or SDK closed the experience.Treat as ambiguous until the backend state is known.
Timeout or app interruptionNo 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

ActionBehaviorCallback / event
Payment goes to 3DS view3DS embedded view is displayed, or user is redirected to another tab.paymentMethods3dsInitiated event.
Iframe loadsThe 3DS challenge continues normallyNo additional merchant action is required
Change payment methodThe current experience is abandoned after confirmationapmCancelPayment event.
Challenge completedThe normal Next Action flow continuesonSuccess callback / purchase event / corresponding result
Challenge denied / expiredChallenge 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.