Hong Kong Virtual Account

Overview

Hong Kong Virtual Account is the payment method for purchase processing in Hong Kong that requires the customer to transfer funds to virtual bank account via a banking mobile application. Purchases can be performed through this method by using Payment Page and Gate.

General information

Payment method type bank payments
Payment instruments bank accounts
Countries and regions HK
Payment currencies HKD, CNY
Currency conversion
Purchases +
Payouts
Credential-on-file (COF) purchases
Full refunds
Partial refunds
Chargebacks
Special considerations when making a purchase the customer can specify an amount different from the one specified in the request, information on how to handle such cases is provided below.
Obtaining access to the payment method and access fee Refer to your ecommpay Key Account Manager

Interaction diagram

Purchase processing by using the Hong Kong Virtual Account payment method requires the use of merchant web service, one of the ecommpay interfaces, the ecommpay payment platform, and provider's technical facilities.



Operations support

  Interfaces Amounts, HKD Timespans*
Payment Page CMS Plug-ins Gate Dashboard minimum maximum basic time threshold time
Purchases + + 4,000,000.00
* The basic time and the threshold time are defined as follows:
  • The basic time is the average time from the moment a payment is initiated in the payment platform to the moment the information about the payment result is sent to the initiator. The basic time evaluation is made on the assumption of normal operation of all technical facilities and communication channels and typical customer behaviour (if any input from customer is required). You can use the basic time to define the moment of reacting to the absence of payment result callbacks or checking payment status.
  • The threshold time is the maximum possible time from the moment a payment is initiated in the payment platform to the moment the information about the payment result is sent to the initiator. A payment is automatically declined, if its waiting time exceeds the threshold time. For individual setting of the threshold time limit, contact ecommpay technical support.

Processing scenarios

In the Hong Kong Virtual Account method to make a payment the customer needs to perform bank transfer to virtual account by using banking application.

Figure: Purchase by using Payment Page



Figure: Purchase by using Gate



Processing of incorrect payment information

When working with this method, all the necessary information for successful payment is provided to customers in the instructions. However, since the customers makes a transfer through the service of their Bank, they may intentionally or accidentally violate the rules of filling in data. The payment is admitted as completed, and the final callback of this payment contains information about the amount that was specified by the customer when making the payment, regardless of whether it matches the amount in the request. After that, the resolution of this situation is carried out on the merchant's side.

Let's say the 300.00 HKD amount was specified in the following request to initiate a payment by using Gate:

Figure: Example of data in the request

{
    "general": {
      "project_id": 1234567,
      "payment_id": "abc12345",
      "signature": "123abc...456789"
    },
    "customer": {
      "id": "123"
      "ip_address": "1.1.1.1"
    },
    "payment": {
      "amount": 30000,
      "currency": "HKD"
  }
}

If the customer specified the 250.00 HKD amount when paying, and the payment was successfully processed on the platform and provider sides, the platform sends the callback of the following form to the web service (this callback contains information about the actual amount specified by the customer). With this in mind the callback needs to be processed on the merchant side despite the difference between the actual amount and the initial amount specified in the request.

Figure: Example of data in the callback

{
        "project_id": 3514,
        "payment": {
            "id": "EP0c8a-960e",
            "type": "purchase",
            "status": "success",
            "date": "2021-02-10T10:10:14+0000",
            "method": "hk-va",
            "sum": {
                "amount": 25000,
                "currency": "HKD"
            },
            "description": ""
        },
        "operation": {
            "id": 360,
            "type": "sale",
            "status": "success",
            "date": "2021-02-10T10:10:14+0000",
            "created_date": "2021-02-10T10:09:34+0000",
            "request_id": "cca222750e99b05bc6656ec2d82df16cbb241a7-00000001",
            "sum_initial": {
                "amount": 25000,
                "currency": "HKD"
            },
            "sum_converted": {
                "amount": 25000,
                "currency": "HKD"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 5171,
                "payment_id": "161295179796",
                "auth_code": "",
                "date": "2021-02-10T10:09:57+0000"
            }
        },
        "signature": "9sHwkk4fbhwQg3PH/8ShWtbqgBZEcfaC+HnVrQe6DFFCQX14w=="
    }

The following sections provide detailed information about what you need to do in order to perform payments and how you can analyse the information on payments and operations.

Purchase by using Payment Page

General information

To process a purchase through Payment Page by using the Hong Kong Virtual Account method, the merchant web service needs to send a request with all the required parameters and signature to the ecommpay URL and receive a callback with the payment result from the payment platform. The Hong Kong Virtual Account method can also be set as preselected payment method when Payment Page opens. For more information about preselecting payment methods, see the Preselecting payment methods section. The full sequence and special aspects of the purchase processing are provided below.



