Learn about Alipay, a digital wallet popular with customers from China. #
Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer’s login credentials.
Caratteristiche #
Sedi dei clienti | Consumatori cinesi Cinesi d'oltremare Viaggiatori cinesi |
---|---|
Elaborazione delle valute | CNY, GBP, USD, EUR, HKD |
Valute di regolamento | GBP,HKD,EUR |
Importo minimo della transazione | 0.01 CNY |
Importo massimo della transazione | No limit |
Rimborsi | ✅ |
Rimborsi parziali | ✅ |
Rimborso parziale multiplo | ❌ |
Addebito | ❌ |
Categorie commerciali vietate Both WooshPay and Alipay Plus maintain a list of prohibited businesses that aren’t allowed to use their services. To use Alipay Plus on WooshPay, your business can’t be restricted from using or appear on Alipay’s prohibited business list. If you’re not sure if your business is a prohibited business, or have questions about how these requirements apply to you, please contact support@wooshpay.com.
Subproducts #
Product | Payment scenarios description |
---|---|
Web Payment | On Desktop browser, after selecting Alipay as a payment method merchant checkout, a QR code appears. The shopper then opens Alipay app on their mobile phone and scans the barcode displayed on the browser page to complete the payment. |
APP Payment | On the mobile browser, a shopper selects Alipay as a payment method on Merchant checkout, and as redirected from the browser into the Alipay app to complete the payment before being redirected back to the Merchant browser. |
Flusso di pagamento #
Web Payment #
APP Payment #
Metodo di integrazione #
Valori dell'enumerazione del metodo di pagamento: alipay
There are two integration methods for Alipay
- API diretta
- Cassa
Integration method | payment scenarios | terminal_type enumeration values |
---|---|---|
API diretta | Web Payment | WEB |
API diretta | APP payment | APP |
Cassa | Web Payment | You don’t need to identify the terminal_type in checkout. Checkout will automatically generate a QR code or redirect to Alipay app based on their device. |
Cassa | APP payment | You don’t need to identify the terminal_type in checkout. Checkout will automatically generate a QR code or redirect to Alipay app based on their device. |
API diretta #
A PaymentIntent is an object that represents your intent to collect payment from your customer and tracks the lifecycle of the payment process. Create a PaymentIntent on your server and specify the amount to collect and a supported currency.
Creare un Intento di pagamento #
For direct API integration, you can create PaymentIntent and get url in only one step. The following is the demo of creating payment intents:
- Web Payment
- APP payment
You can control the payment scenarios generated in Payment Intent by changing the enumeration values of the terminal type:payemen_method_options.alipay.terminal_type
Web Payment #
Richiesta
{
"amount": 20,
"currency": "CNY",
"confirm": true,
"payment_method_options": {
"alipay": {
"client_ip": "192.168.0.1",
"terminal_type": "WEB",
"os_type": "IOS"
}
},
"payment_method_data": {
"type": "alipay"
},
"payment_method_types": [
"alipay"
],
"return_url": "https://wooshpay.com"
}
Risposta
{
"id": "pi_1666729870215872512",
"object": "payment_intent",
"created": 1686214342000,
"currency": "CNY",
"amount": 20,
"status": "requires_action",
"livemode": true,
"client_secret": "pi_1666729870215872512_secret_jmGL6NBNInPx5zdjIJ2utli4",
"next_action": {
"type": "redirect_to_url",
"alipay_handle_redirect": {
"url": "https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=28166604009zSv0130nTr0bKfhzSwT08YvSW"
}
},
"payment_method_types": [
"alipay"
],
"confirmation_method": "automatic",
"payment_method_options": {
"alipay": {
"terminal_type": "WEB",
"os_type": "IOS",
"client_ip": "192.168.0.1"
}
},
"return_url": "https://wooshpay.com",
"payment_method": "pm_1666729870102626304",
"capture_method": "automatic"
}
Il url
from next_action can be opened, from the link, the customer will be redirect to Alipay’s checkout page. The customner can scan the QR code or login to the wallet to pay.
APP payment #
Richiesta
{
"amount": 20,
"currency": "CNY",
"confirm": true,
"payment_method_options": {
"alipay": {
"client_ip": "192.168.0.1",
"terminal_type": "APP",
"os_type": "IOS"
}
},
"payment_method_data": {
"type": "alipay"
},
"payment_method_types": [
"alipay"
],
"return_url": "https://wooshpay.com"
}
Risposta
{
"id": "pi_1666732544285999104",
"object": "payment_intent",
"created": 1686214980000,
"currency": "CNY",
"amount": 20,
"status": "requires_action",
"livemode": true,
"client_secret": "pi_1666732544285999104_secret_NRUV59FL6qtFyz2bXVeDyLD4",
"next_action": {
"type": "redirect_to_url",
"alipay_handle_redirect": {
"url": "https://render.alipay.com/p/s/i/?scheme=alipays%3A%2F%2Fplatformapi%2FstartApp%3FappId%3D10000007%26actionType%3Droute%26qrcode%3D281666040092tD6e6GlEzzTlQl6HrEqv3kOI%26externalThrough%3D%257B%2522acTerminalType%2522%253A%2522WAP%2522%257D"
}
},
"payment_method_types": [
"alipay"
],
"confirmation_method": "automatic",
"payment_method_options": {
"alipay": {
"terminal_type": "APP",
"os_type": "IOS",
"client_ip": "192.168.0.1"
}
},
"return_url": "https://wooshpay.com",
"payment_method": "pm_1666732544155975680",
"capture_method": "automatic"
}
Cassa #
To support Alipay payments, a Checkout Session must satisfy all of the following conditions:
- Prices for all line items must be in the same currency. If you have line items in different currencies, create separate Checkout Sessions for each currency.
- È possibile utilizzare solo voci una tantum.
Enable Alipay as a payment method
Quando si crea una nuova sessione di cassa, è necessario:
Aggiungete Alipayplus all'elenco di tipi_di_metodo_di_pagamento
. Make sure all voci_di_linea
utilizzare la stessa valuta.
Creare una sessione #
You don’t need to identify the terminal_type when you create a checkout session. Checkout will automatically generate a QR code or redirect to Alipay App based on their device.
Richiesta
{
"cancel_url": "www.baidu.com",
"mode": "payment",
"success_url": "https://wooshpay.com/",
"payment_method_types": [
"alipay"
],
"line_items": [
{
"price_data": {
"currency": "CNY",
"unit_amount": 100000,
"active": true,
"product_data": {
"name": "taiwan fengli"
},
"billing_scheme": "testscheme",
"lookup_key": "test_lookup_key"
},
"quantity": 1
}
]
}
Risposta
{
"id": "cs_1666733999608823808",
"object": "checkout.session",
"created": 1686215327000,
"currency": "CNY",
"customer": "",
"mode": "payment",
"livemode": true,
"status": "open",
"url": "https://checkout.wooshpay.com/pay/cs_1666733999608823808?key=pk_live_dGVzdDpKeEQzUXhpWDJyYkFRZEo1QWtWN0dHUFo=",
"cancel_url": "www.baidu.com",
"line_items": {
"object": "list",
"data": [
{
"id": "li_1666733999642378240",
"object": "item",
"currency": "CNY",
"description": "taiwan fengli",
"price": {
"id": "price_1666733999659155456",
"object": "price",
"created": 1686215327000,
"active": true,
"currency": "CNY",
"product": {
"id": "prod_1666733999675932672",
"object": "product",
"created": 1686215327000,
"active": true,
"name": "taiwan fengli",
"livemode": true,
"updated": 1686215327000
},
"type": "one_time",
"livemode": true,
"unit_amount": 100000,
"billing_scheme": "per_unit",
"lookup_key": "test_lookup_key"
},
"quantity": 1,
"amount_subtotal": 100000,
"amount_total": 100000
}
]
},
"payment_intent": "pi_1666733999864676352",
"payment_method_types": [
"alipay"
],
"payment_status": "unpaid",
"success_url": "https://wooshpay.com/",
"amount_subtotal": 100000,
"amount_total": 100000,
"billing_address_collection": "auto",
"expires_at": 1686301726587,
"payment_link": "",
"client_secret": "pi_1666733999864676352_secret_5S1FMaseZU6gfIZjl2QlOdY7"
}
Il url
from next_action can be opened, from the link, the customer will be redirect to Alipay’s checkout page. The customner can scan the QR code or login to the wallet to pay.
Passo successivo #
È possibile aggiungere altre funzionalità all'integrazione in base alle esigenze.
Creare un webhook #
Ascoltate gli eventi sul vostro account WooshPay in modo che la vostra integrazione possa attivare automaticamente le reazioni. Creare un webhook che si concentri principalmente su enabled_events e url.
Creare un rimborso #
Creare un rimborso per restituire i fondi al cliente. È possibile eseguire anche rimborsi parziali, ma non tutti i metodi di pagamento li supportano. Un rimborso parziale consiste nel rimborsare solo una parte dell'importo della transazione originale.