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.
Caractéristiques #
Traitement des devises | THB |
---|---|
Devises de règlement | USD |
Montant minimum de la transaction | 1 THB |
Montant maximum de la transaction | 5,000 THB |
Remboursements | ❌ |
Remboursements partiels | ❌ |
Remboursement partiel multiple | ❌ |
Répétition de la dette | ❌ |
Flux de paiement #
Méthode d'intégration #
Valeurs de l'énumération des méthodes de paiement : promptpay
There are two integration methods for PromptPay
- API directe
- Sortie de caisse
Direct API #
Comment s'intégrer #
Pour une intégration API directe, vous pouvez créer un PaymentIntent et obtenir l'url en une seule étape. Voici la démonstration de la création d'une intention de paiement :
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.
Demande
{
"amount":1000,
"currency":"THB",
"confirm":true,
"payment_method_data" : {
"type":"promptpay"
},
"return_url":"https://your.website"
}
Réponse
{
"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"
}
Sortie de caisse #
Create a seesion #
Demande
{
"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
}
]
}
Réponse
{
"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"
}
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.