Vietnamese QR banking
Overview
Introduction
Vietnamese QR banking is a payment method which allows to process payments in Vietnamese dongs by using bank accounts in Vietnam. A payment is credited immediately after a customer confirms the withdrawal by entering OTP or predefined payment code within secure environment of the app. This method supports purchases. 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.
This article provides information about working with the Vietnamese QR banking method: general insights are presented in the Overview section, while information about the actions required to process payments and perform other actions is presented in the sections that follow.
General information
Payment method type | QR code payments |
---|---|
Payment instruments | bank accounts |
Countries and regions | VN |
Payment currencies | VND |
Currency conversion | – |
One-time purchases | + |
Credential-on-file purchases | – |
Full refunds | to request full refund contact the ecommpay technical support |
Partial refunds | – |
Payouts | * |
Chargebacks | – |
Notes | * payouts are available for processing by using the Vietnamese Online Banking payment method |
Onboarding and access fee | refer to your ecommpay key account manager |
Interaction diagram
Payment processing by using the Vietnamese QR banking method involves the merchant's web service, one of ecommpay interfaces, the ecommpay payment platform, and technical facilities of the Vietnamese QR banking service.
Operations support
Various platform interfaces can be used to process payments and perform operations using the Vietnamese QR banking method. Purchases can be processed by using Payment Page, Gate and Dashboard (using payment links). At the same time, regardless of the interfaces used, the following limitations are applicable.
When working with the Vietnamese QR banking the following limitations are applicable.
Amounts, VND (channel 1) | Amounts, VND (channel 2) ¹ | |||
---|---|---|---|---|
minimum | maximum | minimum | maximum | |
Purchases | 2,000 | 20,000,000,000 | * | * |
- Refer to your ecommpay key account manager for more information.
Processing scenarios
To perform a purchase by using the Vietnamese QR banking method, the customer needs to scan QR code by using a mobile banking 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
Scenarios for performing operations via the main interfaces of the payment platform correspond to those presented in the diagrams. Similarly, when additional features (such as payment links) are used, scenarios for performing operations also correspond to the specifics of those features.
At the same time, the specifics of working with the method include the necessity of selecting a bank for each payment. When Payment Page is used for payment processing, the customer usually selects a bank while already in the payment form. When Payment Page is opened with the method and bank preselected as well as when payments are initiated through Gate, the bank must be selected on the side of the web service and the identifier of this bank must be specified in requests. Possible options for bank selection when working with Payment Page are described in Purchases by using Payment Page. Channel 1: without customer redirection and Purchases by using Payment Page. Channel 2: with customer redirection, ways of using bank identifiers—in the next subsection, Supported banks.
At the same time, different options for selecting a bank are supported for payments by using this method; they are described in the Purchases by using Payment Page. Channel 1: without customer redirection and Purchases by using Payment Page. Channel 2: with customer redirection sections of this article.
Supported banks
The following table lists the names and identifiers of banks supported by the Vietnamese QR banking method. Keep in mind that this list is presented for informational purposes.
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 |
Since the list of available banks may change over time, it is recommended to send a POST request to the /v2/info/banks/vietnam-qr/sale/list
endpoint to obtain up-to-date information. This endpoint belongs to the /v2/info/banks/{payment_method}/{operationType}/list group of the Gate API. The request must contain the project and payment identifiers, signature, currency code, and payment amount, as shown in the example. Specify real payment data if possible. However, random values are also allowed.
Figure: Example of data in the request for receiving the list of banks
{ "general": { "project_id": 200, "payment_id": "ORDER_155860015", "signature": "K6jllym+PtObocZtr345st...==" }, "payment": { "amount": 1000, "currency": "VND" } }
Figure: Example of data in the response containing the information about banks
[ { "id": 139, // Bank ID "abbr": "AGB", // Bank abbreviation (for internal use) "name": "AGB", // International bank name "nativeName": "Agribank", // Local bank name "currencies": [ // Array with information about the currencies supported by the bank { "id": 104, // Currency ID in the payment platform "alpha_3_4217": "VND", // ISO-4217 alphabetic currency code "number_3_4217": "704", // ISO-4217 numeric currency code "exponent": 0 // The number of decimal units of the currency } ] }, { "id": 467, "abbr": "OCB", "name": "Orient Commercial Bank (PhuongDong Bank)", "nativeName": "PhuongDong Bank", "currencies": [ { "id": 104, "alpha_3_4217": "VND", "number_3_4217": "704", "exponent": 0 } ] }, { "id": 445, "abbr": "TPB", "name": "Tien Phong Commercial Joint Stock Bank (TienPhongBank)", "nativeName": "TienPhongBank", "currencies": [ { "id": 104, "alpha_3_4217": "VND", "number_3_4217": "704", "exponent": 0 } ] } ]
If you have any questions about working with banks supported by the Vietnamese QR banking method, refer to your ecommpay account manager.
Purchases by using Payment Page. Channel 1: without customer redirection
General information
To process a purchase through Payment Page by using the Vietnamese QR banking method, the merchant's web service is required to send a request with all required parameters and signature to the ecommpay URL and receive a callback with the result. The full sequence and special aspects of purchase processing are provided below.
Figure: Purchase processing by using Payment Page: step-by-step description
- A customer initiates a purchase in the web service.
- The web service sends the request for opening Payment Page to the specified ecommpay URL.
- The request for opening Payment Page is sent to the payment platform.
- The payment platform receives the request and validates the required parameters and signature.
- Payment Page is generated based on the project and request parameters.
- Payment Page is displayed to the customer.
- The customer selects the Vietnamese QR banking method.
- The list of supported banks is displayed to the customer on the Payment Page.
- The customer selects a bank.
- The payment platform receives the request for processing the payment by using the Vietnamese QR banking method.
- The payment platform processes the request and sends it to the Vietnamese QR banking service.
- The request is processed on the Vietnamese QR banking service side.
- The data for displaying the QR code to the customer is sent from the Vietnamese QR banking service to the payment platform.
- The data for displaying the QR code to the customer is sent from the payment platform to Payment Page.
- The QR code is displayed to the customer on Payment Page.
- The customer scans QR code by using mobile application and completes all the required steps.
- The purchase is processed in the Vietnamese QR banking service.
- The Vietnamese QR banking service sends email with the payment result to the customer.
- The Vietnamese QR banking service sends a notification about the result to the payment platform.
- The payment platform sends the payment result callback to the web service.
- The payment platform sends the result information to Payment Page.
- The result information is displayed to the customer on Payment Page.
Information about the formats of requests and callbacks used for processing payments by using the Vietnamese QR banking method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in Interaction concepts.
Request format
There are several things you need to consider when using the Vietnamese QR banking method:
- The following parameters required for any payment must be specified:
project_id
—project identifier obtained from ecommpay during integrationpayment_id
—payment identifier unique within the projectpayment_currency
—payment currency code in the ISO-4217 alpha-3 formatpayment_amount
—payment amount in the smallest currency unitcustomer_id
—customer identifier unique within the project
- The following parameters required for any payment must be specified:
project_id
,payment_id
,payment_currency
,payment_amount
,customer_id
. - 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 you need to have the payment form displayed with the Vietnamese QR banking method selected, set the
force_payment_method
parameter tovietnam-banks-qr
. - Additionally, any other parameters available for working with Payment Page can be used (details).
- After all target parameters are specified, generate a signature (details).
Thus, a correct request for opening the payment form using the Vietnamese QR banking method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer identifier and signature.
{ "project_id": 120, "payment_id": "580", "payment_amount": 3 000, "payment_currency": "VND", "customer_id": "customer1", "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg==" }
Figure: Example of sufficient data in a purchase request
{ "project_id": 120, "payment_id": "580", "payment_amount": 3 000, "payment_currency": "VND", "customer_id": "customer1", "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg==" }
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 information about a 2 000 VND
purchase made in the 200
project.
Figure: Example of callback data indicating that the purchase has been processed
{ "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 with information about a declined purchase.
Figure: Example of callback data indicating that the purchase has been declined
{ "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==" } }
Useful links
The following articles can be useful when implementing purchases via Payment Page:
- Interaction concepts—about the interaction with the payment platform by using Payment Page.
- Signature generation and verification—about the procedure of generating and verifying signatures in requests and callbacks.
- Payment models and statuses—about the types, processing models, and possible statuses of supported payments and operations.
- One-time one-step purchase—about processing of one-time one-step purchases by using Payment Page.
- Information of operations performing—about error and response codes that are used in the payment platform to record information about performing of operations.
Purchases by using Payment Page. Channel 2: with customer redirection
General information
To process a purchase through Payment Page by using the Vietnamese QR banking method, the merchant's web service is required to send a request with all required parameters and signature to the ecommpay URL and receive a callback with the result. The full sequence and special aspects of purchase processing are provided below.
Figure: Purchase processing by using Payment Page: step-by-step description
- A customer initiates a purchase in the web service.
- The web service sends the request for opening Payment Page to the specified ecommpay URL.
- The request for opening Payment Page is sent to the payment platform.
- The payment platform receives the request and validates the required parameters and signature.
- Payment Page is generated based on the project and request parameters.
- Payment Page is displayed to the customer.
- The customer selects the Vietnamese QR banking method.
- The payment platform receives the request for processing the payment by using the Vietnamese QR banking method.
- The payment platform processes the request and sends it to the Vietnamese QR banking service.
- The request is processed on the Vietnamese QR banking service side.
- The data for redirecting the customer to the Vietnamese QR banking service is sent from the Vietnamese QR banking service to the payment platform.
- The data for redirecting the customer is sent from the payment platform to Payment Page.
- The customer is redirected to the Vietnamese QR banking service.
- The customer completes all required payment steps.
- The purchase is processed in the Vietnamese QR banking service.
- The result information is displayed to the customer in the Vietnamese QR banking service.
- The customer is redirected to Payment Page.
- The Vietnamese QR banking service sends a notification about the result to the payment platform.
- The payment platform sends the payment result callback to the web service.
- The payment platform sends the result information to Payment Page.
- The result information is displayed to the customer on Payment Page.
Information about the formats of requests and callbacks used for processing payments by using the Vietnamese QR banking method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in Interaction concepts.
Request format
There are several things you need to consider when using the Vietnamese QR banking method:
- The following parameters required for any payment must be specified:
project_id
—project identifier obtained from ecommpay during integrationpayment_id
—payment identifier unique within the projectpayment_currency
—payment currency code in the ISO-4217 alpha-3 formatpayment_amount
—payment amount in the smallest currency unitcustomer_id
—customer identifier unique within the project
- The following parameters required for any payment must be specified:
project_id
,payment_id
,payment_currency
,payment_amount
,customer_id
. - Additionally, it is recommended to specify the email address of the customer in the parameter
customer_email
. If this parameter is missing, the payment form may display the input field for entering the missing values (details are available in Submission of additional payment information). - If you need to have the payment form displayed with the Vietnamese QR banking method selected, set the
force_payment_method
parameter tovietnam-banks-qr
. - Additionally, any other parameters available for working with Payment Page can be used (details).
- After all target parameters are specified, generate a signature (details).
Thus, a correct request for opening the payment form using the Vietnamese QR banking method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer identifier and email address, as well as signature.
{ "project_id": 120, "payment_id": "580", "payment_amount": 3 000, "payment_currency": "VND", "customer_id": "customer1", "customer_email": "john@example.com" "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg==" }
Figure: Example of sufficient data in a purchase request
{ "project_id": 120, "payment_id": "580", "payment_amount": 3 000, "payment_currency": "VND", "customer_id": "customer1", "customer_email": "john@example.com" "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg==" }
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 information about a 300,000 VND
purchase made in the 3514
project.
Figure: Example of callback data indicating that the purchase has been processed
{ "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 with information about a declined purchase.
Figure: Example of callback data indicating that the purchase has been declined
{ "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==" }
Useful links
The following articles can be useful when implementing purchases via Payment Page:
- Interaction concepts—about the interaction with the payment platform by using Payment Page.
- Signature generation and verification—about the procedure of generating and verifying signatures in requests and callbacks.
- Payment models and statuses—about the types, processing models, and possible statuses of supported payments and operations.
- One-time one-step purchase—about processing of one-time one-step purchases by using Payment Page.
- Information of operations performing—about error and response codes that are used in the payment platform to record information about performing of operations.
Purchases by using Gate. Channel 1: without customer redirection
General information
To process a purchase through Gate by using the Vietnamese QR banking method, the merchant's web service is required to do the following:
- Send a request with all the required parameters and signature to the ecommpay URL.
- Receive an intermediate callback from the payment platform and display the QR code to the customer.
- Receive the final callback from the payment platform.
The full sequence and special aspects of purchase processing are provided below.
Figure: Purchase processing by using Gate: step-by-step description
- A customer initiates a purchase by using the Vietnamese QR banking method in the web service.
- The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
- The payment platform receives the request.
- The payment platform validates the required parameters and signature in the request.
- The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
- The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Vietnamese QR banking service.
- The request is processed on the Vietnamese QR banking service side.
- The data for displaying the QR code to the customer is sent from the Vietnamese QR banking service to the payment platform.
- The payment platform sends the callback with the data for displaying the QR code to the customer to the web service.
- The QR code is displayed to the customer on the web service side.
- The customer scans QR code by using mobile application and completes all the required steps.
- The purchase is processed in the Vietnamese QR banking service.
- 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 payment result callback to the web service.
- The customer receives the payment result information from the web service.
Information about the formats of requests and callbacks used for processing payments by using the Vietnamese QR banking method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.
Request format
There are several things you need to consider when sending purchase requests by using the Vietnamese QR banking method:
- To initiate each purchase, send a separate POST request to the
/v2/payment/banks/vietnam-qr/sale
endpoint. This endpoint belongs to the group /v2/payment/banks/{payment_method}/sale. - Each request must include the following objects and parameters:
- Object
general
—general purchase information:project_id
—project identifier obtained from ecommpay during integrationpayment_id
—payment identifier unique within the projectsignature
—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
- Object
payment
—payment information:amount
—payment amount in the smallest currency unitcurrency
—payment currency code in the ISO-4217 alpha-3 format
customer
—object that contains customer information:id
—customer identifier unique within the projectip_address
—customer IP address relevant for the initiated paymentemail
—customer email address
account
—object that contains customer account information:bank_id
—bank identifier
- Object
- 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
. - Additionally, any other parameters included in the specification can be used.
Thus, a correct purchase request by using the Vietnamese QR banking method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer and account information, URL for redirection, as well as signature.
{ "general": { "project_id": 603, "payment_id": "test_payment_1", "signature": "U5LCm6489ly9cXCKIVBT1hSXJ70zuH4==" }, "payment": { "amount": 3000, "currency": "VND" }, "account": { "bank_id": 505 }, "customer": { "email": "doe@exmaple.com", "ip_address": "192.0.2.0", "id": "customer123" } }
Figure: Example of sufficient data in a purchase request
{ "general": { "project_id": 603, "payment_id": "test_payment_1", "signature": "U5LCm6489ly9cXCKIVBT1hSXJ70zuH4==" }, "payment": { "amount": 3000, "currency": "VND" }, "account": { "bank_id": 505 }, "customer": { "email": "doe@exmaple.com", "ip_address": "192.0.2.0", "id": "customer123" } }
Formats intermediate callbacks with data to be 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=="
Final 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 information about a 2 000 VND
purchase made in the 200
project.
Figure: Example of callback data indicating that the purchase has been processed
{ "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 with information about a declined purchase.
Figure: Example of callback data indicating that the purchase has been declined
{ "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==" } }
Useful links
The following articles can be useful when implementing purchases via Gate:
- Interaction concepts—about the interaction with the payment platform by using Gate.
- Signature generation and verification—about the procedure of generating and verifying signatures in requests and callbacks.
- Payment models and statuses—about the types, processing models, and possible statuses of supported payments and operations.
- One-time one-step purchase—about processing of one-time one-step purchases by using Payment Page.
- Information of operations performing—about error and response codes that are used in the payment platform to record information about performing of operations.
Purchases by using Gate. Channel 2: with customer redirection
General information
To process a purchase through Gate by using the Vietnamese QR banking method, the merchant's web service is required to do the following:
- Send a request with all the required parameters and signature to the ecommpay URL.
- Receive an intermediate callback from the payment platform and redirect the customer to the Vietnamese QR banking service.
- Receive the final callback from the payment platform.
The full sequence and special aspects of purchase processing are provided below.
Figure: Purchase processing by using Gate: step-by-step description
- A customer initiates a purchase by using the Vietnamese QR banking method in the web service.
- The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
- The payment platform receives the request.
- The payment platform validates the required parameters and signature in the request.
- The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
- The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Vietnamese QR banking service.
- The request is processed on the Vietnamese QR banking service side.
- The Vietnamese QR banking service sends the redirection data to the payment platform.
- The payment platform sends the callback with the redirection data to the web service.
- The customer is redirected to the Vietnamese QR banking service.
- The customer completes all required payment steps.
- The purchase is processed in the Vietnamese QR banking service.
- The result is displayed to the customer.
- The customer is redirected to the web service.
- The Vietnamese QR banking service sends the payment result notification to the payment platform.
- The payment platform sends the payment result callback to the web service.
- The customer receives the payment result information from the web service.
Information about the formats of requests and callbacks used for processing payments by using the Vietnamese QR banking method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.
Request format
There are several things you need to consider when sending purchase requests by using the Vietnamese QR banking method:
- To initiate each purchase, send a separate POST request to the
/v2/payment/banks/vietnam-qr/sale
endpoint. This endpoint belongs to the group /v2/payment/banks/{payment_method}/sale. - Each request must include the following objects and parameters:
- Object
general
—general purchase information:project_id
—project identifier obtained from ecommpay during integrationpayment_id
—payment identifier unique within the projectsignature
—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
- Object
payment
—payment information:amount
—payment amount in the smallest currency unitcurrency
—payment currency code in the ISO-4217 alpha-3 format
- Object
customer
—customer information:id
—customer identifier unique within the projectip_address
—customer IP address relevant for the initiated paymentemail
—customer 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
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 processed purchase
- Object
- Additionally, any other parameters included in the specification can be used.
Thus, a correct purchase request by using the Vietnamese QR banking method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer and account information, URL for redirection, as well as signature.
{ "general": { "project_id": 211, "payment_id": "payment_id", "signature": "PJkV8ej\/UG0Di8NN5e7cV+VHq3oXW\/9MTO8yJA==" }, "payment": { "amount": 300000, "currency": "VND" }, "customer": { "id": "123", "ip_address": "192.0.2.0", "email": "john@example.com" }, "account": { "bank_id": 150 }, "return_url": { "success": "http://example.com/return" } }
Figure: Example of sufficient data in 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": "192.0.2.0", "email": "john@example.com" }, "account": { "bank_id": 150 }, "return_url": { "success": "http://example.com/return" } }
Formats of intermediate callbacks for customer redirection
Each payment made with the Vietnamese QR banking method requires redirection of customers from the merchant's web service to the Vietnamese QR banking service. To redirect a customer it is necessary to receive an intermediate callback from the payment platform and use the information included in the redirect_data
object. The format of such callbacks is standard (details), and the following objects and parameters are included in the redirect_data
object:
body
—object with data to be sent in the request bodymethod
—parameter specifying the HTTP method for sending the request (GET
orPOST
)url
—parameter containing a link for redirection
Figure: redirect_data example
"redirect_data": { "body": {}, "method": "GET", "url": "https://www.example.com/pay" }
Final 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 information about a 300,000 VND
purchase made in the 3514
project.
Figure: Example of callback data indicating that the purchase has been processed
{ "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 with information about a declined purchase.
Figure: Example of callback data indicating that the purchase has been declined
{ "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==" }
Useful links
The following articles can be useful when implementing purchases via Gate:
- Interaction concepts—about the interaction with the payment platform by using Gate.
- Signature generation and verification—about the procedure of generating and verifying signatures in requests and callbacks.
- Payment models and statuses—about the types, processing models, and possible statuses of supported payments and operations.
- One-time one-step purchase—about processing of one-time one-step purchases by using Payment Page.
- Information of operations performing—about error and response codes that are used in the payment platform to record information about performing of operations.
Analysis of payments results
To analyse information about payments made with the Vietnamese QR banking method and other methods, you can use:
- Dashboard interface toolkit with various lists and analytic panels.
- Reports in CSV file format, available via the Reports section (one-time and periodically).
- Data in JSON format, sent by program requests to a specified URL available by using the Data API interface.
If you have any questions, refer to the documentation (Dashboard and Using Data API) and ecommpay technical support.