Thailand QR banking

Overview

Thailand QR banking is a payment method which allows customers to pay by scanning standardized QR codes with mobile banking applications. This payment method is endorsed by the government of Thailand and allows the QR codes to be scanned by mobile applications of every bank in Thailand. This payment method provides a faster, more secure and reliable payment experience compared to regular online banking and is widely used within the country. Purchases can be processed by using Payment Page and Gate.

General information

Payment method type payments by using QR code
Countries and regions TH
Payment currencies THB
Currency conversion on the ECommPay side; refer to your ECommPay key account manager to enable currency conversion
Purchases +
Payouts *
Stored credentials payments
Full refunds
Partial refunds
Chargebacks
Notes
  • within the Thailand QR banking payment method, payouts are available in Thailand by using the Banks of Thailand payment method.
  • the expiration time of the QR-code on the provider side is 3 minutes.
Onboarding and access fee refer to your ECommPay key account manager

Interaction diagram

Payment processing by using the Thailand QR banking 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 Times*
Payment Page CMS Plug-ins Gate Dashboard (Old Dashboard) minimum maximum basic threshold
Purchases + + 100.00 within 1 minute
* The basic and threshold times 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 between the moment a payment is initiated in the payment platform to the moment the initiator receives the callback with the payment result. 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

In the Thailand QR banking method, to perform a purchase operation, you need to redirect customer to the provider service.

Figure: Purchase by using Payment Page



Figure: Purchase by using Gate



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

Purchases by using Payment Page

General information

In the Thailand QR banking 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 Thailand QR banking method selected. For more information about preselecting payment methods, see in Preselecting payment method. 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 Thailand QR banking 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 and sends it to the provider service.
  10. The purchase request is processed on the provider service side.
  11. The provider service generates the data for redirecting the customer to its website form and sends it to the payment platform.
  12. The payment platform sends the customer redirection data to Payment Page.
  13. The customer is redirected to the provider website.
  14. The customer completes all the payment steps required.
  15. The payment is processed on the provider side.
  16. The customer is redirected to Payment Page.
  17. The provider service sends the result notification to the payment platform.
  18. The payment platform sends a callback with the payment result to the web service.
  19. The payment platform sends the result to Payment Page.
  20. 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 Thailand QR banking 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 Thailand QR banking 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. If you need to have payment form displayed with the Thailand QR banking method selected, set the force_payment_method parameter to thai-qr.
  3. If required, you can also add any other additional parameters Payment Page supports.
  4. 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 Thailand QR banking 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 Thailand QR banking method , see Payment Page invocation parameters.

Callback format

The Thailand QR banking 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 100.00 THB purchase made by the user45 customer in the 10801 project.

Figure: Example of a successful purchase callback

{
        "project_id": 10801,
        "payment": {
            "id": "ID_343823",
            "type": "purchase",
            "status": "success",
            "date": "2020-04-30T09:13:03+0000",
            "method": "thai-qr",
            "sum": {
                "amount": 10000,
                "currency": "THB"
            },
            "description": "ID_343823"
        },
        "customer": {
            "id": "user45"
        },
        "operation": {
            "id": 46537000023131,
            "type": "sale",
            "status": "success",
            "date": "2020-04-30T09:13:03+0000",
            "created_date": "2020-04-30T09:11:58+0000",
            "request_id": "aa5b011113d2a996...2c108b2a1f984-00046538",
            "sum_initial": {
                "amount": 10000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "THB"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 2801,
                "payment_id": "2020043089025322",
                "auth_code": ""
            }
        },
        "signature": "HEQWgpV+yzSkG1QZ...Zmz9FPvJUlZ6f+/o697BE9g=="
    }

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

Figure: Example of a declined purchase callback

{
        "project_id": 10801,
        "payment": {
            "id": "ID_343824",
            "type": "purchase",
            "status": "decline",
            "date": "2020-04-30T10:13:03+0000",
            "method": "thai-qr",
            "sum": {
                "amount": 10000,
                "currency": "THB"
            },
            "description": "ID_343824"
        },
        "customer": {
            "id": "user45"
        },
        "operation": {
            "id": 46537000023131,
            "type": "sale",
            "status": "decline",
            "date": "2020-04-30T09:13:03+0000",
            "created_date": "2020-04-30T09:11:58+0000",
            "request_id": "aa5b011113d2a996...2c108b2a1f984-00046539",
            "sum_initial": {
                "amount": 10000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "THB"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 2801,
                "payment_id": "2020043089025323",
                "auth_code": ""
            }
        },
        "signature": "HEQWgpV+yzSkG1QZ...Zmz9FPvJUlZ6f+/o797BE9g=="
    }

Related topics

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

Purchases by using Gate

General information

