On This Page
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 Alipay+. When the customer
completes the checkout, the customer is redirected to your merchant website based on the
success URL you include in the
apSaleService_successURL
request field.Supported Digital Wallets
This table lists the supported digital wallet types and the relevant digital wallet
code, country code, and currency code for each country. When sending a sale request,
set these fields to the specified values listed in the table:
- Set to a value listed in the Digital Wallet Code column.
- Set to a value listed in the Country Code column.
- Set to a value listed in the Currency Code column.
Country | Digital Wallet | Digital Wallet Code | Country Code | Currency Code |
|---|---|---|---|---|
China | Alipay | ALO | CN | CNY |
Hong Kong (CN) | Alipay+ | ALP | HK | HKD |
Indonesia | Akulaku PayLater | APL | ID | IDR |
Indonesia | Dana | DNA | ID | IDR |
Korea, Republic of (South) | KakaoPay | KPT | KR | KRW |
Malaysia | Boost | BST | MY | MYR |
Malaysia | Touch'n'GO | TNG | MY | MYR |
Philippines | Bank of Philippines | BPI | PH | PHP |
Philippines | Gcash | GCH | PH | PHP |
Thailand | Rabbit Line Pay | RPL | TH | THB |
Thailand | TrueMoney | TMY | TH | THB |
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.
- Send aPOSTrequest to thehttps://ics2ws.ic3.com/commerce/1.x/transactionProcessorendpoint and include these required fields:
- Set to a value listed in the Digital Wallet Code column.
- Set to the URL to which the customer is redirected after successfully completing the Alipay+ payment.
- Add?action=cancelto the end of the URL to help identify the response.
- Set to the URL to which the customer is redirected after successfully completing the Alipay+ payment.
- Add?action=failureto the end of the URL to help identify the response.
- Set to the URL to which the customer is redirected after successfully completing the Alipay+ payment.
- Add?action=successto the end of the URL to help identify the response.
- Set totrue.
- Set to one of these possible values:
- CN: China
- HK: Hong Kong (CN)
- ID: Indonesia
- KR: Korea, Republic of (South)
- MY: Malaysia
- PH: Philippines
- TH: Thailand
- Set to one of these possible values:
- CNY: Chinese yuan renminbi
- HKD: Hong Kong dollar
- IDR: Indonesian rupiah
- KRW: South Korean won
- MYR: Malaysian ringgit
- PHP: Philippine peso
- THB: Thai baht
- You can include these optional fields in the request:
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- If this field is present, thepurchaseTotals_currencyfield is optional.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- Redirect the customer to the returned URL in themerchantURLresponse field.<merchantURL>https://payment.limonetikqualif.com/AlipayPlus/Order/PayPage/500877975585</merchantURL>
- When the customer completes the checkout using their Alipay+ credentials, the customer is redirected to the merchant website based on the URL that you included in theapSaleService_successURLfield.The customer must selectReturn to Merchantat the end of check out in order for the sale to settle.
- Save the request ID in therequestIDfield 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>CN</country> </billTo> <purchaseTotals> <currency>CNY</currency> <grandTotalAmount>220.00</grandTotalAmount> </purchaseTotals> <apPaymentType>ALO</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
<replyMessage xmlns:c="urn:schemas-cybersource-com:transaction-data-1.215"> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <requestID>6953229557336619903008</requestID> <decision>ACCEPT</decision> <reasonCode>100</reasonCode> <requestToken>AxjnrwSTfCrhKA1WZ6GDANgZYiy6lag2k0Y0+SnkF2K8QJOD6vgaCwyaSZejFfqtQk3wq4SgNVmehgwA7Awz</requestToken> <purchaseTotals> <currency>CNY</currency> </purchaseTotals> <apSaleReply> <reasonCode>100</reasonCode> <paymentStatus>pending</paymentStatus> <responseCode>00001</responseCode> <merchantURL>https://payment.limonetikqualif.com/AlipayPlus/Order/PayPage/401484998592</merchantURL> <processorTransactionID>401484998592</processorTransactionID> <reconciliationID>XEKTVP6IQFOI</reconciliationID> <amount>220.00</amount> <processorResponse>00001</processorResponse> <dateTime>2023-11-29T19:14:15Z</dateTime> </apSaleReply> </replyMessage>