dvcrn/openclaw-skills-marketplace/hongkong-payment-qfpay

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

QFPay API is a comprehensive payment solution that offers various payment methods to meet the needs of different businesses. This skill provides complete API integration guidelines including environment configuration, request formats, signature generation, payment types, supported currencies, and status codes.

Install

npx vskill@latest install dvcrn/openclaw-skills-marketplace/hongkong-payment-qfpay

SKILL.md

QFPay Payment API Skill

Overview

QFPay API is a comprehensive payment solution that offers various payment methods to meet the needs of different businesses. This skill provides complete API integration guidelines including environment configuration, request formats, signature generation, payment types, supported currencies, and status codes.

Environment Configuration

QFPay API is accessible via three main environments:

EnvironmentBase URLDescription
Sandboxhttps://openapi-int.qfapi.comFor simulating payments without real fund deduction
Testinghttps://test-openapi-hk.qfapi.comReal payment flow but linked to test accounts (no settlement)
Productionhttps://openapi-hk.qfapi.comReal live payments with actual settlement

Important Notes:

  • Transactions in Testing environment using test accounts will NOT be settled
  • Always ensure refunds are triggered immediately for test transactions
  • Mixing credentials or endpoints across environments will result in signature or authorization errors
Environment Variables Setup

Configure these environment variables before using the API:

bash
export QFPAY_APPCODE="your_app_code_here"
export QFPAY_KEY="your_client_key_here"
export QFPAY_MCHID="your_merchant_id" # Optional, depends on account setup
export QFPAY_ENV="sandbox" # Options: prod, test, sandbox

API Usage Guidelines

Rate Limiting

To ensure fair usage and optimal performance:

  • Limit: Maximum 100 requests per second (RPS) and 400 requests per minute per merchant
  • Exceeding Limit: API responds with HTTP 429 (Too Many Requests)
Best Practices
  1. Batch Requests: Use batch processing to minimize individual requests
  2. Efficient Queries: Utilize filtering and pagination
  3. Caching: Implement response caching to avoid repeated requests
  4. Monitoring: Track API usage and implement logging for request patterns
Error Handling

When receiving HTTP 429:

  1. Pause further requests for a specified duration
  2. Implement exponential backoff for retries
  3. Log errors for monitoring
Traffic Spike Management

For anticipated traffic spikes (e.g., promotional events), contact:

  • Technical Support: technical.support@qfpay.com

Request Format

HTTP Request
POST /trade/v1/payment
Public Payment Request Parameters
AttributeRequiredTypeDescription
txamtYesInt(11)Transaction amount in cents (100 = $1). Suggest > 200 to avoid risk control
txcurrcdYesString(3)Transaction currency. See Currencies section for full list
pay_typeYesString(6)Payment type code. See Payment Types section
out_trade_noYesString(128)External transaction number. Must be unique per merchant account
txdtmYesString(20)Transaction time format: YYYY-MM-DD hh:mm:ss
auth_codeYes (CPM only)String(128)Authorization code for scanning barcode/QR. Expires within one day
expired_timeNo (MPM only)String(3)QR expiration in minutes. Default: 30, Min: 5, Max: 120
goods_nameNoString(64)Item description. Max 20 chars, UTF-8 for Chinese. Required for App payments
mchidNoString(16)Merchant ID. Required if assigned, must NOT be included if not assigned
udidNoString(40)Unique device ID for internal tracking
notify_urlNoString(256)URL for asynchronous payment notifications
HTTP Header Requirements
FieldRequiredDescription
X-QF-APPCODEYesApp code assigned to merchant
X-QF-SIGNYesSignature generated per signature algorithm
X-QF-SIGNTYPENoSignature algorithm. Use SHA256 or defaults to MD5
Content Specifications
  • Character Encoding: UTF-8
  • Method: POST/GET (depends on endpoint)
  • Content-Type: application/x-www-form-urlencoded

Response Format

Success Response Structure
json
{
"respcd": "0000",
"respmsg": "success",
"data": {
"txamt": "100",
"out_trade_no": "20231101000001",
"txcurrcd": "HKD",
"txstatus": "SUCCESS",
"qf_trade_no": "9000020231101000001",
"pay_type": "800101",
"txdtm": "2023-11-01 10:00:00"
}
}
Response Fields
FieldTypeDescription
respcdString(4)Return code. "0000" means success
respmsgString(64)Message description of respcd
dataObjectPayment transaction data
Data Object Fields
FieldTypeDescription
txamtStringTransaction amount in cents
out_trade_noStringMerchant's original order number
txcurrcdStringCurrency code (e.g., HKD)
txstatusStringPayment status: SUCCESS, FAILED, PENDING
qf_trade_noStringQFPay's unique transaction number
pay_typeStringPayment method code
txdtmStringPayment time (YYYY-MM-DD HH:mm:ss)
Signature Verification

Response may include X-QF-SIGN and X-QF-SIGNTYPE headers. Verify by:

  1. Extracting data fields in sorted order
  2. Concatenating as key1=value1&key2=value2&...
  3. Appending client key
  4. Generating MD5 hash and comparing

