1. Checkout Module
Salla Platform Docs
  • Embedded SDK
    • Overview
    • Getting Started
    • Create an Embedded App
    • Authentication
    • App Design Guidelines
    • Installation
    • Playground
  • Auth Module
    • Get Token
    • Client Introspect
    • Refresh Token
  • Page Module
    • External Redirects
    • Navigation
    • Set Page Title
  • Nav Module
    • Create Navbar Action
    • Listen for Navbar Actions
    • Clearing Navbar Actions
    • Add Navbar Item
    • Update Navbar Item
    • Listen for Navbar Item Click
    • Remove Navbar Item
  • UI Module
    • Confirm Dialogs
    • Toast Notifications
    • Loading States
    • Breadcrumbs
  • Checkout Module
    • Create Checkout
    • Get App Add-ons
    • Subscribe for Payment Result
  • Endpoints
    • Token Introspect
      POST
  • Resources
    • Support
    • Common Examples
  • Report Builder
    • Overview
    • Getting Started
    • JMESPath Tutorial
    • Understanding the Report Lifecycle
    • Salla Reports Examples
    • Set up Store data using merchant APIs
    • Report Types
      • Unit
      • Bar
      • Breakdown
      • Calendar
      • Distribution
      • Pipe
      • Plot
      • Ranking
      • Summary
      • Agrid
    • APIs
      • Token Introspect
  • App Onboarding
    • Overview
    • Get Started
    • Interfaces and Responses
    • Example
Merchant
Merchant
  • Merchant API
  • Embedded SDK
  • Salla OAuth 2.0
Storefront
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Ecommerce Events
  • Component Bundle
  • Checkout APIs
  • Change Log
App Functions
Partner APIs
Partner APIs
  • App API
  • Shipments & Fulfillment APIs
  • Salla AWB
  • Recurring Payments API
  • Billing System Salla partners
  • Communication Apps
Dev Tools
Dev Tools
  • Partners Agent Kit
  • Salla Apps Playbook
  • Salla CLI
Merchant
Merchant
  • Merchant API
  • Embedded SDK
  • Salla OAuth 2.0
Storefront
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Ecommerce Events
  • Component Bundle
  • Checkout APIs
  • Change Log
App Functions
Partner APIs
Partner APIs
  • App API
  • Shipments & Fulfillment APIs
  • Salla AWB
  • Recurring Payments API
  • Billing System Salla partners
  • Communication Apps
Dev Tools
Dev Tools
  • Partners Agent Kit
  • Salla Apps Playbook
  • Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Checkout Module

Subscribe for Payment Result

The onResult method registers a callback that is invoked whenever a checkout flow completes, whether the payment succeeded, failed, or was cancelled. This includes results that arrive after a 3DS redirect.

Usage#

API Reference#

embedded.checkout.onResult(callback)#

ParameterTypeRequiredDescription
callback(result: CheckoutResult) => voidYesCalled when a checkout completes.

Return Value#

TypeDescription
functionAn unsubscribe function to remove the listener.

CheckoutResult#

PropertyTypeDescription
successbooleantrue if the payment was completed successfully.
order_idstring | undefinedThe order ID, present on successful payment.
statusstringPayment status: "paid", "pending", "failed", "cancelled", or "success".
errorobject | undefinedError details with code and message properties.
contextunknown | undefinedThe context object passed to create(), restored after 3DS redirect.

3DS Redirect Recovery#

When a payment requires 3DS verification, the merchant is redirected away from the dashboard and back. The SDK handles this automatically:
1.
Before redirect, the host stores the pending checkout state (including your context).
2.
After redirect, the iframe reloads and the SDK delivers the stored result to your onResult callback.
3.
The context you passed to create() is preserved and returned in the result.
💡
Best Practices
Register Early: Set up onResult during your app's initialization, before any create() calls, to catch results from 3DS redirects that occurred in a previous session.
Clean Up: Call the unsubscribe function when your component unmounts to prevent memory leaks.
Handle All States: Always handle both success: true and success: false cases to provide clear feedback to the merchant.
Modified at 2026-07-09 11:27:26
Previous
Get App Add-ons
Next
Token Introspect