FILTER BY TAG

Process a Sale

Send a sale request to authorize and capture a payment in the same request. A successful sale response includes a redirect URL and a pending status. Redirect the customer to the URL to allow the customer to complete the checkout using GrabPay. When the customer completes the checkout, the customer is redirected to the merchant website using the success-URL provided in the sale request.

Line Items

Line items can be included in a sale request. Line items correspond to the
item_#_
fields, starting with
item_0_
and increasing in numerical order.
For more information about how to properly format line items in your request, see Using Line Items.

Tax Amounts

You can include the tax amount for every type of purchased product in the
item_#_taxAmount
field when you request the sale service.

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

Response Statuses

Cybersource
responds to your sale request with one of these statuses in the
apSaleReply_status
field:
Sale Status
  • FAILED
    : The sale cannot be completed.
  • PENDING
    : The sale request is accepted but is not completed. Request the check status service every 60 minutes to retrieve status updates. See Check a Request Status.
The sale service also responds with a reason code in the
apSaleReply_reasonCode
field.
For more information about reason codes, see Reason Codes and Response Codes.
When you send a check status request to retrieve an updated sale status, these are the possible responses:
Check Status for a Sale
  • ABANDONED
    : The customer did not complete the payment using the redirect URL.
  • FAILED
    : The sale cannot be completed.
  • FUNDED
    : The settled amount is funded to the merchant bank account.
  • PENDING
    : The sale request is accepted but is not complete. Continue sending the check status request every 60 minutes.
  • SETTLED
    : The sale request is settled for the requested amount. You cannot receive a settled status until the customer has completed checking out.

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
    GRP
    .
    Set to the URL to which the customer is redirected after successfully completing the GrabPay payment.
    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 successfully completing the GrabPay payment.
    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 GrabPay payment.
    Add
    ?action=success
    to the end of the URL to help identify the response.
    Set to
    true
    .
    Set to
    SG
    .
    Set to
    SGD
    .
  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>
    https://payment.limonetikqualif.com/GrabPay/Order/PayPage/828490821359
    </merchantURL>
  4. When the customer completes the checkout using their GrabPay credentials, the customer is redirected to the merchant website based on the URL that you included in the
    apSaleService_successURL
    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>
    6989535327666834103007
    </requestID>

Example: Processing a Sale

Request
<requestMessage xmlns="urn:schemas-cybersource-com:transaction-data-1.215"> <merchantID>test_merchant</merchantID> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <billTo> <country>ID</country> </billTo> <purchaseTotals> <currency>SGD</currency> <grandTotalAmount>220.00</grandTotalAmount> </purchaseTotals> <apPaymentType>GRP</apPaymentType> <apSaleService run="true"> <cancelURL>https://www.test.com?action=cancel</cancelURL> <successURL>https://www.test.com?action=success</successURL> <failureURL>https://www.test.com?action=failure</failureURL> </apSaleService> </requestMessage>
Response to a Successful Request
<requestMessage xmlns="urn:schemas-cybersource-com:transaction-data-1.215"> <merchantID>test-merchant</merchantID> <merchantReferenceCode>GrabPay-Sale</merchantReferenceCode> <purchaseTotals> <currency>SGD</currency> <grandTotalAmount>1.00</grandTotalAmount> </purchaseTotals> <apPaymentType>GRP</apPaymentType> <apSaleService run="true"> <cancelURL>https://www.yahoo.com?action=cancel</cancelURL> <successURL>https://www.google.com?action=success</successURL> <failureURL>https://www.cnn.com?action=failure</failureURL> </apSaleService> </requestMessage>