Promptpay

Overview

Promptpay is a payment method which allows customers to make purchases in Thailand by scanning standardized QR codes with mobile banking applications of Thailand banks. Purchases can be processed by using Payment Page and Gate, and in both cases two channels can be used—purchase processing via channel 1 involves redirection of the customer to the provider service, and purchase processing via channel 2 is performed without redirection of the customer. For more information about the applicable processing way, refer to your ecommpay key account manager.

General information

Payment method type QR code payments
Payment instruments bank accounts
Countries and regions TH
Payment currencies THB
Currency conversion
Purchases +
Payouts
Stored credentials payments
Full refunds
Partial refunds
Chargebacks
Notes
  • For purchase processing with redirection of the customer to the provider service the expiration time of the QR code on the provider side is 6 minutes.
  • For purchase processing without redirection of the customer to the provider service the expiration time of the QR code on the side of the ecommpay payment platform can be configured. To set the expiration time of the QR code, contact ecommpay technical support specialists.
Onboarding and access fee Refer to your ecommpay key account manager

Interaction diagram

Payment processing by using the Promptpay payment method requires merchant's web service, one of ecommpay interfaces, and the ecommpay payment platform, as well as provider technical facilities.



Operations support

  Interfaces Amounts, THB * Timespans **
Payment Page CMS Plug-ins Gate Dashboard minimum maximum basic time threshold time
Purchases + + * * 3-4 minutes

* For information about the amount limits, contact your ecommpay key account manager.

** The basic time and the threshold time are defined as follows:
  • The basic time is the average estimated time between the moment a payment is initiated in the payment platform to the moment the payment result is sent to the initiator. The basic time evaluation is made on the assumption of normal operation of all technical facilities and communication channels and typical customer behaviour (if any input from customer is required). Use the basic time to estimate when to react to the absence of payment result notifications or when to check payment status.
  • The threshold time is the maximum possible time from the moment a payment is initiated in the payment platform to the moment the information about the payment result is sent to the initiator. A payment is automatically declined, if its waiting time exceeds the threshold time. For individual setting of the threshold time limit, contact ecommpay technical support.

Processing scenarios

Purchase processing by using the Promptpay method can be performed with or without redirection of the customer to the provider service.

Figure: Purchase by using Payment Page with redirection of the customer



Figure: Purchase by using Payment Page without redirection of the customer



Figure: Purchase by using Gate with redirection of the customer



Figure: Purchase by using Gate without redirection of the customer



The following sections provide detailed information about what you need to do to perform payments and how you can analyse the information on payments and operations.

Purchases by using Payment Page. Channel 1: with redirection of the customer

General information

In the Promptpay method, when processing a purchase by using Payment Page, the merchant web service should send a request with all the required parameters and signature to the ecommpay URL and get the callback with the payment result from the payment platform. When opening Payment Page, you can have Payment Page opened with the Promptpay method selected. For more information about preselecting payment methods, see in Preselecting payment methods. The full sequence and particularities of the purchase process are provided below.



Figure: Purchase by using Payment Page

  1. A customer initiates a purchase on the merchant's web service.
  2. The web service sends the request for Payment Page opening to the specified ecommpay URL.
  3. The request for opening is redirected to the payment platform.
  4. The payment platform performs the initial request processing that involves validation of the required parameters and signature.
  5. Requested Payment Page is generated into the ecommpay payment platform as specified in the project settings and the request parameters.
  6. Payment Page is displayed to the customer.
  7. The customer selects the Promptpay method.
  8. The payment platform receives the purchase request for payment processing from Payment Page.
  9. The payment platform performs the internal purchase request processing.
  10. The payment platform sends the customer redirection data to Payment Page.
  11. The customer is redirected to the provider website.
  12. The customer completes all the payment steps required.
  13. The payment is processed on the provider side.
  14. The customer is redirected to Payment Page.
  15. The provider service sends the result notification to the payment platform.
  16. The payment platform sends a callback with the payment result to the web service.
  17. The payment platform sends the result to Payment Page.
  18. A page with the payment result information is displayed to the customer on Payment Page.

The sections that follow discuss in more details the request format and the Payment Page parameters to use in the Promptpay payment method and provide the information on the format of callbacks with payment results. For the general information on how to use the API, see Payment Page API Description.

Request format

