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.
Caractéristiques #
Localisation des clients | Consommateurs chinois Chinois d'outre-mer Voyageurs chinois |
---|---|
Traitement des devises | CNY, GBP, USD, EUR, HKD |
Devises de règlement | GBP,HKD,EUR |
Montant minimum de la transaction | 0.01 CNY |
Montant maximum de la transaction | Aucune limite |
Remboursements | ✅ |
Remboursements partiels | ✅ |
Remboursement partiel multiple | ❌ |
Répétition de la dette | ❌ |
Catégories d'entreprises interdites 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.
Sous-produits #
Produit | Description des scénarios de paiement |
---|---|
Paiement par Internet | 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. |
Flux de paiement #
Paiement par Internet #
APP Payment #
Méthode d'intégration #
Valeurs de l'énumération des méthodes de paiement : alipay
There are two integration methods for Alipay
- API directe
- Sortie de caisse
Méthode d'intégration | payment scenarios | Valeurs de l'énumération terminal_type |
---|---|---|
API directe | Paiement par Internet | WEB |
API directe | APP payment | APP |
Sortie de caisse | Paiement par Internet | 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. |
Sortie de caisse | 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 directe #
Un PaymentIntent est un objet qui représente votre intention de percevoir un paiement de la part de votre client et qui suit le cycle de vie du processus de paiement. Créez un PaymentIntent sur votre serveur et indiquez le montant à encaisser ainsi qu'une devise prise en charge.
Créer un PaymentIntent #
Pour une intégration API directe, vous pouvez créer un PaymentIntent et obtenir l'url en une seule étape. Voici une démonstration de la création d'intentions de paiement :
- Paiement par Internet
- 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
Paiement par Internet #
Demande
{
"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"
}
Réponse
{
"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"
}
Le 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 #
Demande
{
"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"
}
Réponse
{
"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"
}
Sortie de caisse #
To support Alipay payments, a Checkout Session must satisfy all of the following conditions:
- Les prix de tous les articles doivent être exprimés dans la même devise. Si les articles sont libellés dans des devises différentes, créez des sessions de paiement distinctes pour chaque devise.
- Vous ne pouvez utiliser que des postes uniques.
Enable Alipay as a payment method
Lors de la création d'une nouvelle session de paiement, vous devez.. :
Ajouter Alipayplus à la liste des types_méthodes_de_paiement
. Assurez-vous que tous les articles_de_ligne
utilisent la même monnaie.
Créer une session #
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.
Demande
{
"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
}
]
}
Réponse
{
"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"
}
Le 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.
Prochaine étape #
Vous pouvez ajouter d'autres fonctionnalités à votre intégration en fonction de vos besoins.
Créer un Webhook #
Écoutez les événements sur votre compte WooshPay afin que votre intégration puisse déclencher automatiquement des réactions. Créez un webhook qui se concentre principalement sur enabled_events et url.
Créer un remboursement #
Créez un remboursement pour restituer des fonds à votre client. Vous pouvez également effectuer des remboursements partiels, mais ils ne sont pas pris en charge par toutes les méthodes de paiement. Un remboursement partiel consiste à ne rembourser qu'une partie du montant de la transaction initiale.