Figure: Purchase processing by using Payment Page: Step-by-step description

  1. Customer initiates a purchase in merchant's web service.
  2. The web service sends the request for opening Payment Page to the specified ecommpay URL.
  3. The request for opening Payment Page is sent to the payment platform.
  4. The payment platform performs initial request processing which includes validation of the required parameters and signature.
  5. In the ecommpay payment platform Payment Page is generated based on the project settings and parameters specified in the request.
  6. Payment Page is displayed to the customer.
  7. The customer selects the Hong Kong Virtual Account method.
  8. The request for processing the payment is sent from Payment Page to the payment platform.
  9. The payment platform processes the request.
  10. The data for displaying the payment instructions to the customer is sent from the payment platform to Payment Page.
  11. The payment instructions are displayed to the customer.
  12. The customer completes all required payment steps.
  13. The payment is processed on the side of the provider service.
  14. The provider service sends a notification about the result to the payment platform.
  15. The payment platform sends the callback with the payment result to the web service.
  16. The payment platform sends the notification about the result to Payment Page.
  17. Information about the payment result is displayed to the customer on Payment Page.

The following sections provide the detailed information about the request format and the Payment Page parameters to use in the Hong Kong Virtual Account 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 Hong Kong Virtual Account method:

  1. You must provide values for the basic minimum of parameters. The following parameters are mandatory for any payment method:
    • project_id—the project ID obtained from ecommpay
    • payment_id—payment ID unique within the project
    • customer_id—customer ID unique within the project
    • payment_currency—payment currency in ISO-4217 alpha-3 format
    • payment_amount—payment amount in minor units
  2. The currency of payment can only be HKD or CNY.
  3. If you need the payment form to open with the Payment Page method as preselected payment method, set the force_payment_method parameter to hk-va.
  4. If required, you can also add any other additional parameters Payment Page supports. All parameters available for payment processing by using the Hong Kong Virtual Account method are provided in the Parameters for opening payment form section.
  5. 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 for processing purchase by using the Hong Kong Virtual Account method must include project, customer and payment IDs, the currency and the amount of a payment in the appropriate currency, and signature, as shown in the following example:

{ payment_id: 'X03936', 
      payment_amount: 1000, 
      payment_currency: 'HKD', 
      project_id: 123, 
      customer_id: 'customer1',
      signature: "kUi2x9dKHAVNU0FYldJrxh4yo+5...ZzUCwX6R\/ekpZhkIQg=="
    }

Callback format

The Hong Kong Virtual Account method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with an information about successful 100.00 HKD purchase made by the customer1 customer in the 123 project.

Figure: Example of a successful purchase callback

{
        "project_id": 123,
        "payment": {
            "id": "12345678",
            "type": "purchase",
            "status": "success",
            "date": "2021-04-26T08:40:29+0000",
            "method": "hk-va",
            "sum": {
                "amount": 10000,
                "currency": "HKD"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "operation": {
            "id": 6301000010721,
            "type": "sale",
            "status": "success",
            "date": "2021-04-26T08:40:29+0000",
            "created_date": "2021-04-26T08:39:53+0000",
            "request_id": "faac1f505a3e188fb384d7eabc735335b32af288...006302",
            "sum_initial": {
                "amount": 10000,
                "currency": "HKD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "HKD"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 5171,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "tqmkAb32XGHYglWq3Nm7XD7Yq21fV21dcGBMPb7/ddzuts...qoumh8dQw=="
    }
}

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

Figure: Example of a declined purchase callback

{
        "project_id": 0123,
        "payment": {
            "id": "123456789",
            "type": "purchase",
            "status": "decline",
            "date": "2021-04-26T08:40:29+0000",
            "method": "hk-va",
            "sum": {
                "amount": 10000,
                "currency": "HKD"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1234"
        },
        "operation": {
            "id": 5205000010711,
            "type": "sale",
            "status": "decline",
            "date": "2021-04-26T08:40:29+0000",
            "created_date": "2021-04-26T08:39:53+0000",
            "request_id": "9b430e9f97d5fa903985e482242f6638...0005206",
            "sum_initial": {
                "amount": 10000,
                "currency": "HKD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "HKD"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 5171,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "+a9OY3rEEhMlPpR54LJoQa...2HfVTKJO5LeUmFUDtfA=="
    }
}

Related topics

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

Purchase by using Gate

General information

In the Hong Kong Virtual Account 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. Display the payment instructions 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 Hong Kong Virtual Account 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.
  7. The payment platform sends the callback with the payment instructions data to the web service.
  8. The payment instructions are displayed to the customer.
  9. The customer completes all the payment steps required.
  10. The payment is processed on the provider service side.
  11. The provider service sends the payment result notification to the payment platform.
  12. The payment platform sends a callback to the web service.
  13. The customer receives the payment result on the web service.

The following sections discuss in more details the request format and the Gate parameters to use in the Hong Kong Virtual Account 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 Hong Kong Virtual Account method:
  1. You send purchase requests by sending the request to /v2/payment/banks/hk-qr/sale by using the POST (HTTP) method. This request belongs to the following request group /v2/payment/banks/{payment_method}/sale.
  2. The following objects and parameters must be specified in any request:
    • Object general—general request identification information:
      • project_id—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—customer ID unique within the project
      • ip_address—customer IP address
    • Object payment—payment information:
      • amount—purchase amount in minor units
      • currency—purchase currency in ISO-4217 alpha-3 format
  3. The currency of payment can only be HKD or CNY.
  4. If required, you can also add any other additional parameters Gate supports.

Thus, a correct payment request in the Hong Kong Virtual Account method must include project, customer and payment IDs, currency and amount of the purchase in the appropriate currency, IP address of the customer, and signature, as shown in the following example:

Figure: Example of a purchase request

{
    "general": {
      "project_id": 123,
      "payment_id": "1234567",
      "signature": "GINgwlggTvpF9AnkT8rUUVC7bmSCAa...JChDjj40xI5vOA7w=="
    },
    "customer": {
      "id": "123",
      "ip_address": "1.1.1.1"
    },
    "payment": {
      "amount": 10000,
      "currency": "HKD"
  }
}

Formats of data for displaying the payment instructions

To display the payment instructions to the customer, you must receive and process a callback from the payment platform containing the payment data in the in the display_data array, display the payment instructions to the customer and provide the customer with the possibility to confirm the payment on the web service side.

Along with the payment instructions, it is recommended to display to the customer the information about the expiration date for performing the required steps. If the customer does not confirm the payment prior to expiration of the spectified time, an error message is displayed.

The payment instructions to be displayed to the customer are provided below.

Payment instructions in Traditional Chinese Payment instructions in English
付款詳情 Payment Details
銀行名稱: DBS Bank (Hong Kong) Limited Bank Name: DBS Bank (Hong Kong) Limited
帳戶持有人姓名:DOLLARSMART GLOBAL PTE. LTD. LTD. Account Holder name: DOLLARSMART GLOBAL PTE. LTD.
銀行帳號:{{va_number}} Bank Account number: {{va_number}}
轉帳金額: {{amount}} Transfer amount: {{amount}}
貨幣:HKD Currency: HKD
失效日期 Expiration date
如何支付 How to pay
1) 打開您的銀行應用程序,並從您的帳戶開始新的轉帳。 1) Open your banking app and start a new transfer from your account.
2) 選擇“DBS BANK(HONG KONG)LIMITED”作為收款銀行。 2) Select "DBS BANK (HONG KONG) LIMITED" as a payee bank.
3) 輸入帳戶持有人姓名:“DOLLARSMART GLOBAL PTE. LTD.” 3) Enter account holder’s name: "DOLLARSMART GLOBAL PTE. LTD."
4) 輸入銀行帳號。 4) Enter the bank account number.
5) 如有需要,請選擇HKD貨幣和付款日期。 5) Select HKD currency and payment date if necessary.
6) 輸入要支付的金額。 6) Enter the amount to be paid.
7)選擇“CONFIRM”以繼續轉帳。 7) Select "CONFIRM" to proceed with the transfer.
確認後,付款處理時間少於1分鐘。 Payment processing takes less than 1 minute after confirmation.

