QFPay’s Element SDK enables merchants to build customised checkout experiences using secure, prebuilt payment components hosted by QFPay. It provides flexible front-end integration while keeping payment processing secure and compliant. This guide explains how to integrate the Element SDK into your website or application.Documentation Index
Fetch the complete documentation index at: https://sdk.qfapi.com/llms.txt
Use this file to discover all available pages before exploring further.
Integration Flow
Flow Summary
- Create a Payment Intent via QFPay API.
- Initialise the SDK using
QFpay.config(). - Render payment UI (card form or wallet interface).
- Collect customer payment details.
- Confirm payment using SDK confirmation methods.
Supported Payment Methods
The Element SDK supports:- Alipay (Mainland China & Hong Kong)
- WeChat Pay
- UnionPay / QuickPass
- FPS
- PayMe
- Visa / Mastercard
- Apple Pay
- Card Pre-authorisation
Step 1: Load SDK
Include the SDK script in your page:Step 2: Initialise SDK
| Parameter | Required | Values | Description |
|---|---|---|---|
region | No | hk | hkt | qa | Region selection |
env | No | prod | test | qa | Environment selection |
qfpay object.
Step 3: Create Payment Intent (Backend)
EndpointPOST /payment_element/v1/create_payment_intent
Headers
| Header | Required | Description |
|---|---|---|
X-QF-APPCODE | Yes | Store app code |
X-QF-SIGN | Yes | Request signature |
Parameters
| Parameter | Required | Description |
|---|---|---|
txamt | Yes | Amount in cents |
txcurrcd | No | Currency (e.g. HKD) |
pay_type | Yes | Payment type code |
out_trade_no | Yes | Merchant order number |
mchid | No | Required for agent setups |
return_url | No | Success redirect |
failed_url | No | Failure redirect |
notify_url | No | Webhook callback |
Response
Step 4: Retrieve Payment Intent (Frontend)
Step 5: Configure Appearance (Optional)
Step 6: Render Payment UI
Wallet + Card Interface
Card Form Only
Step 7: Initiate Payment
Card Payment
Multi-Wallet Payment
Step 8: Confirm Payment
Card / Apple Pay
Wallet Payments
| Code | Meaning |
|---|---|
0000 | Success |
1111 | Apple Pay cancelled |
| other | Failed |
Step 9: Query Transaction
Important Notes
Payment intent expiry:
• Production: 2 years
• Sandbox: 7 days
• Production: 2 years
• Sandbox: 7 days

