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 ShopeePay. 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.

Response Statuses

Cybersource
responds to your sale request with one of these statuses in the
apSaleReply_status
field:
Sale 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.
You must include all of the listed required fields in your sale request to guarantee the redirect URL will display properly to the customer.
  1. Send a
    POST
    request to the
    https://ics2ws.ic3.com/commerce/1.x/transactionProcessor
    endpoint and include these required fields:
    Set to
    SHP
    .
    Set to the URL to which the customer is redirected after successfully completing the ShopeePay 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 ShopeePay 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 ShopeePay payment.
    Add
    ?action=success
    to the end of the URL to help identify the response.
    Set to
    true
    .
    Set to one of these possible values:
    • IDR
      : Indonesian rupiah
    • MYR
      : Malaysian ringgit
    • PHP
      : Philippine peso
  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/Razer/Order/PayPage/782373220980
    </merchantURL>
  4. When the customer completes the checkout using their ShopeePay 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>ShopeePay-Sale</merchantReferenceCode> <billTo> <lastName>Tester</lastName> <country>ID</country> <phoneNumber>+33785495587</phoneNumber> <email>john.doe@thunes.com</email> </billTo> <purchaseTotals> <currency>IDR</currency> <grandTotalAmount>5.00</grandTotalAmount> </purchaseTotals> <apPaymentType>SHP</apPaymentType> <apSaleService run="true"> <cancelURL>https://www.google.com?action=cancel</cancelURL> <successURL>https://www.google.com?action=success</successURL> <failureURL>https://www.google.com?action=failure</failureURL> </apSaleService> </requestMessage>
Response to a Successful Request
<replyMessage xmlns:c="urn:schemas-cybersource-com:transaction-data-1.215"> <merchantReferenceCode>ShopeePay-Sale</merchantReferenceCode> <requestID>6953229557336619903008</requestID> <decision>ACCEPT</decision> <reasonCode>100</reasonCode> <requestToken>AxjnrwSTiKtC14abfyOqANgZYjWmrVgwstJ0+cnvxCztDrlCfohFwyaSZejFfqtQk4irQteGm38jqgAAyxyD</requestToken> <purchaseTotals> <currency>MYR</currency> </purchaseTotals> <apSaleReply> <reasonCode>100</reasonCode> <paymentStatus>pending</paymentStatus> <responseCode>00001</responseCode> <merchantURL>https://payment.limonetikqualif.com/Razer/Order/PayPage/782373220980</merchantURL> <processorTransactionID>782373220980</processorTransactionID> <reconciliationID>XFZ5500Y4NON</reconciliationID> <amount>5.00</amount> <processorResponse>00001</processorResponse> <dateTime>2024-08-22T17:07:14Z</dateTime> </apSaleReply> </replyMessage>