There are several things you need to consider when using the Promptpay method:

  1. You must provide values for the basic minimum of parameters. Listed below are the parameters that are mandatory for any payment method:
    • project_id—the project ID obtained from ecommpay
    • payment_id—payment ID unique within the project
    • payment_currency—payment currency in ISO-4217 alpha-3 format
    • payment_amount—payment amount in minor units
    • customer_id—customer ID unique within the project
  2. The currency of payment can only be THB.
  3. If you need to have payment form displayed with the Promptpay method selected, set the force_payment_method parameter to promptpay.
  4. If required, you can also add any other additional parameters Payment Page supports.
  5. After you specify all the parameters you need, you must create the signature for the request. For instructions on how to sign a payment request, see Signature generation and verification.

Thus, a correct payment request in the Promptpay method must include project and payment IDs, the currency and the amount of a payment in the appropriate currency, customer ID, as shown in the following example:

    { payment_id: 'X03936', 
      payment_amount: 1000, 
      payment_currency: 'THB', 
      project_id: 123, 
      customer_id: 'customer1',
      signature: "kUi2x9dKHAVNU0FYldJrxh4yo+5...ZzUCwX6R\/ekpZhkIQg=="
    }

For information about all parameters available in the Promptpay method, see Parameters for opening payment form.

Callback format

The Promptpay method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with an information about successful 1000.00 THB purchase made by the 123 customer in the 382 project.

Figure: Example of a successful purchase callback

{
        "project_id": 382,
        "payment": {
            "type": "purchase",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "status": "success",
            "method": "promptpay",
            "id": "cfaf576641101077ec3440ffaf476a9d",
            "date": "2020-09-07T12:44:54+0000"
        },
        "customer": {
            "id": "123"
        },
        "operation": {
            "type": "sale",
            "sum_initial": {
                "currency": "THB",
                "amount": 100000
            },
            "sum_converted": {
                "currency": "THB",
                "amount": 100000
            },
            "status": "success",
            "request_id": "057cdba3b2b54b994a5f9c3c4080ff...fdec3b0b0be6b-00089013",
            "provider": {
                "payment_id": "079253339",
                "id": 3351,
                "date": "2020-09-07T04:44:52+0000"
            },
            "message": "Success",
            "id": 89012010009801,
            "date": "2020-09-07T12:44:54+0000",
            "created_date": "2020-09-07T12:42:17+0000",
            "code": "0"
        },
        "signature": "mwiKFBdPKMUEmDieNYeJ...w0R0GGfIBVExvubTbimclPgfx2/CY8Yq+g=="
    }
}

The following is the example of a callback for a declined purchase.

Figure: Example of a declined purchase callback

{
        "project_id": 383,
        "payment": {
            "type": "purchase",
            "sum": {
                "amount": 185384,
                "currency": "THB"
            },
            "status": "decline",
            "method": "promptpay",
            "id": "bde45cdea1ac5c4a75e2d04689a06ad4",
            "date": "2020-09-07T11:01:34+0000"
        },
        "customer": {
            "id": "456"
        },
        "operation": {
            "type": "sale",
            "sum_initial": {
                "currency": "THB",
                "amount": 185384
            },
            "sum_converted": {
                "currency": "THB",
                "amount": 185384
            },
            "status": "decline",
            "request_id": "c7d5631fdd81a4394e85d82...eb70af0e207f1a133-00085510",
            "provider": {
                "payment_id": "079243093",
                "id": 3351,
                "date": "2020-09-07T03:01:32+0000"
            },
            "message": "General decline",
            "id": 85509010009741,
            "date": "2020-09-07T11:01:34+0000",
            "created_date": "2020-09-07T10:09:31+0000",
            "code": "20000"
        },
        "signature": "FEPNq/ijls1WTCdNdz8FD1bM6kWe04AO...Lri/KEHcn/ihMSmzv/cNmQ=="
    }
}

Related topics

The following topics might be useful when implementing payments by using Payment Page:

Purchases by using Payment Page. Channel 2: without redirection of the customer

General information

To process a purchase through Payment Page by using the Promptpay method, the merchant web service needs to send a request with all the required parameters and signature to the ecommpay URL and receive a callback with the payment result from the payment platform. The Promptpay method can also be set as preselected payment method when Payment Page opens. For more information about preselecting payment methods, see the Preselecting payment methods section. The full sequence and special aspects of the purchase processing are provided below.



