プロンプトペイ

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.

特徴 #

通貨の処理テトラヒドロフラン
決済通貨米ドル
最低取引額1 バーツ
最大取引額5,000 バーツ
払い戻し
一部払い戻し
複数回の一部払い戻し
チャージバック

支払いの流れ #

pic_2@2x.png

統合方式 #

支払い方法の列挙値: promptpay

There are two integration methods for PromptPay

  1. ダイレクトAPI
  2. チェックアウト

ダイレクト API #

統合の方法 #

直接APIを統合するには、PaymentIntentを作成し、1つのステップでURLを取得することができます。以下はペイメントインテントを作成するデモです:

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 promptpay to the list of payment method types.

リクエスト

{
    "amount":1000,
    "currency":"THB",
    "confirm":true,
    "payment_method_data" : {
        "type":"promptpay"
    },
    "return_url":"https://your.website"
}

応答

{
    "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"
}

チェックアウト #

シーシオンを作る #

リクエスト

{
    "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
        }
    ]
}

応答

{
    "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"
}

次のステップ #

必要に応じて、統合にさらに機能を追加することができます。

ウェブフックの作成 #

統合が自動的にリアクションをトリガーできるように、WooshPayアカウントのイベントをリッスンします。enabled_eventsとurlにフォーカスしたWebhookを作成します。

What are your feelings
Updated on 8月 8, 2023