Payment Status Updates

Monitor and verify payment status to respond to successful and failed payments.

Payment status changes as customers complete actions in your checkout flow. Your integration can inspect the payment status to determine results and take appropriate business actions.

Payment results must be determined by webhook notifications. Do not rely solely on the status field in synchronous responses.

Choose a verification method

MethodBest forReliability
Client callbackShowing immediate feedback to usersLow—don't use for order fulfillment
API responseDirect API integrationsMedium—depends on client-side polling
Return URLRedirect-based flowsMedium—requires polling
WebhooksOrder fulfillment and backend processingHigh—recommended

Check payment status on the client

When using the onPaymentCompleted callback, the returned status indicates the payment result. Use this status only to display results to users—don't update your order system based on client-side status alone.

onPaymentCompleted: function (result) {
  const { respCode, respMsg, data: txnInfo } = result

  if (respCode === '20000') {
    switch (txnInfo.status) {
      case 'S':
        // Show success message to user
        // Query Order API for final confirmation before fulfillment
        break
      case 'R':
        // 3DS verification required
        window.location.href = txnInfo.redirectUrl
        break
      default:
        // Handle unexpected status
        break
    }
  } else {
    // Show error: respMsg contains the failure reason
    console.error('Payment failed:', respMsg)
  }
}

Possible callback outcomes

StatusWhat happenedExpected integration
SPayment succeededQuery the Order Query APIPayments API for final status. If confirmed, update your order and notify the customer.
FPayment failedQuery the Order Query APIPayments API for final status. Create a new payment to allow retry.
R3DS (3-D Secure) authentication requiredRedirect the customer to the 3DS challenge page using txnInfo.redirectUrl.

Check status without using callbacks

If you don't use onPaymentCompleted, you have two options to check payment status.

Use API response

When calling the Direct APIPayments API, the response includes the payment status. Use this to update your order or execute subsequent business logic.

StatusWhat happenedExpected integration
SPayment succeededNotify the customer and update your order. This is a final status.
FPayment failedNotify the customer and update your order. Create a new payment to allow retry. This is a final status.
RRedirect requiredRedirect the customer to the provided URL—either a 3DS (3-D Secure) challenge page or a local payment method page.
PPayment processingNotify the customer that payment is processing. Poll the Order Query APIPayments API until you receive a final status.

Use return URL

Include the returnUrl parameter with your order reference when calling the API. After payment completes, Onerway redirects to this URL with your order reference. Use the reference to poll the Order Query APIPayments API for final status.

Learn more about configuring return URLs.

Monitor payment status with webhooks

Onerway sends webhook events to your server when a payment reaches a final status. Use webhooks for order fulfillment—don't rely on client-side processing because customers can leave the page before fulfillment initiates.

To receive webhooks, include the notifyUrl parameter when creating a payment request.

We recommend combining webhooks with server-side polling: webhooks for real-time updates, polling as a fallback to catch any missed notifications. Avoid client-side polling—users closing the page interrupts the process.

Handle webhook events

Onerway sends a POST request to your notifyUrl with a JSON payload:

{
  "notifyType": "TXN",
  "transactionId": "1920061365985615872",
  "txnType": "SALE",
  "merchantNo": "800209",
  "merchantTxnId": "6a28ac11-d98c-4323-84a7-426b9322c4f7",
  "responseTime": "2025-05-07 18:21:21",
  "txnTime": "2025-05-07 18:21:17",
  "txnTimeZone": "+08:00",
  "orderAmount": "100.00",
  "orderCurrency": "USD",
  "status": "S",
  "cardBinCountry": "US",
  "reason": "{\"respCode\":\"20000\",\"respMsg\":\"Success\"}",
  "sign": "345f09b2240dcd2084605c28024b4d6fe7da4f84e59a7268b92bb66a36c433b3",
  "paymentMethod": "VISA"
}
StatusWhat happenedExpected integration
SPayment succeededNotify the customer and update your order.
FPayment failedNotify the customer. Create a new payment to allow retry.

Respond to webhooks

After processing the webhook, return only the transactionId value in your response body. This confirms successful receipt to Onerway.

Onerway retries failed webhooks up to 2 times at 30-minute intervals. Ensure your endpoint is idempotent—use transactionId for deduplication.

For complete webhook parameters and examples, see the Transaction Webhooks API referencePayments API.

Verify webhook signatures

When processing webhooks, verify the signature to ensure the request came from Onerway.

The following parameters are excluded from signature verification: originTransactionId, originMerchantTxnId, customsDeclarationAmount, customsDeclarationCurrency, paymentMethod, walletTypeName, periodValue, tokenExpireTime, sign. All other parameters—including any new parameters added in the future—are included.

Learn more about handling webhook signaturesPayments API.

Handle delayed payment methods

Some payment methods—like and —can't return results immediately. For these methods:

  1. The API response returns status: R
  2. You redirect the user to the payment method's page
  3. The customer completes payment (may take several days)
  4. Onerway sends a webhook when the final status is available
For delayed payment methods, webhooks are required. Polling the Order Query APIPayments API before payment completes will return status: P (Pending).