Figure: Purchase processing by using Payment Page: Step-by-step description

  1. Customer initiates a purchase in merchant's web service.
  2. The web service sends the request for opening Payment Page to the specified ecommpay URL.
  3. The request for opening Payment Page is sent to the payment platform.
  4. The payment platform performs initial request processing which includes validation of the required parameters and signature.
  5. In the ecommpay payment platform Payment Page is generated based on the project settings and parameters specified in the request.
  6. Payment Page is displayed to the customer.
  7. The customer selects the Promptpay method.
  8. The request for processing the payment is sent from Payment Page to the payment platform.
  9. The payment platform processes the request.
  10. The data for displaying the payment instructions to the customer is sent from the payment platform to Payment Page.
  11. The payment instructions are displayed to the customer.
  12. The customer completes all required payment steps.
  13. The payment is processed on the side of the provider service.
  14. The provider service sends a notification about the result to the payment platform.
  15. The payment platform sends the callback with the payment result to the web service.
  16. The payment platform sends the notification about the result to Payment Page.
  17. Information about the payment result is displayed to the customer on Payment Page.

The following sections provide the detailed information about the request format and the Payment Page parameters to use in the Promptpay payment method and provide the information on the format of callbacks with payment results. For the general information on how to use the API, see Payment Page API Description.

Request format

There are several things you need to consider when using the Promptpay method:

  1. You must provide values for the basic minimum of parameters. The following parameters are mandatory for any payment method:
    • project_id—the project ID obtained from ecommpay
    • payment_id—payment ID unique within the project
    • payment_currency—payment currency in ISO-4217 alpha-3 format
    • payment_amount—payment amount in minor units
    • customer_id—customer ID unique within the project
  2. The currency of payment can only be THB.
  3. If you need the payment form to open with the Payment Page method as preselected payment method, set the force_payment_method parameter to promptpay.
  4. If required, you can also add any other additional parameters Payment Page supports. All parameters available for payment processing by using the Promptpay method are provided in the Parameters for opening payment form section.
  5. After you specify all the parameters you need, you must create the signature for the request. For instructions on how to sign a payment request, see Signature generation and verification.

Thus, a correct payment request for processing purchase by using the Promptpay method must include project, customer and payment IDs, the currency and the amount of a payment in the appropriate currency, and signature, as shown in the following example:

    { payment_id: 'X03936', 
      payment_amount: 1000, 
      payment_currency: 'THB', 
      project_id: 123, 
      customer_id: 'customer1',
      signature: "kUi2x9dKHAVNU0FYldJrxh4yo+5...ZzUCwX6R\/ekpZhkIQg=="
    }

Callback format

The Promptpay method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with an information about successful 1000.00 THB purchase made by the 123 customer in the 456 project.

Figure: Example of a successful purchase callback

{
        "project_id": 456,
        "payment": {
            "id": "125",
            "type": "purchase",
            "status": "success",
            "date": "2021-02-15T10:34:21+0000",
            "method": "promptpay",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "description": ""
        },
        "customer": {
            "id": "123"
        },
        "operation": {
            "id": 76,
            "type": "sale",
            "status": "success",
            "date": "2021-02-15T10:34:21+0000",
            "created_date": "2021-02-15T10:33:59+0000",
            "request_id": "a8ee115e2c7f2f9cd69a743f...c161bf1fcde0-00000001",
            "sum_initial": {
                "amount": 100000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 100000,
                "currency": "THB"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 4821,
                "payment_id": "0123456789",
                "auth_code": "",
                "date": "2021-02-15T10:34:13+0000"
            }
        },
        "signature": "+II2IHZ3IjQcqVsIZ9oYb...atXOn2Czyo7L8g9NN1+WVtR+MGQ=="
    }
}

The following is the example of a callback for a declined purchase.

Figure: Example of a declined purchase callback

