Plugins

Alipay (Online)

Accepting payments through Alipay, one of China's most popular online payment method gives you access to over 450 million registered Chinese consumers. Omise handles payments between the merchant and Alipay allowing you to accept payments without having to setup an Alipay account or registering for a Chinese bank account.

The payment flow

When your customer chooses Alipay as their preferred payment method at checkout, they go through a redirect payment flow. What this means is that they are redirected from the merchant’s website to Alipay’s secure checkout page where they authorize and confirm the payment. Upon completion, the customer is automatically redirected back to the merchant’s website.

On Alipay’s checkout page, the payment amount is pre-filled for your customer. All they’ve got to do is review and confirm. The currency displayed to your customer will be in the merchant account’s currency (current currency support: THB) and will be automatically converted to CNY by Alipay when it's processed. You’ll receive funds in your Omise account in your account’s currency.

Creating a charge by using Payment Source

Creating an offsite Alipay charge is almost identical to creating an internet banking charge;

3. To proceed to the Alipay checkout page, you’ll need to redirect the customer to the authorize_uri.

*Note: In test mode, copy the URL returned in the authorize_uri and paste it to your browser to proceed with testing.

You can always check the status of the charge by retrieving the charge as described in the Charges API.

If both authorized and paid are true, the charge succeeded.

If both authorized and paid are false, the charge failed. For detailed explanation on the reason the charge failed, check the failure_code and failure_message in the Charge object.

There is no scenario where authorized and paid are different values.

Refund

You can create a full or partial refund through our refund API or from the charge page on your dashboard.

Note: Alipay charges can only be refunded within 3 months of the transaction date.

Webhooks

Rather than relying on the redirection back to the return_uri , we suggest you make use of our Webhook API . Whenever a transaction is completed, a webhook is sent to the URL that is specified in the dashboard with the event name charge.complete

Charge Status

Status

Description

successful

The payee has successfully made payment (authorized = true and paid = true)

pending

Awaiting action from the payee

expired

The payee did not pay within 24 hours

failed

The charge failed. You can check the reason from the failure_code and failure_message in the charge result.