Hong Kong FPS QR

Overview

Hong Kong FPS QR is a payment method which allows customers to make purchases in Hong Kong by scanning standardized QR codes with mobile banking applications of Hong Kong banks. You can perform purchases through this method by using Payment Page and Gate.

General information

Payment method type QR code 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
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 FPS QR 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 + + 10,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 FPS QR method to perform a purchase the customer needs to scan QR code by using bank mobile application.

Figure: Purchase by using Payment Page



Figure: Purchase by using Gate



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 FPS QR 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 FPS QR 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 FPS QR 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 FPS QR 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 FPS QR 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
    • payment_currency—payment currency in ISO-4217 alpha-3 format
    • payment_amount—payment amount in minor units
    • customer_id—customer ID unique within the project
  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-qr.
  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 FPS QR 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 FPS QR 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 FPS QR 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": "123123123",
            "type": "purchase",
            "status": "success",
            "date": "2021-04-26T08:40:29+0000",
            "method": "hk-qr",
            "sum": {
                "amount": 10000,
                "currency": "HKD"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "operation": {
            "id": 5205000010711,
            "type": "sale",
            "status": "success",
            "date": "2021-04-26T08:40:29+0000",
            "created_date": "2021-04-26T08:39:53+0000",
            "request_id": "23fdebfc248b0676209a5e0694487738a...08525",
            "sum_initial": {
                "amount": 10000,
                "currency": "HKD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "HKD"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 5161,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "Dj2MN6VS9yDGrRAnJ5sMRnr/J4C7FPOl8...nLN08qIVqFA7pTlw=="
    }
}

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

Figure: Example of a declined purchase callback

{
        "project_id": 0123,
        "payment": {
            "id": "12341234",
            "type": "purchase",
            "status": "decline",
            "date": "2021-04-26T08:40:29+0000",
            "method": "hk-qr",
            "sum": {
                "amount": 10000,
                "currency": "HKD"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "operation": {
            "id": 4991000010711,
            "type": "sale",
            "status": "decline",
            "date": "2021-04-26T08:40:29+0000",
            "created_date": "2021-04-26T08:39:53+0000",
            "request_id": "3d12732e00fb397dbe99ad866e05ecfc...004992",
            "sum_initial": {
                "amount": 10000,
                "currency": "HKD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "HKD"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 5161,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "LbcKUUDELHz8wxx56WCT0T/W00cC6rEAXax7u1kORhK32...wYqSekS6Kg=="
    }
}

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 FPS QR 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 FPS QR 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 required payment steps.
  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 FPS QR 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 FPS QR 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 FPS QR 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": "GINgwlggTvpF9AnkT8rUUVC7bmSCAaQlYc9M...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 and display the customer the payment instructions to the customer.

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
二維碼有效期 QR code expiration date
請下載二維碼並在網上銀行應用程序的二維碼掃描功能中使用 Please download the QR code and use it in the QR scan function of your online banking application
此二維碼僅供一次性掃描 For one-time use only

The array display_data contains the following parameters:

  • type—data type (the value is always qr_data)
  • title—title of the data which needs to be displayed to the customer (the value is always QR code)
  • data—string which contains the coded image of the QR code.

The following is the callback fragment containing the payment data.

"display_data": [
            {
                "type": "qr_img",
                "title": "QR code",
                "data": "1213323442...523521424"
            }
]

Callback format

The Hong Kong FPS QR 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": "123123123",
            "type": "purchase",
            "status": "success",
            "date": "2021-04-26T08:40:29+0000",
            "method": "hk-qr",
            "sum": {
                "amount": 10000,
                "currency": "HKD"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "operation": {
            "id": 5205000010711,
            "type": "sale",
            "status": "success",
            "date": "2021-04-26T08:40:29+0000",
            "created_date": "2021-04-26T08:39:53+0000",
            "request_id": "23fdebfc248b0676209a5e0694487738a...08525",
            "sum_initial": {
                "amount": 10000,
                "currency": "HKD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "HKD"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 5161,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "Dj2MN6VS9yDGrRAnJ5sMRnr/J4C7FPOl8...nLN08qIVqFA7pTlw=="
    }
}

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

Figure: Example of a declined purchase callback

{
        "project_id": 0123,
        "payment": {
            "id": "12341234",
            "type": "purchase",
            "status": "decline",
            "date": "2021-04-26T08:40:29+0000",
            "method": "hk-qr",
            "sum": {
                "amount": 10000,
                "currency": "HKD"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "operation": {
            "id": 4991000010711,
            "type": "sale",
            "status": "decline",
            "date": "2021-04-26T08:40:29+0000",
            "created_date": "2021-04-26T08:39:53+0000",
            "request_id": "3d12732e00fb397dbe99ad866e05ecfc...004992",
            "sum_initial": {
                "amount": 10000,
                "currency": "HKD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "HKD"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 5161,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "LbcKUUDELHz8wxx56WCT0T/W00cC6rEAXax7u1kORhK32...wYqSekS6Kg=="
    }
}

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 FPS QR 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.