{
        "project_id": 321,
        "payment": {
            "id": "ABC456",
            "type": "purchase",
            "status": "decline",
            "date": "2021-03-11T14:01:41+0000",
            "method": "promptpay",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "description": ""
        },
        "operation": {
            "id": 123456789,
            "type": "sale",
            "status": "decline",
            "date": "2021-03-11T14:01:41+0000",
            "created_date": "2021-03-11T07:07:18+0000",
            "request_id": "09916aa29732a5e59890c409adaa1fd671...ca33-00088600",
            "sum_initial": {
                "amount": 100000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 100000,
                "currency": "THB"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 4821,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "Lk+5aUd6Hp3lR6ZRPXXA0vJ78tdwOrY80kTp...2f1ilyK1bkNrYw=="
    }
}

Related topics

The following topics might be useful when implementing payments by using Payment Page:

Purchases by using Gate. Channel 1: with redirection of the customer

General information

In the Promptpay method, when processing a purchase by using Gate, the merchant web service is required to do the following:

  1. Send a request with all the required parameters and signature to the ecommpay URL.
  2. Perform the redirection of a customer to the provider service.
  3. Get the callback with the payment result from the payment platform.

The following diagram provides the detailed picture of the payment processing procedure.



Figure: Purchase by using Gate

  1. A customer initiates a purchase through provider on the merchant's web service side.
  2. The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
  3. The payment platform receives the request for processing the purchase from Gate.
  4. The payment platform performs the initial request processing that includes validation of the required parameters and signature.
  5. The payment platform sends the response with request receipt confirmation and correctness check result to the web service. For more information, see Response format.
  6. The payment platform performs the internal purchase request processing.
  7. The payment platform sends the callback with the redirection data in the redirect_data object to the web service.
  8. The customer is redirected from the web service to the provider service.
  9. The customer completes all the payment steps required.
  10. The payment is processed on the provider side.
  11. The customer is redirected to the merchant's web service.
  12. The provider service sends the payment result notification to the payment platform.
  13. The payment platform sends a callback to the web service.
  14. The customer receives the payment result on the web service.

The sections that follow discuss in more details the request format and the Gate parameters to use in the Promptpay payment method and provide the information on the format of callbacks with purchase results.

Request format

There are several things you must consider when using purchase requests in the Promptpay method:
  1. You send purchase requests by sending the request to /v2/payment/banks/promptpay/sale by using the POST (HTTP) method. This request belongs to the following request group /v2/payment/banks/{payment_method}/sale.
  2. The following objects and parameters must be specified in any request:
    • Object general—general request identification information:
      • project_id—the project ID obtained from ecommpay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification.
    • Object payment—payment information:
      • amount—purchase amount in minor units
      • currency—purchase currency in ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—identifier
      • ip_address—customer IP address
    • Object return_url—URL for redirecting a customer from the provider website:
      • success—URL for redirecting a customer after a performed purchase
  3. The currency of purchase can only be THB.
  4. If required, you can also add any other additional parameters Gate supports.

Thus, a correct payment request in the Promptpay method must include project and payment IDs, currency and amount of the purchase, signature, identifier and IP address of the customer, as well as the URL for customer redirection, as shown in the following example:

Figure: Example of a purchase request

{
    "general": {
      "project_id": 125,
      "payment_id": "1234567",
      "signature": "GINgwlggTvpF9AnkT8rUUVC7bmSCAaQlYc9Mtb3LvE4...JChDjj40xI5vOA7w=="
    },
    "customer": {
      "id": "123",
      "ip_address": "1.1.1.1"
    },
    "payment": {
      "amount": 10000,
      "currency": "THB"
    },
    "return_url": {
      "success" : "http://example.com" 
  }
}

Formats of the customer redirection data

To redirect a customer from the web service to the provider site, you must receive a callback from the payment platform containing the URL for redirection in the redirect_data.url parameter and data to be sent in the request body in the redirect_data.body parameter, and use these parameters when opening the HTML page using the method specified in the redirect_data.method parameter.

The following is the callback fragment containing the redirection data.

    "redirect_data":{
        "url":"http://api.example.biz/MerchantTransfer",
        "method":"POST",
        "body":{
            "Reference":"2000016",
            "Amount": "58.00",
            "Merchant": "M0114",
            "Currency": "THB",
            "Key": "21312434tgdfgdjif",
            "Datetime":"2017-09-19 02:55:00PM",
            "FrontURI": "http://example.com",
            "BackURI": "http://test.example2.com",
            "Bank":"123",
            "Language": "en-us",
            "ClientIP":"183.171.94.142",
            "Customer":"tester77"
            }
         }

Callback format

The Promptpay method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with an information about successful 1000.00 THB purchase made by the 123 customer in the 382 project.

Figure: Example of a successful purchase callback

{
        "project_id": 382,
        "payment": {
            "type": "purchase",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "status": "success",
            "method": "promptpay",
            "id": "cfaf576641101077ec3440ffaf476a9d",
            "date": "2020-09-07T12:44:54+0000"
        },
        "customer": {
            "id": "123"
        },
        "operation": {
            "type": "sale",
            "sum_initial": {
                "currency": "THB",
                "amount": 100000
            },
            "sum_converted": {
                "currency": "THB",
                "amount": 100000
            },
            "status": "success",
            "request_id": "057cdba3b2b54b994a5f9c3c4080ff...fdec3b0b0be6b-00089013",
            "provider": {
                "payment_id": "079253339",
                "id": 3351,
                "date": "2020-09-07T04:44:52+0000"
            },
            "message": "Success",
            "id": 89012010009801,
            "date": "2020-09-07T12:44:54+0000",
            "created_date": "2020-09-07T12:42:17+0000",
            "code": "0"
        },
        "signature": "mwiKFBdPKMUEmDieNYeJ...w0R0GGfIBVExvubTbimclPgfx2/CY8Yq+g=="
    }
}

