UnionPay
Characteristics
Feature | Details |
---|---|
Processing currencies | USD、GBP、EUR、HKD、SGD、CNY |
Settlement currencies | USD |
Refunds | ✓ |
Partial Refunds | ✓ |
Payment process
1.
2.
Integration Method
unionpay
1.
2.
Direct API
Create a PaymentIntent
{
"amount":1050,
"currency":"CNY",
"confirm":true,
"payment_method_data" : {
"type":"unionpay"
},
"return_url":"https://your.website"
}
{
"id": "pi_1646357082686881792",
"object": "payment_intent",
"created": 1681357091000,
"currency": "CNY",
"amount": 1050,
"status": "requires_action",
"livemode": true,
"client_secret": "pi_1646357082686881792_secret_WrLaoJjPfB9FaWPfaqsxQyPx",
"next_action": {
"type": "unionpay_handle_redirect",
"unionpay_handle_redirect": {
"url": "https://api.wooshpay.com/v1/receives/paydibs/pay/1646357082686881792"
}
},
"payment_method_types": [
"unionpay"
],
"confirmation_method": "automatic",
"return_url": "https://your.website",
"payment_method": "pm_1646357082556858368",
"capture_method": "automatic"
}
Checkout
Create a seesion
{
"cancel_url": "www.wooshpay.com",
"mode": "payment",
"success_url": "https://wooshpay.com/",
"payment_method_types": [
"unionpay"
],
"line_items": [
{
"price_data": {
"currency": "CNY",
"unit_amount": 100,
"nickname": "apple",
"product_data": {
"name": "apple"
},
"billing_scheme": "testscheme",
"lookup_key": "test_lookup_key"
},
"quantity": 1
}
]
}
{
"id": "cs_1722490919669727232",
"object": "checkout.session",
"created": 1699508812000,
"livemode": true,
"currency": "CNY",
"customer": "",
"mode": "payment",
"status": "open",
"url": "https://checkout.wooshpay.com/pay/cs_1722490919669727232?key=cGtfbGl2ZV9OVEUzTVRZek56STJNVE14TkRVMk9UUXlNRGd4T205dmNVRmFNMGRPVTBSa2VHZzJVbWQ1V1U4MFNUSTJSREUyT1Rnd05UQXdPVFF6TVRn",
"cancel_url": "www.wooshpay.com",
"line_items": {
"object": "list",
"data": [
{
"id": "li_1722490919694893056",
"object": "item",
"currency": "CNY",
"description": "apple",
"price": {
"id": "price_1722490919703281664",
"object": "price",
"created": 1699508812000,
"livemode": true,
"active": false,
"currency": "CNY",
"nickname": "apple",
"product": {
"id": "prod_1722490919711670272",
"object": "product",
"created": 1699508812000,
"livemode": true,
"active": false,
"name": "apple",
"updated": 1699508812000
},
"type": "one_time",
"unit_amount": 100,
"billing_scheme": "per_unit",
"lookup_key": "test_lookup_key"
},
"quantity": 1,
"amount_subtotal": 100,
"amount_total": 100
}
]
},
"payment_intent": "pi_1722490922173726720",
"payment_method_types": [
"unionpay"
],
"payment_status": "unpaid",
"success_url": "https://wooshpay.com/",
"amount_subtotal": 100,
"amount_total": 100,
"billing_address_collection": "auto",
"expires_at": 1699595212242,
"payment_link": "",
"client_secret": "pi_1722490922173726720_secret_fCyH13QfV89RRfXYPAVvEUOJ"
}
Next step
Create a Webhook
Create a Refund
Modified at 2024-03-11 02:02:48