Vietnamese OTC (cash payments)
Overview
Vietnamese OTC is a payment method with in-store cash payments – a customer orders goods and services online, and completes the payment offline by printing a receipt or taking a reference number to a closest post office. Post offices that support these payments include Viettel post and Vietnam post making it a convenient way to pay for many Vietnamese customers. You can perform purchases through this method by using Payment Page and Gate.
General information
Payment method type | point of sale payments |
---|---|
Payment instruments | cash |
Countries and regions | VN |
Payment currencies | VND |
Currency conversion | – |
Purchases | + |
Payouts | – |
Stored credentials payments | – |
Full refunds | – |
Partial refunds | – |
Chargebacks | – |
Notes | – |
Onboarding and access fee | Refer to the ecommpay key account manager |
Interaction diagram
Payment processing by using the Vietnamese OTC payment method requires merchant's web service, one of ecommpay interfaces, and the ecommpay payment platform, as well as provider's the technical facilities.
Operations support
Interfaces | Amounts, VND | |||||
---|---|---|---|---|---|---|
Payment Page | CMS Plug-ins | Gate | Dashboard | minimum | maximum | |
Purchases | + | – | + | – | * | 20,000,000,000 |
* Viettel Post—10,000 VND and Vietnam Post—20,000 VND.
Processing scenarios
In the Vietnamese OTC method, to perform a purchase operation, customer needs to pay by cash in chosen post office (Viettel Post or Vietnam Post).
Figure: Purchase by using Payment Page procedure diagram
Figure: Payout by using Gate procedure diagram
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 Vietnamese OTC 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 OTC 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:
- 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 Vietnam convenience store method.
- The list of supported post offices is displayed to the customer (Viettel Post and Vietnam Post).
- The customer selects post office.
- 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 OTC service.
- The purchase request is processed on the Vietnamese OTC service side.
- The Vietnamese OTC service generates the data for displaying payment instruction and sends it to the payment platform.
- The payment platform sends the data for displaying payment instruction to Payment Page.
- The payment instruction is displayed to the customer on Payment Page.
- The customer completes all the payment steps required.
- The payment is processed on the Vietnamese OTC side.
- The customer receives email with the payment result from the Vietnamese OTC service.
- The Vietnamese OTC 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 OTC 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 OTC 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 OTC method selected, set the
force_payment_method
parameter tovietnam-cash
. - 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 OTC method must include project and payment IDs, the currency and the amount of a payment in the appropriate currency, as shown in the following example:
EPayWidget.run( { payment_id: 'X03936', payment_amount: 2000, payment_currency: 'VND', project_id: 100, customer_id: 'customer1', signature: "pu654sjhddKHAVNU0FYldJrxh4yo+52Kt8KU+Y1Y4HASCQ9vySO...==" } )
For information about all parameters available in the Vietnamese OTC method, see Parameters for opening payment form.
Callback format
The Vietnamese OTC 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 20 000 VND
purchase made by the 1
customer in the 200
project.
Figure: Example of a successful purchase callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_15623", "type": "purchase", "status": "success", "date": "2019-07-01T08:47:06+0000", "method": "Cash Vietnam", "sum": { "amount": 20000, "currency": "VND" }, "description": "nganluongtest3.2" }, "customer": { "id": "1", "phone": "0914695523" }, "operation": { "id": 34299000003322, "type": "sale", "status": "success", "date": "2019-07-01T08:47:06+0000", "created_date": "2019-07-01T08:16:21+0000", "request_id": "f8c9775367975429d914c019591e349308ffb199d7916c434c90805", "sum_initial": { "amount": 20000, "currency": "VND" }, "sum_converted": { "amount": 20000, "currency": "VND" }, "provider": { "id": 1284, "payment_id": "56368817", "auth_code": "", "endpoint_id": "VIETTELPOST" }, "code": "0", "message": "Success" }, "signature": "OCa7bOyjNbaxVUvtgSxNfvVlQI5gWNY4k7WIB0AyGpxD sdGFknCiLwqopvPs8GZprj7/4c1a6n3n0QRIvv25Fg==" } }
The following is the example of a callback for a purchase declined due to time-out of the request.
Figure: Example of a declined purchase callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_15619", "type": "purchase", "status": "decline", "date": "2019-07-01T07:40:36+0000", "method": "Cash Vietnam", "sum": { "amount": 2000, "currency": "VND" }, "description": "nganluongtest3.2" }, "customer": { "id": "1" }, "operation": { "id": 39901000003337, "type": "sale", "status": "decline", "date": "2019-07-01T07:40:36+0000", "created_date": "2019-07-01T07:40:33+0000", "request_id": "3588d3f8fd252b3cabf1af779dfd3e4867d83e2242eba6e6d148", "sum_initial": { "amount": 2000, "currency": "VND" }, "sum_converted": { "amount": 2000, "currency": "VND" }, "provider": { "id": 1284, "payment_id": "", "auth_code": "" }, "code": "20602", "message": "Time-out" }, "signature": "jqTBt8VV8UhK63525hwW9dspYAqUJGLq6GwqIXuvLTmU3Mo DrxZk6/lYm8cPuF/4N14kS3LWfSjCRdrKcaL6Gg==" } }
Related topics
The following topics might be useful when implementing payments by using Payment Page:
Purchases by using Gate
General information
In the Vietnamese OTC methods, 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.
- Ensure the displaying of the payment instruction to the customer.
- 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 OTC 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 OTC service.
- The request is processed on the Vietnamese OTC side.
- The Vietnamese OTC service sends the data for displaying payment instruction to the payment platform.
- The payment platform sends the callback with the data for displaying payment instruction in the external_data object to the web service.
- The payment instruction is displayed to the customer on the web service side.
- The customer completes all the payment steps required.
- The payment is processed on the Vietnamese OTC side.
- The customer receives email with the payment result from the Vietnamese OTC service.
- The Vietnamese OTC 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 OTC 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 OTC method:- You send purchase requests by sending the
/v2/payment/cash/vietnam/sale
request by using HTTP method POST. This is a cash payment request group: /v2/payment/cash/{payment_method}/sale. - The following objects and parameters must be specified in any request:
general
—general purchase information:project_id
—project identifierpayment_id
—unique purchase identifiersignature
—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification
customer
—customer information:id
—the ID of the customer within the merchant projectemail
—email addressip_address
—customer IP address
account
—post office information:bank_id
—post office identifier (Viettel post—571
, Vietnam Post—572
);
payment
—purchase information:amount
—purchase amountcurrency
—purchase currency in the ISO-4217 alpha-3 format.
- The currency of purchase 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 OTC method must include project and payment IDs, customer ID, email and IP-address, post office identifier, currency and amount of the purchase, as shown in the following example:
Figure: Example of a purchase request
{ "general": { "project_id": 603, "payment_id": "test_payment_1", "signature": "U585Cm6489ly9cXCKIVBNV0mFr4XiCruECSyQEbT1hSXJ70zu H4s05cFDqLks8ZJMR6iNdlUtm1EdHHdA3D19Qg==" }, "payment": { "amount": 3000, "currency": "VND" }, "account": { "bank_id": 571 }, "customer": { "email": "test@gmail.com", "ip_address": "248.121.176.220", "id": "123" } }
Formats of the customer instructions data
To complete the payment, customers must get the payment instructions from you. To display the instructions, you need to receive a callback from the payment platform containing the provider_extra_fields object with the necessary data:
- support_message—HTML-code with instructions
- cashin_id—payment instructions number
Therefore, before displaying the instructions, you need to accept and process such callback.
The following is the callback fragment containing instructions data.
"provider_extra_fields": {
"support_message": ""<b>HƯỚNG DẪN THANH TOÁN TIỀN MẶT TẠI QUẦY VNPOST</b><br/>\n<b>Bước 1:
Ghi nhớ \"mã giao dịch\" và \"tổng số tiền thanh toán\".</b><br/>\nBạn hãy ghi nhớ thông
tin dưới đây trước khi ra quầy giao dịch của <b>VNPOST</b><br/>\n- Mã giao dịch:
<b>16701876</b><br/>\n- Số tiền thanh toán: <b>1000 VND</b><br/> \n- Nội dung thanh
toán: <b> Thanh toán cho phiếu thu 16701876</b><br/>\n<b>Bước 2: Nộp tiền mặt tại
quầy giao dịch VNPOST</b><br/>\nBạn báo với nhân viên thu ngân, sử dụng dịch vụ
<b>VNPOST - Thu hộ NGANLUONG</b>. Sau đó khai báo Mã giao dịch, xác nhận khoản tiền
cần thanh toán, thực hiện nộp đủ số tiền trên cho nhân viên thu ngân.\nNgay khi nhân
viên thu ngân xác thực thanh toán thành công, giao dịch trên hệ thống Ngân Lượng của
bạn sẽ chuyển trạng thái thành công và thông báo cho người nhận.<br/>\n<b></b>",
"cashin_id": "16701876"
}
Callback format
The Vietnamese OTC 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 20,000 VND
purchase made by the 1
customer in the 200
project.
Figure: Example of a successful purchase callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_15623", "type": "purchase", "status": "success", "date": "2019-07-01T08:47:06+0000", "method": "Cash Vietnam", "sum": { "amount": 20000, "currency": "VND" }, "description": "nganluongtest3.2" }, "customer": { "id": "1", "phone": "0914695523" }, "operation": { "id": 34299000003322, "type": "sale", "status": "success", "date": "2019-07-01T08:47:06+0000", "created_date": "2019-07-01T08:16:21+0000", "request_id": "f8c9775367975429d914c019591e349308ffb199d7916c434c90805", "sum_initial": { "amount": 20000, "currency": "VND" }, "sum_converted": { "amount": 20000, "currency": "VND" }, "provider": { "id": 1284, "payment_id": "56368817", "auth_code": "", "endpoint_id": "VIETTELPOST" }, "code": "0", "message": "Success" }, "signature": "OCa7bOyjNbaxVUvtgSxNfvVlQI5gWNY4k7WIB0AyGpxD sdGFknCiLwqopvPs8GZprj7/4c1a6n3n0QRIvv25Fg==" } }
The following is the example of a callback for a purchase declined due to time out of the request.
Figure: Example of a declined purchase callback
{ "project_id": 200, "payment": { "id": "ECT_TEST_15619", "type": "purchase", "status": "decline", "date": "2019-07-01T07:40:36+0000", "method": "Cash Vietnam", "sum": { "amount": 2000, "currency": "VND" }, "description": "nganluongtest3.2" }, "customer": { "id": "1" }, "operation": { "id": 39901000003337, "type": "sale", "status": "decline", "date": "2019-07-01T07:40:36+0000", "created_date": "2019-07-01T07:40:33+0000", "request_id": "3588d3f8fd252b3cabf1af779dfd3e4867d83e2242eba6e6d148", "sum_initial": { "amount": 2000, "currency": "VND" }, "sum_converted": { "amount": 2000, "currency": "VND" }, "provider": { "id": 1284, "payment_id": "", "auth_code": "" }, "code": "20602", "message": "Time-out" }, "signature": "jqTBt8VV8UhK63525hwW9dspYAqUJGLq6GwqIXuvLTmU3Mo DrxZk6/lYm8cPuF/4N14kS3LWfSjCRdrKcaL6Gg==" } }
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 OTC 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.