In the Thailand QR banking 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 payment request processing and redirects the request to the Thailand QR banking service.
  7. The request is processed on the provider side.
  8. The provider service sends the data for redirecting the customer to the provider service to the payment platform.
  9. The payment platform sends the callback with the redirection data in the redirect_data object to the web service.
  10. The customer is redirected from the web service to the provider service.
  11. The customer completes all the payment steps required.
  12. The payment is processed on the provider side.
  13. The customer is redirected to the merchant's web service.
  14. The provider service sends the payment result notification to the payment platform.
  15. The payment platform sends a callback to the web service.
  16. 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 Thailand QR banking 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 Thailand QR banking method:
  1. You send purchase requests by sending the /v2/payment/banks/thai-qr/sale request 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
  3. If required, you can also add any other additional parameters Gate supports.

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

Figure: Example of a purchase request

{
    "general": {
    "project_id": 125,
    "payment_id": "ID_184",
    "signature": "PJkV8ej\/UG0Di8hTng6JvC7vQsaC6tajQVVLhNN5e7cV+VHq3L
                        wY3T\/pOMeSaRfBaNIipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 10000,
    "currency": "THB"
  },
  "customer": {
    "ip_address": "1.1.1.1",
    "id": "123"
  }
}

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": {
        "body": {
            "Data": "4dg65h72G63k68g61J6eK74I49h44i3dj41H43g50h30G30k30g33J26K43I75h73i74j49H44g3dh6dG65k72g63J68K61I6eh74i5fj31H30g26h43G75k73g74J49K50I3dh26i43j75H72g72
h3dG54k48g42J26K41I6dh6fi75j6eH74g3dh34G36k35g2eJ35K32I26h52i65j66H49g44h3dG34k30g30J30K30I30h30i30j31H30g26h54G72k61g6eJ73K54I69h6di65j3dH32g30h32G30k2dg30J34K2dI31h35i
20j31H33g3ah32G36k3ag34J33K26I52h65i74j75H72g6eh55G52k4cg3dJ68K74I74h70i3aj2fH2fg70h70G2ek74g65J72K6dI69h6ei61j6cH2eg74h65G73k74g2fJ70K72I6fh63i65j73H73g2fh63G6fk6dg70J6
cK65I74h65i2dj72H65g64h69G72k65g63J74K2fI30h66i35j62H64g36h61G30k63g75J68K73I31h37i69j34H32g6dh34G76k37g72J37K39I66h36i2fj31H30g35h65G39k63g36J61K66I38h39i66j63H33g62h64
G26k52g65J71K75I65h73i74j55H52g4ch3dG68k74g74J70K73I3ah2fi2fj65H36g61h30G31k65g63J39K2eI6eh67i72j6fH6bg2eh69G6fk2fg63J61K6cI6ch62i61j63H6bg2fh78G70k61g79J2fK26I42h61i6ej
6bH43g6fh64G65k3dg54J4dK42I2eh46i54j",
            "Remarks": "",
            "EncryptText": "8F4AC9ED17D1579A7DE5121B16A45B4F"
        },
        "method": "POST",
        "url": "http://test.com/a/payment"
    }

Callback format

The Thailand QR banking 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 100.00 THB purchase made by the user45 customer in the 10801 project.

Figure: Example of a successful purchase callback

{
        "project_id": 10801,
        "payment": {
            "id": "ID_343823",
            "type": "purchase",
            "status": "success",
            "date": "2020-04-30T09:13:03+0000",
            "method": "thai-qr",
            "sum": {
                "amount": 10000,
                "currency": "THB"
            },
            "description": "ID_343823"
        },
        "customer": {
            "id": "user45"
        },
        "operation": {
            "id": 46537000023131,
            "type": "sale",
            "status": "success",
            "date": "2020-04-30T09:13:03+0000",
            "created_date": "2020-04-30T09:11:58+0000",
            "request_id": "aa5b011113d2a996...2c108b2a1f984-00046538",
            "sum_initial": {
                "amount": 10000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "THB"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 2801,
                "payment_id": "2020043089025322",
                "auth_code": ""
            }
        },
        "signature": "HEQWgpV+yzSkG1QZ...Zmz9FPvJUlZ6f+/o697BE9g=="
    }

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

Figure: Example of a declined purchase callback

{
        "project_id": 10801,
        "payment": {
            "id": "ID_343824",
            "type": "purchase",
            "status": "decline",
            "date": "2020-04-30T10:13:03+0000",
            "method": "thai-qr",
            "sum": {
                "amount": 10000,
                "currency": "THB"
            },
            "description": "ID_343824"
        },
        "customer": {
            "id": "user45"
        },
        "operation": {
            "id": 46537000023131,
            "type": "sale",
            "status": "decline",
            "date": "2020-04-30T09:13:03+0000",
            "created_date": "2020-04-30T09:11:58+0000",
            "request_id": "aa5b011113d2a996...2c108b2a1f984-00046539",
            "sum_initial": {
                "amount": 10000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "THB"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 2801,
                "payment_id": "2020043089025323",
                "auth_code": ""
            }
        },
        "signature": "HEQWgpV+yzSkG1QZ...Zmz9FPvJUlZ6f+/o797BE9g=="
    }

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 Thailand QR banking 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.