The display_data contains objects with the following parameters:

  • type—object type (the value is always add_info)
  • title—title of the parameter which needs to be displayed to the customer (the value is always virtual_account_number)
  • data—number of the generated virtual account

The following is the callback fragment containing the payment data to be displayed to the customer.

"display_data": [
            {
                "type": "add_info",
                "title": "virtual_account_number",
                "data": "1213323442...523521424"
            }
]

Callback format

The Hong Kong Virtual Account method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with an information about successful 100.00 HKD purchase made by the customer1 customer in the 456 project.

Figure: Example of a successful purchase callback

{
        "project_id": 456,
        "payment": {
            "id": "12345678",
            "type": "purchase",
            "status": "success",
            "date": "2021-04-26T08:40:29+0000",
            "method": "hk-va",
            "sum": {
                "amount": 10000,
                "currency": "HKD"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "operation": {
            "id": 6301000010721,
            "type": "sale",
            "status": "success",
            "date": "2021-04-26T08:40:29+0000",
            "created_date": "2021-04-26T08:39:53+0000",
            "request_id": "faac1f505a3e188fb384d7eabc735335b32af288...006302",
            "sum_initial": {
                "amount": 10000,
                "currency": "HKD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "HKD"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 5171,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "tqmkAb32XGHYglWq3Nm7XD7Yq21fV21dcGBMPb7/ddzuts...qoumh8dQw=="
    }
}

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

Figure: Example of a declined purchase callback

{
        "project_id": 0123,
        "payment": {
            "id": "123456789",
            "type": "purchase",
            "status": "decline",
            "date": "2021-04-26T08:40:29+0000",
            "method": "hk-va",
            "sum": {
                "amount": 10000,
                "currency": "HKD"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1234"
        },
        "operation": {
            "id": 5205000010711,
            "type": "sale",
            "status": "decline",
            "date": "2021-04-26T08:40:29+0000",
            "created_date": "2021-04-26T08:39:53+0000",
            "request_id": "9b430e9f97d5fa903985e482242f6638...0005206",
            "sum_initial": {
                "amount": 10000,
                "currency": "HKD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "HKD"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 5171,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "+a9OY3rEEhMlPpR54LJoQa...2HfVTKJO5LeUmFUDtfA=="
    }
}

Related topics

The following topics might be useful when implementing payments through Gate:

Analysis of payment results

As with other payment methods ecommpay offers, when using the Hong Kong Virtual Account 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.