The following is the example of a callback for a declined purchase.

Figure: Example of a declined purchase callback

{
        "project_id": 383,
        "payment": {
            "type": "purchase",
            "sum": {
                "amount": 185384,
                "currency": "THB"
            },
            "status": "decline",
            "method": "promptpay",
            "id": "bde45cdea1ac5c4a75e2d04689a06ad4",
            "date": "2020-09-07T11:01:34+0000"
        },
        "customer": {
            "id": "456"
        },
        "operation": {
            "type": "sale",
            "sum_initial": {
                "currency": "THB",
                "amount": 185384
            },
            "sum_converted": {
                "currency": "THB",
                "amount": 185384
            },
            "status": "decline",
            "request_id": "c7d5631fdd81a4394e85d82...eb70af0e207f1a133-00085510",
            "provider": {
                "payment_id": "079243093",
                "id": 3351,
                "date": "2020-09-07T03:01:32+0000"
            },
            "message": "General decline",
            "id": 85509010009741,
            "date": "2020-09-07T11:01:34+0000",
            "created_date": "2020-09-07T10:09:31+0000",
            "code": "20000"
        },
        "signature": "FEPNq/ijls1WTCdNdz8FD1bM6kWe04AO...Lri/KEHcn/ihMSmzv/cNmQ=="
    }
}

Related topics

The following topics might be useful when implementing payments through Gate:

Purchases by using Gate. Channel 2: without redirection of the customer

General information

In the Promptpay methods, when processing a purchase by using Gate, the merchant web service is required to do the following:

  1. Send a request with all the required parameters and signature to the ecommpay URL.
  2. Display the payment instructions to the customer.
  3. Get the callback with the payment result from the payment platform.

The following diagram provides the detailed picture of the payment processing procedure.



Figure: Purchase by using Gate

  1. A customer initiates a purchase through Promptpay on the merchant's web service side.
  2. The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
  3. The payment platform receives the request for processing the purchase from Gate.
  4. The payment platform performs the initial request processing that includes validation of the required parameters and signature.
  5. The payment platform sends the response with request receipt confirmation and correctness check result to the web service. For more information, see Response format.
  6. The payment platform performs the internal payment request processing.
  7. The payment platform sends the callback with the payment instructions data to the web service.
  8. The payment instructions are displayed to the customer.
  9. The customer completes all the payment steps required.
  10. The payment is processed on the provider service side.
  11. The provider service sends the payment result notification to the payment platform.
  12. The payment platform sends a callback to the web service.
  13. The customer receives the payment result on the web service.

The sections that follow discuss in more details the request format and the Gate parameters to use in the Promptpay payment method and provide the information on the format of callbacks with purchase results.

Request format

There are several things you must consider when using purchase requests in the Promptpay method:
  1. You send purchase requests by sending the request to /v2/payment/banks/promptpay/sale by using the POST (HTTP) method. This request belongs to the following request group /v2/payment/banks/{payment_method}/sale.
  2. The following objects and parameters must be specified in any request:
    • Object general—general request identification information:
      • project_id—project ID obtained from ecommpay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification.
    • Object payment—payment information:
      • amount—purchase amount in minor units
      • currency—purchase currency in ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—customer ID unique within the project
      • ip_address—customer IP address
  3. The currency of purchase can only be THB.
  4. If required, you can also add any other additional parameters Gate supports.

