Vietnamese QR banking
Overview
Vietnamese QR banking is one of them most convenient way for Vietnamese customers to pay via scanning QR code by using their online banking app. A payment is credited immediately after a customer confirms the withdrawal by entering OTP or predefined payment code within secure environment of the app. Purchases through this method can be performed by using Payment Page and Gate.
Purchases are processed by using two channels: with customer redirection and without. Refer to your ecommpay key account manager to learn to which channel is applicable.
General information
Payment method type | QR code payments |
---|---|
Payment instruments | bank accounts |
Countries and regions | VN |
Payment currencies | VND |
Currency conversion | – |
Purchases | + |
Payouts | * |
Stored credentials payments | – |
Full refunds | to request full refund contact the ecommpay technical support |
Partial refunds | – |
Chargebacks | – |
Notes |
|
Onboarding and access fee | refer to your ecommpay key account manager |
Interaction diagram
Payment processing by using the Vietnamese QR banking payment method requires merchant's web service, one of ecommpay interfaces, and the ecommpay payment platform, as well as Vietnamese QR banking technical facilities.
Operations support
Interfaces | Amounts, VND (channel 1) | Amounts, VND (channel 2) | ||||||
---|---|---|---|---|---|---|---|---|
Payment Page | CMS Plug-ins | Gate | Dashboard | minimum | maximum | minimum | maximum | |
Purchases | + | – | + | – | 2,000 | 20,000,000,000 | * | * |
* Refer to your ecommpay key account manager for more information.
Processing scenarios
In the Vietnamese QR banking method to perform a purchase operation customer needs to scan QR code by using bank mobile application.
Figure: Purchase by using Payment Page. Channel 1: without customer redirection
Figure: Purchase by using Payment Page. Channel 2: with customer redirection
Figure: Purchase by using Gate. Channel 1: without customer redirection
Figure: Purchase by using Gate. Channel 2: with customer redirection
Supported banks
The section provides information about the banks which are supported for payment processing in the Vietnamese QR banking method. Banks have their own IDs, which are used to initiate purchases by using Gate.
The following table contains information about banks and their IDs. The information is presented for informational purposes only, therefore for detailed information about banks and their IDs, contact your ecommpay Key Account Manager or use the /v2/info/banks/vietnam-qr/sale/list
request that belongs the /v2/info/banks/{payment_method}/{operationType}/list request group.
The request must contain the project and payment IDs, signature, currency, and payment amount, as shown in the example. It is important to specify real payment data, but if the payment has not yet been generated, you can specify a random value for the payment ID in the request.
Figure: Example of requesting a list of banks
{ "general": { "project_id": 200, "payment_id": "ORDER_155860015", "signature": "K6jllym+PtObocZtr345st...==" }, "payment": { "amount": 1000, "currency": "VND" } }
Bank | ID |
---|---|
Agribank | 139 |
An Binh Commercial Joint Stock Bank (ABBANK) | 465 |
Bac A Commercial Joint Stock Bank (Bac A Bank) | 439 |
Bank for Investment and Development of Vietnam | 136 |
Eximbank Vietnam | 135 |
Indovina Bank Ltd. (IVB) | 569 |
Joint Stock Commercial Bank for Foreign Trade of Vietnam | 133 |
Military JSC Bank (MB) | 447 |
Nam A commercial joint stock bank (NamABank) | 452 |
Nam Viet Bank (NaviBank) | 441 |
Orient Commercial Bank (PhuongDong Bank) | 467 |
Saigon Hanoi Commercial Joint Stock Bank (SHB) | 451 |
Sai Gon Joint Stock Commercial Bank (SCB) | 460 |
Tien Phong Commercial Joint Stock Bank (TienPhongBank) | 445 |
VietinBank | 134 |
Vietnam International Bank | 138 |
Vietnam Maritime Commercial Joint Stock Bank (MaritimeBank) | 440 |
Vietnam Prosperity Bank (VPBank) | 449 |
WeChat Pay | 570 |
Bank | ID |
---|---|
Bank for Investment and Development of Vietnam | 136 |
Tien Phong Commercial Joint Stock Bank (TienPhongBank) | 445 |
Vietcombank | 133 |
Vietnam Prosperity Bank (VPBank) | 449 |
Asia Commercial Bank | 150 |
The sections that follow provide detailed information about what you need to perform payments and how you can analyze the information on payments and operations.
Purchase by using Payment Page. Channel 1: without customer redirection
General information
In the Vietnamese QR banking method, to perform 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 Vietnamese QR banking 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 sequence in the Payment Page method:
- Customer initiates purchase by using the web service.
- The merchant web service sends to the specified ecommpay URL the purchase request for processing the purchase by using Payment Page.
- The payment platform receives the request for processing the purchase by using Payment Page.
- The payment platform performs the initial request processing that involves validation of the required parameters and signature.
- Requested Payment Page is generated into the ecommpay payment platform as specified in the project settings and the request parameters.
- Payment Page is displayed to the customer.
- The customer selects the Vietnamese QR banking payment method and agrees to use the method (or accepts the method already selected on Payment Page and agrees).
- The list of supported banks is displayed to the customer on the Payment Page.
- The customer selects bank.
- The payment platform receives the purchase request for payment processing in the Vietnamese QR banking service.
- The payment platform performs the internal purchase request processing and sends it to the Vietnamese QR banking service.
- The purchase request is processed on the Vietnamese QR banking side.
- The Vietnamese QR banking service generates the data for the displaying QR code to the customer and sends it to the payment platform.
- The payment platform sends to Payment Page the data for the displaying QR code to the customer.
- The QR code is displayed to the customer on Payment Page.
- The customer scans QR code by using mobile application of the bank and completes all the required steps.
- The payment is processed on the Vietnamese QR banking side.
- Vietnamese QR banking service sends email with the payment result to the customer.
- Vietnamese QR banking service sends the payment result notification to the payment platform.
- The payment platform sends the callback to the web service.
- The payment platform sends payment results to Payment Page.
- A page with the payment result information is displayed to the customer.
The sections that follow discuss in more details the request format and the Payment Page parameters to use in the Vietnamese 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 Vietnamese QR banking method:
- 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 ecommpaypayment_id
—payment ID unique within the projectpayment_currency
—payment currency in ISO-4217 alpha-3 formatpayment_amount
—payment amountcustomer_id
—customer ID unique within the project
- The currency of payment can only be VND.
- If you need to have payment form displayed with the Vietnamese QR banking method selected, set the
force_payment_method
parameter tovietnam-banks-qr
. - Additionally it is possible to set the language (English or Vietnamese) of the email with the payment result. By default the Vietnamese language is used. To change it to English, pass
en
in the parametercustomer.language
. - If required, you can also add any other additional parameters Payment Page supports.
- 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 Vietnamese QR banking method must include project, customer, and payment IDs, the currency and the amount of a payment in the appropriate currency, as shown in the following example:
EPayWidget.run( { project_id: 0, payment_id: 'X03936', customer_id: 'user123', payment_amount: 3 000, payment_currency: 'VND', customer_id: 'customer1', signature: "kUi2x9dKHAVNU0FYldJrxh4yo+52Kt8KU+Y1Y4HASCQ9vySO\/RL CvhtT4DqtVUkDJrOcZzUCwX6R\/ekpZhkIQg==" } )
For information about all parameters available in the Vietnamese QR banking method, see Parameters for opening payment form.
Callback format
The Vietnamese 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 2 000 VND
purchase made by the 1
customer in the 200
project.
Figure: Example of a successful purchase callback
{ "project_id": 200, "payment": { "id": "TEST_1561223423_VND1", "type": "purchase", "status": "success", "date": "2019-07-01T07:54:16+0000", "method": "Vietnam banks-qr", "sum": { "amount": 2000, "currency": "VND" }, "description": "TEST_1561714332889" }, "customer": { "id": "1", "phone": "0914695523" }, "operation": { "id": 39811000003358, "type": "sale", "status": "success", "date": "2019-07-01T07:54:16+0000", "created_date": "2019-07-01T07:53:19+0000", "request_id": "1fb651fe71b5db9db3d6382c995c8f51b08785ff", "sum_initial": { "amount": 2000, "currency": "VND" }, "sum_converted": { "amount": 2000, "currency": "VND" }, "provider": { "id": 1283, "payment_id": "56366711", "auth_code": "", "endpoint_id": "TCB" }, "code": "0", "message": "Success" }, "signature": "YreiJ0aXQgDVuo74tsBXpZ8tmJi0IRVCyFucJ1aYk4mjybiVRcd/0M iUb8E9twm5IDxiZ8C2sqcuuncjkbazWKg==" } }
The following is the example of a callback for a purchase declined due to amount limit.
Figure: Example of a declined purchase callback
{ "project_id": 200, "payment": { "id": "TEST_1561223423_VND1", "type": "purchase", "status": "decline", "date": "2019-07-01T07:54:16+0000", "method": "Vietnam banks-qr", "sum": { "amount": 1000, "currency": "VND" }, "description": "TEST_1561714332889" }, "customer": { "id": "1", "phone": "0914695523" }, "operation": { "id": 39811000003358, "type": "sale", "status": "success", "date": "2019-07-01T07:54:16+0000", "created_date": "2019-07-01T07:53:19+0000", "request_id": "1fb651fe71b5db9db3d6382c995c8f51b08785ff", "sum_initial": { "amount": 1000, "currency": "VND" }, "sum_converted": { "amount": 1000, "currency": "VND" }, "provider": { "id": 1283, "payment_id": "56366711", "auth_code": "", "endpoint_id": "TCB" }, "code": "20101", "message": "Decline due to amount or frequency limit" }, "signature": "YreiJ0aXQgDVuo74tsBXpZ8tmJi0IRVCyFucJ1aYk4mjybiVRcd/0M iUb8E9twm5IDxiZ8C2sqcuuncjkbazWKg==" } }
Related topics
The following topics might be useful when implementing payments by using Payment Page:
Purchase by using Payment Page. Channel 2: with customer redirection
General information
In the Vietnamese 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 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
- A customer initiates a purchase on the merchant's web service.
- The web service sends the request for Payment Page opening to the specified ecommpay URL.
- The request for opening is redirected to the payment platform.
- The payment platform performs the initial request processing that involves validation of the required parameters and signature.
- Requested Payment Page is generated into the ecommpay payment platform as specified in the project settings and the request parameters.
- Payment Page is displayed to the customer.
- The customer selects the Vietnamese QR banking method and, depending on the payment processing provider, selects a bank for purchasing.
- The payment platform receives the purchase request for payment processing from Payment Page.
- The payment platform performs the internal purchase request processing and sends it to the Vietnamese QR banking service.
- The purchase request is processed on the Vietnamese QR banking service side.
- The Vietnamese QR banking service generates the data for redirecting the customer to its website form and sends it to the payment platform.
- The payment platform sends the customer redirection data to Payment Page.
- The customer is redirected to the Vietnamese QR banking website.
- The customer completes all the payment steps required.
- The payment is processed on the Vietnamese QR banking side.
- The result is displayed to the customer on the Vietnamese QR banking website.
- The customer is redirected to Payment Page.
- The Vietnamese QR banking service sends the result notification to the payment platform.
- The payment platform sends a callback with the payment result to the web service.
- The payment platform sends the result to Payment Page.
- 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 Vietnamese 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 Vietnamese QR banking method:
- 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
- customer_id—the ID of the customer within the project
- Depending on the payment processing provider, it is recommended to specify the email address of the customer in the customer_email additional parameter. If the request is missing the parameter, on Payment Page the additional field is displayed to the customer to input missing data. For more details about clarification, see Submission of additional payment information.
- If you need to have payment form displayed with the Vietnamese QR banking method selected, set the force_payment_method parameter to
vietnam-banks-qr
. - If required, you can also add any other additional parameters Payment Page supports.
- 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 Vietnamese QR banking method must include project, customer, and payment IDs, the currency and the amount of a payment in the appropriate currency, customer information and signature, as shown in the following example:
EPayWidget.run( { payment_id: 'X03936', payment_amount: 300000, payment_currency: 'VND', project_id: 214, customer_id: 'customer1', customer_email: 'john@example.com' signature: "kUi2x9dKHAVNU0FYldJrxhRLCvhtT4DqtVUkDJrOcZzUCwX6R\/ekpZhkIQg==" } )
For information about all parameters available in the Vietnamese QR banking method, see Parameters for opening payment form.
Callback format
The Vietnamese 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 300,000 VND
purchase made in the 3514
project.
Figure: Example of a successful purchase callback
{ "project_id": 3514, "payment": { "id": "EPd3f4-9b1a", "type": "purchase", "status": "success", "date": "2020-11-06T13:16:50+0000", "method": "Vietnam banks-qr", "sum": { "amount": 300000, "currency": "VND" }, "description": "" }, "customer": { "id": "123" }, "operation": { "id": 233, "type": "sale", "status": "success", "date": "2020-11-06T13:16:50+0000", "created_date": "2020-11-06T13:16:36+0000", "request_id": "3fe344d57e581a37b16ddd8e7507a65f5bef7dfaafc-00000001", "sum_initial": { "amount": 300000, "currency": "VND" }, "sum_converted": { "amount": 300000, "currency": "VND" }, "code": "0", "message": "Success", "provider": { "id": 2673, "payment_id": "160466859929", "auth_code": "" } }, "signature": "fF9J+3OdjdGux9liAxvDk5/Fublg9sMqOvypzgcMLZXG09ptOg==" }
The following is the example of a callback for a declined purchase.
Figure: Example of a declined purchase callback
{ "project_id": 3514, "payment": { "id": "EP9ab9-a3a4", "type": "purchase", "status": "decline", "date": "2020-11-06T13:26:48+0000", "method": "Vietnam banks-qr", "sum": { "amount": 350000, "currency": "VND" }, "description": "" }, "customer": { "id": "456" }, "operation": { "id": 236, "type": "sale", "status": "decline", "date": "2020-11-06T13:26:48+0000", "created_date": "2020-11-06T13:26:33+0000", "request_id": "2e084e9b6736091b032a78b86d6fbc46b18431-00000001", "sum_initial": { "amount": 350000, "currency": "VND" }, "sum_converted": { "amount": 350000, "currency": "VND" }, "code": "20000", "message": "General decline", "provider": { "id": 2673, "payment_id": "160466919625", "auth_code": "" } }, "signature": "H8F+m5SL3ZxjnzCrsvjPSqQ203NfvL5dXP50qJUXTOqqgKkHZA==" }
Related topics
The following topics might be useful when implementing payments by using Payment Page:
Purchase by using Gate. Channel 1: without customer redirection
General information
In the Vietnamese QR banking method, when processing a purchase by using Gate, the merchant web service is required to do the following:
- Send a request with all the required parameters and signature to the ecommpay URL.
- Provide the displaying of the QR code on the web service side.
- 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
- Customer initiates purchase on the merchant web service by using Vietnamese QR banking method.
- The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
- The payment platform receives the request for processing the purchase by using Gate.
- The payment platform performs the initial request processing that includes validation of the required parameters and signature.
- The payment platform sends to the web service response with request receipt confirmation and correctness check result.
- The payment platform performs the internal payment request processing and sends it to the Vietnamese QR banking service.
- The purchase request is processed on the Vietnamese QR banking side.
- The Vietnamese QR banking service generates the data for the displaying QR code to the customer and sends it to the payment platform.
- The payment platform sends to the web service the callback that delivers the data for the displaying QR code to the customer.
- The QR code is displayed to the customer on the web service side.
- The customer scans QR code by using mobile application of the bank and completes all the required steps.
- The payment is processed on the Vietnamese QR banking side.
- The Vietnamese QR banking service sends email with the payment result to the customer.
- The Vietnamese QR banking service sends the payment result notification to the payment platform.
- The payment platform sends the callback to the web service.
- The customer receives the payment result from the web service.
The sections that follow discuss in more details the request format and the Gate parameters to use in the Vietnamese 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 Vietnamese QR banking method:- You perform a purchase by sending the request to
/v2/payment/banks/vietnam-qr/sale
by using HTTP method POST. This is a bank payment request group /v2/payment/banks/{payment_method}/sale - The following objects and parameters must be specified in any request:
general
—object that contains general request identification information:project_id
—the project ID obtained from ecommpaypayment_id
—payment ID unique within the projectsignature
—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification);
payment
—object that contains customer information:amount
—purchase amountcurrency
—purchase currency in ISO-4217 alpha-3 format
customer
—object that contains customer information:id
—the ID of the customer within the merchant projectemail
—email addressip_address
—IP address
account
—object that contains customer account information:bank_id
—bank identifier
- The currency of payment can only be VND.
- Additionally it is possible to set the language (English or Vietnamese) of the email with the payment result. By default the Vietnamese language is used. To change it to English, pass
en
in the parametercustomer.language
. - If required, you can also add any other additional parameters Gate supports.
- 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 Vietnamese QR banking method must include project and payment IDs, currency and amount of the purchase, customer ID, email, and IP address, bank identifier, as shown in the following example:
Figure: Example of a purchase request
{ "general": { "project_id": 603, "payment_id": "test_payment_1", "signature": "U5LCm6489ly9cXCKIVBNV0mFr4XiCruECSyQEbT1hSXJ70zuH...==" }, "payment": { "amount": 3000, "currency": "VND" }, "account": { "bank_id": 505 }, "customer": { "email": "Betelgeuse@gmail.com", "ip_address": "248.121.176.220", "id": "123" } }
Formats of the data displayed to customers
To complete the payment, customers must get the payment QR code from you. The QR code data is sent in the callback from the payment platform in the qr_code parameter as an image encoded in Base64. Therefore, before displaying the QR code, you need to accept and process such callback.
This callback is sent from the ecommpay payment platform to the URL specified in the merchant project settings to get the final result not an asynchronous response, as in case with customer redirection data. The payment status in this callback is awaiting customer action until the payment is completed by the customer.
The following is the callback fragment containing payment QR code data.
"qr_code": "iVBORw0KGgoAAAANSUhEUgAAAG8AAABvAQMAAADYCwwjAAAABlBMVEX/// 8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABG0lEQVQ4jdXTsY3FIAwGYCMXdLBApKxBx0qZ4AILJCvRsQYSC7x0FCg +J3l3rwPahyj4CiT7lw3wjUcTOYNOIlHqUgH6MIHMDgZo8yZhMbiXIfpQweZxa\nsIhAjqbD/oU2SD3u5nM97/9Bq/vEnT8hNm gLnRCEjQ7M8JJxwqG/N1CmyLMGycTcLN98l9R6CBY3lW1qCw5ixToNUDBJTFL9nc4HRaiMimT9AB1TBzjGuHnKbJJZWcfkgj4k qlL4AmUlcN3tk8l8bwmsC6yTxEnHcgH3og+lcEj8ooRxT7vLvDkcEqf18TCpCTvWp+8C3vk8JMOA7yX8ZnbEXqqa+HHEHfK\nG 8AaBshVcZKxPovWJve7E4eZlr/2G/y+8wt5N/rpIH9KkwAAAABJRU5ErkJggg=="
Callback format
The Vietnamese 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 2 000 VND
purchase made by the 1
customer in the 200
project.
Figure: Example of a successful purchase callback
{ "project_id": 200, "payment": { "id": "TEST_1561223423_VND1", "type": "purchase", "status": "success", "date": "2019-07-01T07:54:16+0000", "method": "Vietnam banks-qr", "sum": { "amount": 2000, "currency": "VND" }, "description": "TEST_1561714332889" }, "customer": { "id": "1", "phone": "0914695523" }, "operation": { "id": 39811000003358, "type": "sale", "status": "success", "date": "2019-07-01T07:54:16+0000", "created_date": "2019-07-01T07:53:19+0000", "request_id": "1fb651fe71b5db9db3d6382c995c8f51b08785ff", "sum_initial": { "amount": 2000, "currency": "VND" }, "sum_converted": { "amount": 2000, "currency": "VND" }, "provider": { "id": 1283, "payment_id": "56366711", "auth_code": "", "endpoint_id": "TCB" }, "code": "0", "message": "Success" }, "signature": "YreiJ0aXQgDVuo74tsBXpZ8tmJi0IRVCyFucJ1aYk4mjybiVRcd/0M iUb8E9twm5IDxiZ8C2sqcuuncjkbazWKg==" } }
The following is the example of a callback for a purchase declined due to amount limit.
Figure: Example of a declined purchase callback
{ "project_id": 200, "payment": { "id": "TEST_1561223423_VND1", "type": "purchase", "status": "decline", "date": "2019-07-01T07:54:16+0000", "method": "Vietnam banks-qr", "sum": { "amount": 1000, "currency": "VND" }, "description": "TEST_1561714332889" }, "customer": { "id": "1", "phone": "0914695523" }, "operation": { "id": 39811000003358, "type": "sale", "status": "success", "date": "2019-07-01T07:54:16+0000", "created_date": "2019-07-01T07:53:19+0000", "request_id": "1fb651fe71b5db9db3d6382c995c8f51b08785ff", "sum_initial": { "amount": 1000, "currency": "VND" }, "sum_converted": { "amount": 1000, "currency": "VND" }, "provider": { "id": 1283, "payment_id": "56366711", "auth_code": "", "endpoint_id": "TCB" }, "code": "20101", "message": "Decline due to amount or frequency limit" }, "signature": "YreiJ0aXQgDVuo74tsBXpZ8tmJi0IRVCyFucJ1aYk4mjybiVRcd/0M iUb8E9twm5IDxiZ8C2sqcuuncjkbazWKg==" } }
Related topics
The following topics might be useful when implementing payments through Gate:
Purchase by using Gate. Channel 2: with customer redirection
General information
In the Vietnamese QR banking method, when processing a purchase by using Gate, the merchant web service is required to do the following:
- Send a request with all the required parameters and signature to the ecommpay URL.
- Perform the redirection of a customer to the Vietnamese QR banking service.
- 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
- A customer initiates a purchase through Vietnamese QR banking on the merchant's web service side.
- The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
- The payment platform receives the request for processing the purchase from Gate.
- The payment platform performs the initial request processing that includes validation of the required parameters and signature.
- The payment platform sends the response with request receipt confirmation and correctness check result to the web service. For more information, see Response format.
- The payment platform performs the internal payment request processing and redirects the request to the Vietnamese QR banking service.
- The request is processed on the Vietnamese QR banking side.
- The Vietnamese QR banking service sends the data for redirecting the customer to the Vietnamese QR banking service to the payment platform.
- The payment platform sends the callback with the redirection data in the redirect_data object to the web service.
- The customer is redirected from the web service to the Vietnamese QR banking service.
- The customer completes all the payment steps required.
- The payment is processed on the Vietnamese QR banking side.
- The result is displayed to the customer.
- The customer is redirected to the merchant's web service.
- The Vietnamese QR banking service sends the payment result notification to the payment platform.
- The payment platform sends a callback to the web service.
- 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 Vietnamese 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 Vietnamese QR banking method:- You perform purchases by sending the request by using POST (HTTP) method to the
/v2/payment/banks/vietnam-qr/sale
endpoint. This endpoint belongs to the following group: /v2/payment/banks/{payment_method}/sale. - 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 customer—customer information:
- id—the unique ID of the customer within your project
- ip_address—customer IP address
- email—email address (depending on the payment processing provider the parameter may not be mandatory, for more information refer to your ecommpay key account manager)
- Object payment—payment information:
- amount—purchase amount
- currency—purchase currency in ISO-4217 alpha-3 format
- Object account—recipient account information:
- bank_id—bank identifier (depending on the payment processing provider the parameter may not be mandatory, for more information refer to your ecommpay key account manager)
- Object return_url—contains the URLs to which customer is redirected after payment processing:
- success—URL to return customer to the web service after a successful purchase
- Object general—general request identification information:
- If required, you can also add any other additional parameters Gate supports.
Thus, a correct payment request in the Vietnamese QR banking method must include project, customer and payment IDs, customer information, signature, currency and amount of the purchase, as shown in the following example:
Figure: Example of a purchase request
{ "general": { "project_id": 211, "payment_id": "payment_id", "signature": "PJkV8ej\/UG0Di8NN5e7cV+VHq3oXW\/9MTO8yJA==" }, "payment": { "amount": 300000, "currency": "VND" }, "customer": { "id": "123", "ip_address": "1.1.1.1", "email": "john@example.com" }, "account": { "bank_id": 150 }, "return_url": { "success": "http://example.com/return" } }
Formats of the customer redirection data
To redirect a customer from the web service to the Vietnamese QR banking 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.
{ "body": [...], "method": "POST", "url": "http://example.com/redirect" }
Callback format
The Vietnamese 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 300,000 VND
purchase made in the 3514
project.
Figure: Example of a successful purchase callback
{ "project_id": 3514, "payment": { "id": "EPd3f4-9b1a", "type": "purchase", "status": "success", "date": "2020-11-06T13:16:50+0000", "method": "Vietnam banks-qr", "sum": { "amount": 300000, "currency": "VND" }, "description": "" }, "customer": { "id": "123" }, "operation": { "id": 233, "type": "sale", "status": "success", "date": "2020-11-06T13:16:50+0000", "created_date": "2020-11-06T13:16:36+0000", "request_id": "3fe344d57e581a37b16ddd8e7507a65f5bef7dfaafc-00000001", "sum_initial": { "amount": 300000, "currency": "VND" }, "sum_converted": { "amount": 300000, "currency": "VND" }, "code": "0", "message": "Success", "provider": { "id": 2673, "payment_id": "160466859929", "auth_code": "" } }, "signature": "fF9J+3OdjdGux9liAxvDk5/Fublg9sMqOvypzgcMLZXG09ptOg==" }
The following is the example of a callback for a declined purchase.
Figure: Example of a declined purchase callback
{ "project_id": 3514, "payment": { "id": "EP9ab9-a3a4", "type": "purchase", "status": "decline", "date": "2020-11-06T13:26:48+0000", "method": "Vietnam banks-qr", "sum": { "amount": 350000, "currency": "VND" }, "description": "" }, "customer": { "id": "456" }, "operation": { "id": 236, "type": "sale", "status": "decline", "date": "2020-11-06T13:26:48+0000", "created_date": "2020-11-06T13:26:33+0000", "request_id": "2e084e9b6736091b032a78b86d6fbc46b18431-00000001", "sum_initial": { "amount": 350000, "currency": "VND" }, "sum_converted": { "amount": 350000, "currency": "VND" }, "code": "20000", "message": "General decline", "provider": { "id": 2673, "payment_id": "160466919625", "auth_code": "" } }, "signature": "H8F+m5SL3ZxjnzCrsvjPSqQ203NfvL5dXP50qJUXTOqqgKkHZA==" }
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 Vietnamese 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.