# Touch ’n Go eWallet

> Accept one-time Touch ’n Go eWallet payments through Checkout or the Web SDK with customer details supplied in advance, and confirm the wallet-payment result on your server.

## Basic information

Customers authorize payment through the wallet page or app.

- Integration paths: [Checkout](/payments/online-payments/checkout), [Web SDK](/payments/online-payments/sdk), [Direct API](/payments/online-payments/api) (only after Onerway confirms availability)
- Transaction types: One-time payment, [self-managed subscription](#subscriptions) (Direct API)
- `lpmsInfo.lpmsType`: `TOUCH_GO_EWALLET`
- Web SDK `config.paymentMethod`: `['TOUCH_GO_EWALLET']`

| Customer country/region | Order currency |
| --- | --- |
| 🇲🇾 MY | MYR |

The customer country/region is the `billingInformation.country` value in the payment request.

This guide covers enabled Touch ’n Go eWallet configurations. It applies when you supply the customer’s billing name, email, country, and any other details required for your enabled configuration before starting the payment, as described in [Before you begin](#before-you-begin). Confirm the enabled scope for your merchant account and application with Onerway before using another market or order currency, then check the current order with [List available payment methods](/payments/api-reference/endpoints/list-available-payment-methods).

## Before you begin

Complete [Setup](/payments/get-started/setup) and confirm that Touch ’n Go eWallet is enabled. Confirm applicable limits, payment validity periods, settlement arrangements, and any customer identity requirements. For amount formatting, see [Currency and amount validation](/payments/get-started/currency-and-amount).

Collect the customer’s billing name, email, and actual country. Supply them in `billingInformation` when creating the payment. If your enabled configuration requires an identity number, collect it in the agreed format and supply `identityNumber` as a string; do not assume it is required for every configuration. Follow the API conditions for shipping information. Configure your notification and return URLs, and store the mapping between your order and `paymentId`.

## Start the payment

### Direct API

Use this path only after Onerway has explicitly confirmed Direct API availability for your merchant application. Method enablement or availability in Checkout does not establish Direct API availability. Until this is confirmed, use Checkout or the Web SDK as described below.

1. Check [List available payment methods](/payments/api-reference/endpoints/list-available-payment-methods) for the current order. After the customer selects this method, call [Create direct transaction](/payments/api-reference/endpoints/direct-create-transaction) from your server with `productType=LPMS`, `subProductType=DIRECT`, `txnType=SALE`, and `paymentMode=WEB`. Set `lpmsType=TOUCH_GO_EWALLET` in [`lpmsInfo`](/payments/api-reference/endpoints/direct-create-transaction#request-lpmsInfo), encoded as a JSON string.
2. Supply the collected `firstName`, `lastName`, `email`, and actual `country` in [`billingInformation`](/payments/api-reference/endpoints/direct-create-transaction#request-billingInformation). Add `identityNumber` as a string only when required by your enabled configuration, using the agreed document type and format. Both billing and shipping objects must include their required email and country and meet the other API field conditions. Encode both objects as JSON strings. Include products, notification and return URLs, and merchant-collected end-user IP, browser, and device information in [`txnOrderMsg`](/payments/api-reference/endpoints/direct-create-transaction#request-txnOrderMsg). Keep product and order currencies consistent, with product amounts, discounts, and shipping fees adding up to `orderAmount`.<br />Select the request example “Redirect local payment request (illustrative)”. It uses Bancontact / BE / EUR to show the shared structure. Replace the method with `TOUCH_GO_EWALLET`, use MYR for this flow, and supply the actual order and customer details. The example amount does not establish a transaction limit.
3. Store the returned `paymentId` and `transactionId`. When `status=R` and `actionType=RedirectURL`, direct the customer to `redirectUrl`. The response example “Redirect local payment response (illustrative)” shows this shape. For other actions or states, follow [Local payment integration](/payments/online-payments/payment-methods/local-payment-methods#handle-the-customer-action). Do not repeatedly create the same order while waiting.
4. The returned `redirectUrl` may open a provider payment page or the wallet. The customer follows the instructions for that attempt. When the customer returns to your site, display the result retrieved from your server. See [Request signing](/payments/get-started/request-signing) for authentication.

### Checkout

When locking Checkout to this method, first call [List available payment methods](/payments/api-reference/endpoints/list-available-payment-methods) for the current order and confirm that the method is returned. When Checkout displays all available methods, Onerway performs this filtering.

1. On your server, call [Create checkout payment](/payments/api-reference/endpoints/create-checkout-payment) with `productType=ALL`, `subProductType=DIRECT`, and `txnType=SALE`. To show only Touch ’n Go eWallet, set [`lpmsInfo.lpmsType`](/payments/api-reference/endpoints/create-checkout-payment#request-lpmsInfo) to `TOUCH_GO_EWALLET`, sending `lpmsInfo` as a JSON string. If you omit `lpmsInfo`, the customer chooses from the methods available for the order.
2. Supply the billing, shipping, product, return URL, and notification URL fields required by the API. Encode `billingInformation` and `shippingInformation` as JSON strings, including the required email and country for each. Keep product and order currencies consistent and ensure that product amounts, discount entries, and shipping fees add up to `orderAmount`.<br />Select the request example “Unified Checkout with all available payment methods”, replace the order and customer details, and add this method's `lpmsInfo` if you want to select only this method. Use MYR for this flow and remove the example’s `cardInfo` object.
For this flow, include the collected `firstName`, `lastName`, `email`, and `country` in [`billingInformation`](/payments/api-reference/endpoints/create-checkout-payment#request-billingInformation). Apply the API field conditions, and add `identityNumber` when required by your enabled configuration.
3. Select the response example “Unified Checkout session created”. Store the returned `paymentId` and `transactionId` against your order, then redirect the customer's browser to `redirectUrl`. The initial `status=U` means that payment has not been completed.
4. Onerway Checkout handles the payment page and customer payment interaction. When the customer reaches `returnUrl`, retrieve the order result from your server. If no notification has arrived, use the stored transaction identifier to [Query transactions](/payments/api-reference/endpoints/query-transactions). For signing, redirects, and return handling, see [Checkout integration](/payments/online-payments/checkout).

### Web SDK

Keep the SDK payment-method interface and provide the customer details for this flow when creating the transaction. Submit the collected `firstName`, `lastName`, `email`, and `country` in [`billingInformation`](/payments/api-reference/endpoints/sdk-create-transaction#request-billingInformation), encoded as a JSON string. Follow the API conditions for other fields and add `identityNumber` when required by your enabled configuration. The linked “One-time SDK payment” example omits these billing details; add them when implementing this flow.

1. On your server, call [Create SDK transaction](/payments/api-reference/endpoints/sdk-create-transaction) with `productType=ALL`, `subProductType=DIRECT`, and `txnType=SALE`. Select the request example “One-time SDK payment” and the response example “One-time SDK transaction created”. These examples show the shared creation flow before a payment method is selected. Replace the amount, currency, and product details with the actual order, keeping the product and order currencies consistent.
2. Initialize Checkout with the returned `paymentId`, following [Web SDK integration](/payments/online-payments/sdk). To display only this method, set `config.paymentMethod` to `['TOUCH_GO_EWALLET']` in the initialization options. Then subscribe to events and mount the Payment Element. This configuration only filters methods returned by the server; it does not enable Touch ’n Go eWallet.
3. In the `ready` event, check that `availablePaymentMethods` contains `TOUCH_GO_EWALLET`.
4. After the customer selects Touch ’n Go eWallet and completes any fields shown, call `confirmPayment()` from your payment button. Handle the actual `paymentStatus` and `nextAction` returned. For the complete event and error handling flow, see [Web SDK integration](/payments/online-payments/sdk).

With the Web SDK, `paymentStatus=R` means that customer interaction must continue. Handle the actual `nextAction.type` returned:

- `PresentToShopper`: keep the current SDK Checkout instance and leave its Payment Element mounted while the SDK presents the payment interface, wait for `payment_result`, and do not call `confirmPayment()` again.
- `RedirectShopper`: wait for the customer to reach the `returnUrl` supplied when creating the order, then query the order on your server. Initially show that the result is being confirmed.

## Customer actions and final result

Customers follow the current wallet page or app to sign in, or use the TNG eWallet app to scan a displayed QR code, check the amount, and confirm payment. The page and device determine which actions are available; signing in and scanning are not necessarily steps in the same purchase. Your application does not collect wallet passwords, PINs, or verification codes.

Customers may leave before completing payment. A displayed QR code, successful wallet verification, or return to your site does not confirm payment. Retrieve the order result from your server before updating its payment status.

Process the order on your server using a signature-verified [payment result webhook](/payments/api-reference/webhooks/payment-result). If the notification has not arrived or you need to check the result, call [Query payments](/payments/api-reference/endpoints/query-payments) with the stored `paymentId`. Fulfill the order only after your server confirms a successful payment. For verification, acknowledgement, idempotency, and query fallback, see [Webhooks](/payments/get-started/webhooks).

## Subscriptions

For self-managed subscriptions through the Direct API, call [List available payment methods](/payments/api-reference/endpoints/list-available-payment-methods) with `subProductType=SUBSCRIBE` and the actual order and client parameters. Continue only if the response includes `TOUCH_GO_EWALLET`.

Follow [Local payment method subscriptions](/payments/online-payments/payment-methods/local-payment-methods#local-payment-method-subscriptions) for subscription authorization, contract credentials, and merchant-initiated charges. The one-time payment steps above use `subProductType=DIRECT`; subscription requests use `subProductType=SUBSCRIBE` and `subscription.selfExecute=2`.

## Refunds and disputes

Before integration, confirm the refund capabilities, restrictions, and dispute process applicable to your merchant with Onerway. If refunds are enabled, follow [Refunds](/payments/online-payments/scenarios/refunds).

## Testing and go-live

Confirm the test environment, available Touch ’n Go eWallet test procedure, and customer test data with Onerway, then follow [Sandbox testing](/payments/get-started/testing):

1. Create an order using an enabled country, MYR, and your test amount, supplying the customer billing details for this flow. For the Direct API, handle the actual response and verify that `R + RedirectURL` opens the returned address. For Checkout, confirm that it opens `redirectUrl` and displays `TOUCH_GO_EWALLET`. When using the Web SDK, check that `ready.availablePaymentMethods` contains `TOUCH_GO_EWALLET`.
2. On the current Touch ’n Go eWallet payment page or in the wallet, check the amount and instructions, and complete the agreed wallet-payment test. Confirm the result on your server before updating the order; merely opening the payment page does not pass the successful-payment check. For go-live acceptance, retain the notification and acknowledgement for the same order, then query the payment status and check that it matches the notification.
3. Test a customer leaving before authorization, an unsuccessful authentication or payment, and a return to your site before a final result. If the page displays a deadline, also test the agreed expiry handling. Confirm that a return to your site alone never marks the order as paid, and test query fallback when no notification has arrived.
4. Verify idempotent handling of duplicate notifications. Before going live, check production enablement, notification and return URLs, limits, and validity periods. Test refunds separately if they are enabled.