Thus, a correct payment request in the Promptpay method must include project and payment IDs, currency and amount of the purchase, identifier and IP address of the customer, and signature, as shown in the following example:

Figure: Example of a purchase request

{
    "general": {
      "project_id": 125,
      "payment_id": "1234567",
      "signature": "GINgwlggTvpF9AnkT8rUUVC7bmSCAaQlYc9M...JChDjj40xI5vOA7w=="
    },
    "customer": {
      "id": "123",
      "ip_address": "1.1.1.1"
    },
    "payment": {
      "amount": 10000,
      "currency": "THB"
  }
}

Formats of data for displaying the payment instructions

To display the payment instructions to the customer, you must receive and process a callback from the payment platform containing the payment data in the in the display_data array and display the customer the payment instructions to the customer.

The array display_data contains the following parameters:

  • type—data type (the value is always qr_img)
  • title—title of the data which needs to be displayed to the customer (the value is always QR code)
  • data—string which contains the coded image of the QR code. The QR code is generated in compliance with the ISO 18004:2006 standard.

The following is the callback fragment containing the payment data.

"display_data": [
            {
                "type": "qr_img",
                "title": "QR code",
                "data": "0001101021230620016A000000677010112011505...764540510.005802TH6304XXXX"
            }
]

Callback format

The Promptpay method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with an information about successful 1000.00 THB purchase made by the 123 customer in the 456 project.

Figure: Example of a successful purchase callback

{
        "project_id": 456,
        "payment": {
            "id": "125",
            "type": "purchase",
            "status": "success",
            "date": "2021-02-15T10:34:21+0000",
            "method": "promptpay",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "description": ""
        },
        "customer": {
            "id": "123"
        },
        "operation": {
            "id": 76,
            "type": "sale",
            "status": "success",
            "date": "2021-02-15T10:34:21+0000",
            "created_date": "2021-02-15T10:33:59+0000",
            "request_id": "a8ee115e2c7f2f9cd69a743f...c161bf1fcde0-00000001",
            "sum_initial": {
                "amount": 100000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 100000,
                "currency": "THB"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 4821,
                "payment_id": "0123456789",
                "auth_code": "",
                "date": "2021-02-15T10:34:13+0000"
            }
        },
        "signature": "+II2IHZ3IjQcqVsIZ9oYb...atXOn2Czyo7L8g9NN1+WVtR+MGQ=="
    }
}

The following is the example of a callback for a declined purchase.

Figure: Example of a declined purchase callback

{
        "project_id": 321,
        "payment": {
            "id": "ABC456",
            "type": "purchase",
            "status": "decline",
            "date": "2021-03-11T14:01:41+0000",
            "method": "promptpay",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "description": ""
        },
        "operation": {
            "id": 123456789,
            "type": "sale",
            "status": "decline",
            "date": "2021-03-11T14:01:41+0000",
            "created_date": "2021-03-11T07:07:18+0000",
            "request_id": "09916aa29732a5e59890c409adaa1fd671...ca33-00088600",
            "sum_initial": {
                "amount": 100000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 100000,
                "currency": "THB"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 4821,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "Lk+5aUd6Hp3lR6ZRPXXA0vJ78tdwOrY80kTp...2f1ilyK1bkNrYw=="
    }
}

Related topics

The following topics might be useful when implementing payments through Gate:

Analysis of payments results

As with other payment methods ecommpay offers, when using the Promptpay method, you have several options to analyse the information about payments and operations performed by using the method—alone or in conjunction with other methods.

You can load and analyse all the necessary information in Dashboard, for instance you can use the analytic panels on the Analytics tab to this end.

Also, you can export the information for further analysis by using third party analytical tools. The following options are available:

  • Dashboard allows you to download reports in CSV and XLS formats—by using the tools on the Payments tab. You can perform export as a one-time download to your local computer or have payment data regularly exported and delivered to email addresses you specify.
  • Data API allows you to have payment information exported in JSON format and delivered to a URL you specify. The payment information is exported by using the /operations/get queries.

If you have any further questions regarding payment data analysis, contact ecommpay technical support.