Signature Generation

All API requests must include a digital signature in the HTTP header:

X-QF-SIGN: <your_signature>
Step-by-Step Guide
Step 1: Sort Parameters

Sort all request parameters by parameter name in ASCII ascending order.

Example:

ParameterValue
mchidZaMVg12345
txamt100
txcurrcdHKD

Sorted result:

mchid=ZaMVg12345&txamt=100&txcurrcd=HKD
Step 2: Append Client Key

Append your secret client_key to the string.

If client_key = abcd1234:

mchid=ZaMVg12345&txamt=100&txcurrcd=HKDabcd1234
Step 3: Hash the String

Hash using MD5 or SHA256 (SHA256 recommended):

SHA256("mchid=ZaMVg12345&txamt=100&txcurrcd=HKDabcd1234")
Step 4: Add to Header
X-QF-SIGN: <your_hashed_signature>
Important Notes
  • Do NOT insert line breaks, tabs, or extra spaces
  • Parameter names and values are case-sensitive
  • Double-check parameter order and encoding if signature fails
Code Examples
Python
python
import os
import hashlib
APPCODE = os.getenv('QFPAY_APPCODE')
KEY = os.getenv('QFPAY_KEY')
def generate_signature(params, key):
"""Generate MD5 signature"""
keys = list(params.keys())
keys.sort()
query = []
for k in keys:
if k not in ('sign', 'sign_type') and (params[k] or params[k] == 0):
query.append(f'{k}={params[k]}')
data = '&'.join(query) + key
md5 = hashlib.md5()
md5.update(data.encode('utf-8'))
return md5.hexdigest().upper()
def generate_signature_sha256(params, key):
"""Generate SHA256 signature"""
keys = list(params.keys())
keys.sort()
query = []
for k in keys:
if k not in ('sign', 'sign_type') and (params[k] or params[k] == 0):
query.append(f'{k}={params[k]}')
data = '&'.join(query) + key
sha256 = hashlib.sha256()
sha256.update(data.encode('utf-8'))
return sha256.hexdigest().upper()

Payment Types

The pay_type parameter specifies which payment method to use. This affects transaction routing and UI requirements.

Note: Not all pay_type values are enabled for every merchant. Contact technical.support@qfpay.com for clarification.

Supported Payment Types
CodeDescription
800008CPM for WeChat, Alipay, UnionPay QuickPass, PayMe
800101Alipay MPM (Overseas Merchants)
800108Alipay CPM (Overseas & HK Merchants)
801101Alipay Web Payment (Overseas)
801107Alipay WAP Payment (Overseas)
801110Alipay In-App Payment (Overseas)
800107Alipay Service Window H5 Payment
801501Alipay MPM (HK Merchants)
801510Alipay In-App (HK Merchants)
801512Alipay WAP (HK Merchants)
801514Alipay Web (HK Merchants)
800201WeChat MPM (Overseas & HK)
800208WeChat CPM (Overseas & HK)
800207WeChat JSAPI Payment (Overseas & HK)
800212WeChat H5 Payment
800210WeChat In-App Payment (Overseas & HK)
800213WeChat Mini-Program Payment
801008WeChat Pay HK CPM (Direct Settlement, HK)
801010WeChat Pay HK In-App (Direct Settlement, HK)
805801PayMe MPM (HK Merchants)
805808PayMe CPM (HK Merchants)
805814PayMe Web Payment (HK Merchants)
805812PayMe WAP Payment (HK Merchants)
800701UnionPay QuickPass MPM
800708UnionPay QuickPass CPM
800712UnionPay WAP Payment (HK)
800714UnionPay PC-Web Payment (HK)
802001FPS MPM (HK Merchants)
803701Octopus MPM (HK Merchants)
803712Octopus WAP Payment (HK)
803714Octopus PC-Web Payment (HK)
802801Visa / Mastercard Online
802808Visa / Mastercard Offline
806527ApplePay Online
806708UnionPay Card Offline
806808American Express Card Offline
Special Remarks
  • 801101: Transaction amount must be greater than 1 HKD
  • 802001: This payment method does not support refunds

Supported Currencies

All codes follow ISO 4217 format (3-letter uppercase):

CodeDescription
AEDArab Emirates Dirham
CNYChinese Yuan
EUREuro
HKDHong Kong Dollar
IDRIndonesian Rupiah
JPYJapanese Yen
MMKMyanmar Kyat
MYRMalaysian Ringgit
SGDSingapore Dollar
THBThai Baht
USDUnited States Dollar
CADCanadian Dollar
AUDAustralian Dollar

Note: Some payment methods may only support HKD. Verify with your integration manager before non-HKD transactions.

Status Codes

Standard respcd values returned by QFPay API:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
24
Repository forks
9
7-day trend score
16

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dvcrn/openclaw-skills-marketplace/hongkong-payment-qfpay/badge)](https://verified-skill.com/skills/dvcrn/openclaw-skills-marketplace/hongkong-payment-qfpay)

Something wrong with this skill or its page? Tell us.