This page explains how to integrate Onerway Web SDK in the order merchants typically implement it. Unlike Hosted Checkout, the SDK flow requires the merchant to handle frontend mounting, backend transaction creation, callback URL configuration, webhook verification, and end-to-end testing together.
The integration includes the following stages:
transactionId plus redirectUrlBefore starting the integration, confirm the following preparation is complete:
merchantNoreturnUrl and notifyUrl, and make sure your backend can receive notificationsSDK integration starts with transaction creation on the merchant backend. For a basic payment flow, the minimal request usually includes the following fields:
| Field | Description |
|---|---|
merchantNo | Merchant number |
merchantTxnId | Merchant-side globally unique order number for order correlation and troubleshooting |
orderAmount | Transaction amount |
orderCurrency | Transaction currency |
txnType | Transaction type; SALE is common for a basic payment flow, while other scenarios follow their own capability guides |
txnOrderMsg | Business payload container that usually includes appId, returnUrl, notifyUrl, and related context |
A basic request example:
{
"merchantNo": "800209",
"merchantTxnId": "e868e769-afe5-41f7-9882-04835122e0b3",
"orderAmount": "100.00",
"orderCurrency": "USD",
"txnType": "SALE",
"txnOrderMsg": "{\"appId\":\"YOUR_APP_ID\",\"returnUrl\":\"https://your-domain.com/checkout/result?merchantTxnId=YOUR_TXN_ID\",\"notifyUrl\":\"https://your-domain.com/webhook\"}"
}
Tokenization, subscription billing, and authorization use different request parameters and include additional required fields from the corresponding capability documents.
After the merchant backend successfully calls the Onerway API, it returns the payment session to the frontend. In SDK integration, the following two values are used for frontend initialization and transaction correlation:
| Field | Source | Purpose |
|---|---|---|
transactionId | Create transaction response | Unique identifier for SDK initialization, notification correlation, and idempotency troubleshooting |
redirectUrl | Create transaction response or SDK callback | Used for SDK initialization and, when needed, continuing the 3D Secure / SCA flow |
The frontend usually needs only the current session parameters. Signing secrets and other sensitive configuration stay on the backend.
The frontend mounting order is:
transactionId and redirectUrl returned by the backendAt this stage, the merchant frontend owns the customer experience layer, while the SDK owns payment data collection, encryption, and payment-specific flows.
After the customer enters payment details into the SDK-rendered fields, the SDK handles submission and triggers authentication when required.
The payment submission flow is:
transactionId and redirectUrlreturnUrlSDK synchronous callbacks are for frontend status display. They are not the business success signal for settlement, accounting, or fulfillment.
returnUrl and notifyUrlBoth returnUrl and notifyUrl should be included in the transaction request, but they serve different purposes:
| Field | Purpose |
|---|---|
returnUrl | The landing page URL the customer returns to after payment or authentication; used for result display, order lookup, or next-step guidance |
notifyUrl | The server-to-server notification endpoint Onerway uses to push the final transaction result to the merchant backend |
returnUrl is used for page navigation and customer display. It is not the final transaction source of truth. Final transaction status comes from verified webhooks, or from a verified order query when used as a recovery mechanism.
returnUrl may include merchantTxnId or a similar business identifier for order lookup and status display on the landing page.
Webhook handling is a backend responsibility in SDK integration. At minimum, the merchant backend processes the following:
transactionId or a merchant-defined idempotency key to prevent duplicate fulfillmenttransactionId as required by the interfaceA common processing order is: signature verification -> idempotency check -> business handling -> return transactionId.
If the scenario generates multiple notification types, such as BIND_CARD plus SALE in a tokenization flow, out-of-order arrival and coexistence of multiple event types can occur under the same transaction.
Integration testing includes local webhook testing and full payment flow testing.
The local webhook testing steps are:
localhost:3000ngrok http 3000notifyUrlThe full payment flow testing steps are:
transactionId and redirectUrlreturnUrlAfter the payment test completes, validate the following:
If the returnUrl landing page performs an order query, confirm that the customer-facing status remains consistent with the backend final order state.
Before production rollout, confirm the following:
notifyUrl points to a production-accessible endpointreturnUrl points to the production result pagemerchantTxnId or an equivalent business identifierRelated documentation:
tokenId with SDK