FILTER BY TAG

Process a Sale

This section describes how to send a sale request to process a payment.
A sale request authorizes and captures a payment in the same request. A successful sale response includes an Touch 'n Go redirect URL and a
PENDING
status. Redirect the customer to the Touch 'n Go URL to allow the customer to complete the checkout using their Touch 'n Go account. When the customer completes the checkout, the customer is redirected to your website.
When you receive a successful response, save the sale request ID in the
requestID
response field to perform a follow-on check status request or refund request.

Calculating the Grand Total

Include the grand total in the request by using the
purchaseTotals_grandTotalAmount
field.
For information about how to calculate the grand total, see Calculating the Grand Total for Line Items.

Endpoints

Set the
apSaleService_run
field to
true
, and send the request to one of these endpoints:
Production:
https://ics2ws.ic3.com/commerce/1.x/transactionProcessor
Test:
https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor

Testing Information

Touch 'n Go does not support a test endpoint. Send all test transactions to the production endpoint.

Processing a Sale

Follow these steps to successfully process sale.
  1. Send a
    POST
    request to the
    https://ics2ws.ic3.com/commerce/1.x/transactionProcessor
    endpoint and include these required fields:
    Set to
    TND
    .
    Set to the URL to which the customer is redirected after the payment is cancelled.
    Add
    ?action=cancel
    to the end of the URL to help identify the response.
    Set to the URL to which the customer is redirected after the payment fails to complete.
    Add
    ?action=failure
    to the end of the URL to help identify the response.
    Set to the URL to which the customer is redirected after successfully completing the payment.
    Add
    ?action=success
    to the end of the URL to help identify the response.
    Set to
    true
    .
    Set to
    MY
    .
    Set to
    MYR
    .
  2. You can include these optional fields in the request:
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
    If this field is present, the
    purchaseTotals_currency
    field is optional.
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
  3. Redirect the customer to the returned URL in the
    merchantURL
    response field.
    <merchantURL></merchantURL>
  4. When the customer completes the checkout using their Touch 'n Go credentials, the customer is redirected to the merchant website based on the URL that you included in the
    apSaleService_successURL
    request field.
  5. Save the request ID in the
    requestID
    field from the sale response. Include the request ID in a check status request to confirm that the payment is complete.
    <requestID></requestID>

Example: Processing a Sale

Request
<requestMessage xmlns="urn:schemas-cybersource-com:transaction-data-1.211"> <merchantID>altpay_mid2</merchantID> <merchantReferenceCode>Sale</merchantReferenceCode> <billTo> <firstName>Test</firstName> <lastName>Testerson</lastName> <country>MY</country> <email>test@email.com</email> </billTo> <purchaseTotals> <currency>MYR</currency> <grandTotalAmount>1.00</grandTotalAmount> </purchaseTotals> <apPaymentType>TND</apPaymentType> <apSaleService run="true"> <cancelURL>https://www.testcancel.com?action=cancel</cancelURL> <successURL>https://www.testsuccess.com?action=success</successURL> <failureURL>https://www.testfailure.com?action=failure</failureURL> </apSaleService> </requestMessage>
Response to a Successful Request
<replyMessage xmlns="urn:schemas-cybersource-com:transaction-data-1.211"> <merchantReferenceCode>Sale</merchantReferenceCode> <requestID>7533018272376391304066</requestID> <decision>ACCEPT</decision> <reasonCode>100</reasonCode> <requestToken>AxjnrwSTmF2hDxXBlYOCANgZYiy606GxmSmcyOn+bmZ6xrlB8iipDJpJl6MYhzEaTmF2hDxXBlYOCAAAHAMM</requestToken> <purchaseTotals> <currency>MYR</currency> </purchaseTotals> <apSaleReply> <reasonCode>100</reasonCode> <paymentStatus>pending</paymentStatus> <responseCode>00001</responseCode> <merchantURL>https://payment.limonetik.com/Razer/Order/PayPage/641145429770</merchantURL> <processorTransactionID>641145429770</processorTransactionID> <reconciliationID>XEKVNC1LJ3LG</reconciliationID> <amount>1.00</amount> <processorResponse>00001</processorResponse> <dateTime>2025-07-23T20:17:08Z</dateTime> </apSaleReply> </replyMessage>

Response Statuses for Processing a Sale

Cybersource
responds to your sale request with one of these statuses in the
field:
  • FAILED
    : The sale cannot be completed.
  • PENDING
    : The sale request is accepted but is not completed. Send a check status request as often as necessary to obtain the information that you need. For more information, see Check a Status.