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:

  1. A customer initiates a purchase on the merchant's web service.
  2. The web service sends the request for Payment Page opening to the specified ecommpay URL.
  3. The request for opening is redirected to the payment platform.
  4. The payment platform performs the initial request processing that involves validation of the required parameters and signature.
  5. Requested Payment Page is generated into the ecommpay payment platform as specified in the project settings and the request parameters.
  6. Payment Page is displayed to the customer.
  7. The customer selects the Vietnam convenience store method.
  8. The list of supported post offices is displayed to the customer (Viettel Post and Vietnam Post).
  9. The customer selects post office.
  10. The payment platform receives the purchase request for payment processing from Payment Page.
  11. The payment platform performs the internal purchase request processing and sends it to the Vietnamese OTC service.
  12. The purchase request is processed on the Vietnamese OTC service side.
  13. The Vietnamese OTC service generates the data for displaying payment instruction and sends it to the payment platform.
  14. The payment platform sends the data for displaying payment instruction to Payment Page.
  15. The payment instruction is displayed to the customer on Payment Page.
  16. The customer completes all the payment steps required.
  17. The payment is processed on the Vietnamese OTC side.
  18. The customer receives email with the payment result from the Vietnamese OTC service.
  19. The Vietnamese OTC service sends the result notification to the payment platform.
  20. The payment platform sends a callback with the payment result to the web service.
  21. The payment platform sends the result to Payment Page.
  22. 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:

  1. You must provide values for the basic minimum of parameters. Listed below are the parameters that are mandatory for any payment method:
    • project_id—the project ID obtained from ecommpay
    • payment_id—payment ID unique within the project
    • payment_currency—payment currency in ISO-4217 alpha-3 format
    • payment_amount—payment amount
    • customer_id—customer ID unique within the project
  2. The currency of payment can only be VND.
  3. If you need to have payment form displayed with the Vietnamese OTC method selected, set the force_payment_method parameter to vietnam-cash.
  4. 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 parameter customer.language.
  5. If required, you can also add any other additional parameters Payment Page supports.
  6. 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:

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

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



Figure: Purchase by using Gate

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

The sections that follow discuss in more details the request format and the Gate parameters to use in the 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:
  1. 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.
  2. The following objects and parameters must be specified in any request:
    • general—general purchase information:
      • project_id—project identifier
      • payment_id—unique purchase identifier
      • signature—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 project
      • email—email address
      • ip_address—customer IP address
    • account—post office information:
      • bank_id—post office identifier (Viettel post—571, Vietnam Post—572);
    • payment—purchase information:
      • amount—purchase amount
      • currency—purchase currency in the ISO-4217 alpha-3 format.
  3. The currency of purchase can only be VND.
  4. 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 parameter customer.language.
  5. If required, you can also add any other additional parameters Gate supports.
  6. 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.