https://mch.pcpay.me/payapi/order
Parameter | Required | Type | Description |
---|---|---|---|
mch_id | Yes | string(32) |
商户号。 例如:9e1e409b05145d0ccceb7a8dbfe8bc58 |
device_info | Optional | string(32) | 设备号。收款设备的编号或名字,由用户自定义 例如:WEB |
nonce | Yes | string(32) |
随机字符串。长度要求在32位以内
例如:9e1e409b05255d0ccceb7a8dbfe8bc58 |
sign | Yes | string(64) | 签名。通过签名算法计算出签名值,详见签名生成算法 例如:b3a6741e8652d7d44348c69241459af8 |
sign_alg | Optional | string(32) | 签名类型。默认为hmac-sha256,目前只支持hmac-sha256 例如:hmac-sha256 |
title | Yes | string(128) | 商品描述 例如:游戏充值 |
detail | Optional | string(2048) | 商品详情 |
attach | Optional | string(128) | 附加数据 例如:XX分店 |
out_trade_no | Yes | string(32) | 商户订单号 例如:20180808080808 |
coin_type | Yes | string(16) | 币种 例如:BTC |
price | Yes | string(32) | 金额 例如:2.3456 |
bill_create_ip | Yes | string(64) | 终端IP 例如:2404:6800:4005:808::200e |
time_start | Optional | string(32) | 交易起始时间。ISO 8601格式时间戳 例如:2018-08-08T08:08:08.008Z |
time_expire | Optional | string(32) | 交易结束时间。ISO 8601格式时间戳 例如:2018-08-08T08:38:08.008Z |
notify_url | Yes | string(256) | 通知地址 例如:https://www.pcpay.me/notify.php |
openid | Optional | string(32) |
用户标识 例如:fe3e409b05255d0ccceb7a8dbfdabc23 |
Parameter | Required | Type | Description |
---|---|---|---|
pcpay_tid | Yes | string(20) | pcpay订单ID号 例如:97962676063305731 |
Parameter | Required | Type | Description |
---|---|---|---|
errno | Yes | string | 交易结束时间。ISO 8601格式时间戳 例如:ERR_INVALID_ARG |
message | Yes | string | 错误描述 例如:Bad field type: 'mch_id'... |
https://mch.pcpay.me/payapi/orderquery
Parameter | Required | Type | Description |
---|---|---|---|
mch_id | Yes | string(32) | 例如:9e1e409b05145d0ccceb7a8dbfe8bc58 |
nonce | Yes | string(32) |
随机字符串。长度要求在32位以内
例如:9e1e409b05255d0ccceb7a8dbfe8bc58 |
sign | Yes | string(64) | 签名。通过签名算法计算出签名值,详见签名生成算法 例如:B3A6741E8652D7D44348C69241459AF8 |
sign_alg | Optional | string(32) | 签名类型。默认为hmac-sha256,目前只支持hmac-sha256 例如:hmac-sha256 |
pcpay_tid | Yes | string(32) | 订单号。
订单号或商户订单号,必须至少提供其中一个 例如:xxx |
out_trade_no | Yes | string(32) | 商户订单号。订单号或商户订单号,必须至少提供其中一个 例如:20180808080808 |
Parameter | Required | Type | Description |
---|---|---|---|
pcpay_tid | Yes | string(20) | pcpay订单ID号 例如:97962676063305731 |
status | Yes | number | 订单状态。0: 订单未支付状态; 1: 订单已支付; 2: 订单已关闭。 例如:0 |
out_trade_no | Yes | string(32) | 例如:00001 |
coin_type | Yes | string(16) | 币种币种 例如:BTC |
price | Yes | string(32) | 金额 例如:2.3456 |
time_start | Optional | string(32) | 交易起始时间。ISO 8601格式时间戳 例如:2018-08-08T08:08:08.008Z |
time_expire | Optional | string(32) | 交易结束时间。ISO 8601格式时间戳 例如:2018-08-08T08:38:08.008Z |
Parameter | Required | Type | Description |
---|---|---|---|
errno | Yes | string | 交易结束时间。ISO 8601格式时间戳 例如:ERR_INVALID_ARG |
message | Yes | string | 错误描述 例如:Bad field type: 'mch_id'... |
https://mch.pcpay.me/payapi/closeorder
Parameter | Required | Type | Description |
---|---|---|---|
mch_id | Yes | string(32) | 商户号。 例如:9e1e409b05145d0ccceb7a8dbfe8bc58 |
nonce | Yes | string(32) | 随机字符串。长度要求在32位以内 例如:9e1e409b05255d0ccceb7a8dbfe8bc58 |
sign | Yes | string(64) | 签名。通过签名算法计算出签名值,详见签名生成算法 例如:B3A6741E8652D7D44348C69241459AF8 |
sign_alg | Optional | string(32) | 签名类型。默认为hmac-sha256,目前只支持hmac-sha256 例如:HMAC-SHA256 |
out_trade_no | Yes | string(32) | 商户订单号。 例如:20180808080808 |
Parameter | Required | Type | Description |
---|---|---|---|
pcpay_tid | Yes | string(20) | pcpay订单ID号 例如:97962676063305731 |
status | Yes | number | 订单状态。0: 订单未支付状态; 1: 订单已支付; 2: 订单已关闭。 例如:2 |
out_trade_no | Yes | string(32) | 商户订单号。 例如:20180808080808 |
Parameter | Required | Type | Description |
---|---|---|---|
errno | Yes | string | 交易结束时间。ISO 8601格式时间戳 例如:ERR_INVALID_ARG |
message | Yes | string | 错误描述 例如:Bad field type: 'mch_id'... |
签名如下内容:
{
"mch_id": "48bfaa972fa1781b230642ea1eee2f33",
"title": "VIP",
"nonce": "1549960232119"
}
s = "mch_id=48bfaa972fa1781b230642ea1eee2f33&nonce=1549960232119&title=VIP"
sign = HMAC_SHA256(mch_key, s)
// 67cd3c06d9b0f254c81df54ceb52756ddf7b57e79ada7e7170b436f3a12c8aab
{
"mch_id": "48bfaa972fa1781b230642ea1eee2f33",
"title": "VIP",
"nonce": "1549960232119",
"sign": "67cd3c06d9b0f254c81df54ceb52756ddf7b57e79ada7e7170b436f3a12c8aab"
}