Accept payments with EasySafePay (API)

Antom EasySafePay is a streamlined payment solution designed for low-value, high-frequency payment scenarios. During the first payment, buyers can either bind their wallet or pay directly. For subsequent payments, they can complete the transaction with a single click, without entering a password.
Powered by an industry-leading intelligent risk control system, dynamic routing technology, and payment failure recovery strategies, this solution ensures transaction security while achieving top-tier payment success rates across the industry. It delivers benefits to buyers, merchants, and the broader platform ecosystem by enhancing the payment experience, improving merchant conversion rates, and increasing ecosystem value.
This article mainly introduces how to integrate the EasySafePay product via API.

User experience

The user experience for each payment method differs between PC and mobile devices. For the specific interaction flows, please refer to the table and user experience diagrams below.
Web
WAP
App

Payment flow

First payment
Subsequent payments

Integration preparations

Before you start integrating, read the Integration Guide and API Overview documents to understand the integration steps of the server-side API and the precautions for calling the API. Furthermore, ensure that the following prerequisites are met:
  • Obtain a client ID
  • Complete the key configuration
  • Complete the configuration of paymentNotifyUrl to receive the asynchronous notification
  • Integrate the server-side SDK package, install the server-side library, and initialize a request instance. For more details, refer to Server-side SDK.

Integration steps

Start your integration by taking the following steps:
  1. Create a payment request
  2. Obtain the payment continuation URL
  3. Obtain the authorization and payment result.

Step 1: Create a payment request

After the buyer clicks the payment button, call the pay (Tokenized Payment) API and pass in the order information.
The table below describes the API request parameters for the first payment and subsequent payments.
Note:
  • The integration flow for PayPay Smart Payment is different. For the specific steps, please refer to Accept payments with PayPay Smart Payment.
  • For Express Bank Transfer, the first payment and subsequent payments use the same request parameter format. The buyer only needs to enter their mobile phone number on the payment page to complete the payment.
For AlipayHK and DANA, the supported buyerPhoneNo formats are as follows:
During the first payment, passing order.buyer.buyerPhoneNo can automatically prefill the buyer’s payment account on the payment page, eliminating the need for manual entry. Below is a comparison of the user experience with and without this parameter:
Payment method login account is provided
Payment method login account not provided
Below are code examples for first and subsequent payments.
First payment
Subsequent payments
Common questions
Q: Can I use Chinese characters in the value of the request parameters?
A: To avoid incompatibility of a certain payment method, do not use Chinese characters for parameters in the request.

Q: How to set the URL to receive the payment notification?
A: Specify paymentNotifyUrl in the pay (Tokenized Payment) API to receive the asynchronous notification about the payment result (notifyPayment), or configure the receiving URL in Antom Dashboard. If the URL is specified in both the request and Antom Dashboard, the value specified in the request takes precedence.

Q: What is the difference between paymentAmount and orderAmount?
A: paymentAmount refers to the payment amount, while orderAmount refers to the order amount. The actual charged amount is determined by paymentAmount.

Step 2: Obtain the payment continuation URL

After obtaining the payment continuation URL returned by Antom, the merchant server passes the address to the front end. The merchant front end redirects to the payment method page.
The following is the sample codes for loading payment continuation URL on the merchant front end:
Web
WAP
iOS
Android
Note: The URLs in the sample code refer to the applinkUrl, schemeUrl, and normalUrl returned in Step 1. For how to use these URLs, see Best practices for configuring the authorization URL.
The figure below shows a sample rendering of the payment method checkout page:
First payment
Subsequent payments

Step 3: Obtain the authorization and payment result

Return to the payment result page

After the buyer completes the payment, they will be redirected back to the paymentRedirectUrl specified in the pay (Tokenized Payment) API.
Note: Redirection may not occur in certain scenarios. For example, it may fail due to buyer actions or network issues.

Obtain the authorization and payment result

The first payment returns both the authorization result and the payment result, while subsequent payments return only the payment result. Common scenarios are as follows:
Obtain the authorization result
Obtain the payment result
Common questions
Q: When is the payment notification sent?
A: It depends on whether the payment is completed: If the payment is successfully completed, Antom usually sends an asynchronous notification within 3 to 5 seconds.

Q: Is there an asynchronous notification sent for authorization failure?
A: No. An asynchronous notification will only be sent if the authorization is successful; there will be no notification returned for authorization failure.

Q: Will the asynchronous notification be re-sent?
A: Yes, the asynchronous notification will be re-sent automatically within 24 hours for the following cases:
  • If you didn't receive the asynchronous notification due to network reasons.
  • If you receive an asynchronous notification from Antom, but you didn't make a response to the notification in the sample code format of Process the notification.
The notification can be resent up to 8 times or until a correct response is received to terminate delivery. The sending intervals are as follows: 0 minutes, 2 minutes, 10 minutes, 10 minutes, 1 hour, 2 hours, 6 hours, and 15 hours.

Q: Are the authorization notification and payment result notification sent separately, and will the authorization notification always be received before the payment result notification?
A: Due to the uncontrollable nature of network stability, it is possible for the authorization notification to arrive later than the payment result notification.

Q: Is authorization result inquiry supported?
A: Currently, calling an API to query the authorization result is not supported.

Q: When responding to an asynchronous notification, do I need to add a digital signature?
A: No. If you receive an asynchronous notification from Antom, you are required to return the response in the sample code format of Process the notification, but you do not need to countersign the response.

After payments

Revoke authorization

After authorization is completed, the buyer can revoke the authorization from either the merchant side or the payment method side. Once revoked, the original authorization token immediately becomes invalid and cannot be used for payments again. For details, refer to Revoke.

Cancel

You can cancel orders through the cancel API within the time window (by D+1 day 00:15 GMT+8). For details, refer to Cancel.

Refund

Refer to Refund to learn about Antom refund rules and operation process.

Reconciliation

After a transaction is completed, use the provided Antom financial reports to perform reconciliation. For settlement rules and reconciliation operations, refer to Reconciliation.

Best practices

Antom provides you with the following best practice solutions. Refer to Best practices for more details.
  • Intelligent risk control service
  • Order query after redirecting to the merchant result page
  • Merchant-initiated transaction cancellation
  • Payment failure retry