Alipay Plus Payments #
Alipay Plus is a digital wallet from China that serve customer from southeast Asia and China. Alipay Plus users can pay on the web or on a mobile device using login credentials or specific app Alipay Plus supports.
Characteristics #
Customer locations
- Chinese consumers
- Overseas Chinese
- Chinese travelers
- Southeast Asia consumers
Presentment currency
CNY, HKD, GBP, IDR, MYR, PHP, THB
Wallet List
- AlipayHK
- DANA
- TNG
- BPI
- Rabbit LINE Pay
- GCash
- Boost
- Akulaku PayLater
Prohibited business categories
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 Stripe 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 [email protected].
Server to Server integration #
Using Alipay Plus, customers pay by redirecting from your website or app, authorize the payment through different wallet, then return to your website or app where you get immediate notification on whether the payment succeeded or failed.
Overview #
For direct API intergration, you can create paymentintent and get url in only one step, the folllowing is the demo of creating payment intents:
- Create a paymentintent
- Refund
- Webhook
1. Create a PaymentIntent #
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. If you have an existing Payment Intents integration, add alipayplus to the list of payment method types.
Request Create a PaymentIntent
{
"amount":200,
"currency":"IDR", //different currency may result different wallet
"confirm":true,
"payment_method_options":{
"alipayplus":{
"terminal_type":"WEB"
}
},
"payment_method_data":{
"type":"alipayplus"
},
"return_url":"https://wooshpay.com"
}
Response
{
"id": "pi_1646355176136638464",
"object": "payment_intent",
"created": 1681356636000,
"currency": "IDR",
"amount": 200,
"status": "requires_action",
"livemode": true,
"client_secret": "pi_1646355176136638464_secret_gxkV1LYb76c2nFvtzDmHevyw",
"next_action": {
"alipayplus_handle_redirect": {
"normalUrl": "https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=281666040092tDht8YNMR2t2u648Mu5v476I"
}
},
"payment_method_types": [
"alipay",
"wechat_pay",
"card",
"alipayplus"
],
"confirmation_method": "automatic",
"payment_method_options": {
"alipayplus": {
"terminal_type": "WEB"
}
},
"return_url": "https://wooshpay.com",
"payment_method": "pm_1646355176006615040",
"capture_method": "automatic"
}
The normalUrl from next_action
can be opened, from the link, the customer will be shown a different wallet based on the currency, and the customner can choose the one they want to pay, either scan the QR code or login to the wallet.
2. Refund #
You can partially or fully refund any successful payment, either using API or Dashboard. To view a list of all your refunds, go to the Refunded payments page in the Dashboard.
To refund a payment using the API, create a refund providing the PaymentIntent.
Request Create a refund
{
"reason":"requested_by_customer",
"payment_intent":"pi_1575055712604651520"
}
Response
{
"id":"re_1575092157281206272",
"object":"refund",
"created":1664366209000,
"amount":20,
"currency":"CNY",
"metadata":null,
"reason":"requested_by_customer",
"status":"succeeded",
"description":null,
"payment_intent":"pi_1575055712604651520",
"failure_reason":null
}
3. Webhook #
Listen for events on your WooshPay account so your integration can automatically trigger reactions. Create a webhook that mainly focuses on enabled_events
and url
.
Steps to receieve a webhook:
- Identify the events you want to monitor and the event payloads to parse.
- Create a webhook endpoint as an HTTP endpoint (URL) on your local server.
- Test that your webhook endpoint is working properly, and see if you have received a callback.
Request
{
"url":"https://apitest.wooshpay.com/v1/receives",
"description":"I_am_description",
"enabled_events":[
"payment_intent.created",
"payment_intent.payment_failed",
"payment_intent.succeeded",
"charge.refund.updated"
],
"api_version":"1.0.1"
}
Response
{
"id":"we_1575093135514533888",
"object":"webhook_endpoint",
"created":1664366442000,
"description":"I_am_description",
"metadata":null,
"status":"enabled",
"url":"https://apitest.wooshpay.com/v1/receives",
"livemode":false,
"api_version":"1.0.1",
"enabled_events":[
"payment_intent.created",
"payment_intent.payment_failed",
"payment_intent.succeeded",
"charge.refund.updated"
]
}
Checkout #
To support Alipayplus 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. - You can only use one-time line items.
Enable Alipayplus as a payment method #
When creating a new Checkout Session, you need to:
Add Alipayplus to the list of payment_method_types
.
Make sure all line_items
use the same currency.
Request Create a Session
{
"cancel_url": "www.baide.com",
"mode": "payment",
"success_url": "www.wooshpay.com",
"payment_method_options": { //add alipayplus as payment method
"alipayplus": {
"terminal_type": "WEB"
}
},
"line_items": [
{
"price_data": {
"currency": "GBP",
"product": null,
"unit_amount": 5,
"active": true,
"metadata": {
"key1": "value1",
"key2": "value2"
},
"nickname": "fengli",
"product_data": {
"id": null,
"name": "taiwan fengli",
"active": true,
"description": "very delicious",
"metadata": {
"key1": "value1",
"key2": "value2"
},
"url": "www.baidu.com"
},
"billing_scheme": "testscheme",
"lookup_key": "test_lookup_key"
},
"quantity": 1
}
]
}
Response
{
"id": "cs_1597163428114333696",
"object": "checkout.session",
"created": 1669628410000,
"currency": "GBP",
"customer": "",
"mode": "payment",
"livemode": true,
"shipping": null,
"status": "open",
"url": "https://checkout.wooshpay.com/pay/cs_1597163428114333696?key=pk_live_dGVzdDpKeEQzUXhpWDJyYkFRZEo1QWtWN0dHUFo=",
"cancel_url": "www.baidu.com",
"client_reference_id": null,
"customer_email": null,
"line_items": {
"object": "list",
"data": [
{
"id": "li_1597163428139499520",
"object": "item",
"currency": "GBP",
"description": "taiwan fengli",
"price": {
"id": "price_1597163428152082432",
"object": "price",
"created": 1669628410000,
"active": true,
"currency": "GBP",
"metadata": {
"key1": "value1",
"key2": "value2"
},
"nickname": "fengli",
"product": {
"id": "prod_1597163428164665344",
"object": "product",
"created": 1669628410000,
"active": true,
"description": "very delicious",
"metadata": {
"key1": "value1",
"key2": "value2"
},
"name": "taiwan fengli",
"livemode": true,
"url": "www.baidu.com",
"updated": 1669628410000,
"images": null
},
"type": "one_time",
"livemode": true,
"unit_amount": 5,
"billing_scheme": "per_unit",
"lookup_key": "test_lookup_key"
},
"quantity": 1,
"amount_subtotal": 5,
"amount_total": 5
}
],
"url": null,
"has_more": null
},
"payment_intent": "pi_1597163428336631808",
"payment_method_types": null,
"payment_status": "unpaid",
"success_url": "www.wooshpay.com",
"amount_subtotal": 5,
"amount_total": 5,
"billing_address_collection": "auto",
"expires_at": 1669714809783,
"payment_link": "",
"payment_method_options": null,
"phone_number_collection": null,
"shipping_address_collection": null,
"client_secret": "pi_1597163428336631808_secret_pxwFDDYAbSnC99NpAKVwE1Sr"
}
The url will direct customer to WooshPay’s checkout page, the customer will be shown a different wallet based on the currency, and the customner can choose the one they want to pay, either scan the QR code or login to the wallet.