Chingchingpay Payment Gateway
  1. 支付網關
Chingchingpay Payment Gateway
  • 支付網關
    • 查詢交易狀態
      POST
    • 發起支付交易
      POST
    • 發起退款交易
      POST
    • 創建PaymentLink H5 頁面
      POST
  1. 支付網關

發起支付交易

测试环境
https://test-api.chingchingpay.com/gateway
测试环境
https://test-api.chingchingpay.com/gateway
POST
https://test-api.chingchingpay.com/gateway
/api/v1/payments/checkout
Last modified:2025-03-25 01:43:51
發起支付交易

Request

Header Params
x-api-key
string 
optional
Default:
{{API_KEY}}
x-signature
string 
optional
Body Params application/json
amount
integer 
optional
交易金额 單位: 分,最小交易金額10分
callback_url
string 
optional
交易狀態回調地址
cancel_url
string 
optional
交易取消時,頁面回傳地址
channel_id
integer 
required
渠道ID
client_ip
string 
optional
客戶端IP
complete_url
string 
optional
交易成功時,頁面返回地址, 如果為空,需要跳轉地址的支付方式會默認使用ChingChingPay的交易詳情頁面地址
currency
string 
optional
交易幣種 支持HKD,CNY
description
string 
optional
交易描述
device_id
string 
optional
设备ID
expires_at
string 
optional
支付過期時間,时间戳
merchant_id
string 
required
商户ID
merchant_reference
string 
optional
商家參考號, PaymentID为空时必填
payment_id
string 
optional
支付ID,如果是空,为新订单,如果不为空,为订单支付,如果是退款,为退款订单
payment_method
string 
required
支付方式,具體參考支付方式列表
payment_method_option
string 
optional
PaymentMethodOption 是一個可選參數,用於傳輸不同的支付方式的附加參數,具體參數查看支付網關API文檔
store_id
string 
optional
商店ID
transaction_type
string 
required
交易類型: sale(支付), refund(退款), command(獲取授權碼或者openid等不需要支付的请求)
Example
{
  "amount": 0,
  "callback_url": "string",
  "cancel_url": "string",
  "channel_id": 0,
  "client_ip": "string",
  "complete_url": "string",
  "currency": "string",
  "description": "string",
  "device_id": "string",
  "expires_at": "string",
  "merchant_id": "string",
  "merchant_reference": "string",
  "payment_id": "string",
  "payment_method": "string",
  "payment_method_option": "string",
  "store_id": "string",
  "transaction_type": "string"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://test-api.chingchingpay.com/gateway/api/v1/payments/checkout' \
--header 'x-api-key: ' \
--header 'x-signature;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount": 0,
    "callback_url": "string",
    "cancel_url": "string",
    "channel_id": 0,
    "client_ip": "string",
    "complete_url": "string",
    "currency": "string",
    "description": "string",
    "device_id": "string",
    "expires_at": "string",
    "merchant_id": "string",
    "merchant_reference": "string",
    "payment_id": "string",
    "payment_method": "string",
    "payment_method_option": "string",
    "store_id": "string",
    "transaction_type": "string"
}'

Responses

🟢200OK
application/json
OK
Body
code
integer 
optional
data
object 
v1.CreateTransactionResponse
optional
merchant_reference
string 
optional
商户訂單號,需保證唯一
message
string 
optional
訊息
next_action
object 
optional
接下來的使用者動作,操作类型: no_op(無需操作), redirect_to_url(跳轉URL), display_qr_code(顯示二維碼), wechat_pay_in_mini_program(唤醒微信小程序支付)
payment_id
string 
required
支付ID
payment_reference
string 
optional
支付服务商交易号,例如WeChat Pay order No.
result
string 
required
結果: completed, failed, pending
transaction_id
string 
required
Chingchingpay 交易 ID
transaction_type
string 
required
交易类型: sale(支付), refund(退款)
message
string 
optional
Example
{
  "code": 0,
  "data": {
    "merchant_reference": "string",
    "message": "string",
    "next_action": {
      "alipay_auto_debit": {
        "access_token": "string",
        "auth_site_user_id": "string",
        "expires_in": "string",
        "re_expires_in": "string",
        "refresh_token": "string",
        "token_status": "string"
      },
      "alipay_mobile_security_pay": {
        "order_str": "string"
      },
      "crypto_payment": {
        "amount": 0,
        "contract_id": "string",
        "expiration": 0,
        "fee_rate": 0,
        "memo": "string",
        "merchant_address": "string",
        "token_id": "string",
        "tx_id": "string"
      },
      "display_qr_code": {
        "qr_code": "string",
        "url": "string"
      },
      "redirect_to_url": {
        "http_method": "string",
        "params": "string",
        "url": "string"
      },
      "type": "string",
      "wechat_inapp_payment": {
        "app_id": "string",
        "nonce_str": "string",
        "package": "string",
        "partner_id": "string",
        "pay_sign": "string",
        "prepay_id": "string",
        "time_stamp": "string"
      },
      "wechat_jsapi_payment": {
        "app_id": "string",
        "nonce_str": "string",
        "package": "string",
        "pay_sign": "string",
        "sign_type": "string",
        "time_stamp": "string"
      },
      "wechat_official_account_auth_code": {
        "auth_code": "string"
      },
      "wechat_official_account_openid": {
        "openid": "string"
      },
      "wechat_pay_in_mini_program": {
        "app_id": "string",
        "nonce_str": "string",
        "package": "string",
        "pay_sign": "string",
        "sign_type": "string",
        "time_stamp": "string"
      }
    },
    "payment_id": "string",
    "payment_reference": "string",
    "result": "string",
    "transaction_id": "string",
    "transaction_type": "string"
  },
  "message": "string"
}
Previous
查詢交易狀態
Next
發起退款交易
Built with