Learn about PromptPay, an instant funds transfer service popular in Thailand.
PromptPay is an infrastructure solution developed and regulated by the payment policy-making authority Bank of Thailand (BoT). Their Payment System Roadmaps modernize the payment infrastructure in the country alongside banks. To transfer funds between banks, users are identified through proxies such as mobile phone number, national identification number, corporate registration number, or digital wallet number.
Caratteristiche #
Elaborazione delle valute | THB |
---|---|
Valute di regolamento | USD |
Importo minimo della transazione | 1 THB |
Importo massimo della transazione | 5.000 THB |
Rimborsi | ❌ |
Rimborsi parziali | ❌ |
Rimborso parziale multiplo | ❌ |
Addebito | ❌ |
Flusso di pagamento #
Metodo di integrazione #
Valori dell'enumerazione del metodo di pagamento: promptpay
There are two integration methods for PromptPay
- API diretta
- Cassa
Diretto API #
Come integrare #
Per l'integrazione diretta con l'API, è possibile creare un PaymentIntent e ottenere l'url in un solo passaggio. Di seguito è riportata la demo della creazione di un intento di pagamento:
Creare un Intento di pagamento
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 promptpay to the list of payment method types.
Richiesta
{
"amount":1000,
"currency":"THB",
"confirm":true,
"payment_method_data" : {
"type":"promptpay"
},
"return_url":"https://your.website"
}
Risposta
{
"id": "pi_1664208234002513920",
"object": "payment_intent",
"created": 1685613137000,
"currency": "THB",
"amount": 1000,
"status": "requires_action",
"livemode": false,
"client_secret": "pi_1664208234002513920_secret_tzDL9JipXe0RE3qGTkNVty9j",
"next_action": {
"type": "promptpay_handle_redirect",
"promptpay_handle_redirect": {
"url": "https://apitest.wooshpay.com/v1/receives/c12/pay/pi_1664208234002513920"
}
},
"payment_method_types": [
"promptpay"
],
"confirmation_method": "automatic",
"return_url": "https://your.website",
"payment_method": "pm_1664208233880879104",
"capture_method": "automatic"
}
Cassa #
Creare una visione #
Richiesta
{
"cancel_url": "www.wooshpay.com",
"mode": "payment",
"success_url": "https://wooshpay.com/",
"payment_method_types": [
"promptpay"
],
"line_items": [
{
"price_data": {
"currency": "THB",
"unit_amount": 100,
"nickname": "apple",
"product_data": {
"name": "apple"
},
"billing_scheme": "testscheme",
"lookup_key": "test_lookup_key"
},
"quantity": 1
}
]
}
Risposta
{
"id": "cs_1676158633408200704",
"object": "checkout.session",
"created": 1688462334000,
"livemode": false,
"currency": "THB",
"customer": "",
"mode": "payment",
"status": "open",
"url": "https://checkouttest.wooshpay.com/pay/cs_test_1676158633408200704?key=pk_test_NTE2NzQzMzIzODEyNTI4MTY4OTYxOjEyVWdaRjhhSGpqOFZhRDZvaFRyc1RZbzE2ODgwMjY5MjU5NTk",
"cancel_url": "www.wooshpay.com",
"line_items": {
"object": "list",
"data": [
{
"id": "li_1676158633437560832",
"object": "item",
"currency": "THB",
"description": "apple",
"price": {
"id": "price_1676158633450143744",
"object": "price",
"created": 1688462334000,
"livemode": false,
"active": true,
"currency": "THB",
"nickname": "apple",
"product": {
"id": "prod_1676158633462726656",
"object": "product",
"created": 1688462334000,
"livemode": false,
"active": true,
"name": "apple",
"updated": 1688462334000
},
"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_1676158633626304512",
"payment_method_types": [
"promptpay"
],
"payment_status": "unpaid",
"success_url": "https://wooshpay.com/",
"amount_subtotal": 100,
"amount_total": 100,
"billing_address_collection": "auto",
"expires_at": 1688548734385,
"payment_link": "",
"client_secret": "pi_1676158633626304512_secret_JbvbX6yCPEBB886Z46Rs5vw8"
}
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.