提交刷脸支付
发起订单支付
| 请求参数 | 类型 | 描述 |
|---|---|---|
| xml | object | 声明请求的XML数据结构 |
| deposit | string | 是否押金支付Y | N 枚举值之一 |
| appid | string | 公众账号ID |
| sub_appid | string | 子商户公众账号ID |
| mch_id | string | 商户号 |
| sub_mch_id | string | 子商户号 |
| device_info | string | 设备号 |
| body | string | 商品描述 |
| detail | string | 商品详情JSON格式字符串 |
| goods_detail | object[] | 单品列表 |
| goods_id | string | 商品编码 |
| wxpay_goods_id | string | 微信支付商品编码 |
| goods_name | string | 商品名称 |
| goods_num | number | 商品数量 |
| price | number | 商品单价 |
| goods_category | string | 商品类目ID |
| body | string | 商品描述信息 |
| attach | string | 附加数据 |
| out_trade_no | string | 商户订单号 |
| total_fee | integer | 总金额 |
| fee_type | string | 货币类型 |
| spbill_create_ip | string | 终端IP |
| goods_tag | string | 订单优惠标记 |
| limit_pay | string | 指定支付方式 |
| time_start | string | 交易起始时间 |
| time_expire | string | 交易结束时间 |
| openid | string | 用户标识 |
| face_code | string | 授权码 |
| sign_type | string | 签名类型HMAC-SHA256 枚举值 |
php
$instance->v2->pay->facepay->postAsync([
'xml' => [
'deposit' => 'Y',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888888',
'mch_id' => '1900000100',
'sub_mch_id' => '1900000100',
'device_info' => '013467007045764',
'body' => 'image形象店-深圳腾大- QQ公仔',
'detail' => \json_encode([
'goods_detail' => [[
'goods_id' => '商品编码',
'wxpay_goods_id' => '1001',
'goods_name' => 'iPhone6s 16G',
'goods_num' => 1,
'price' => 528800,
'goods_category' => '123789',
'body' => '苹果手机',
],],
]),
'attach' => '说明',
'out_trade_no' => '1217472501201407033233367018',
'total_fee' => '888',
'fee_type' => 'CNY',
'spbill_create_ip' => '8.8.8.8',
'goods_tag' => '1234',
'limit_pay' => 'no_credit',
'time_start' => '20091225091010',
'time_expire' => '20091227091010',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'face_code' => 'b713b5d2-666c-48',
'sign_type' => 'HMAC-SHA256',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();php
$instance->chain('v2/pay/facepay')->postAsync([
'xml' => [
'deposit' => 'Y',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888888',
'mch_id' => '1900000100',
'sub_mch_id' => '1900000100',
'device_info' => '013467007045764',
'body' => 'image形象店-深圳腾大- QQ公仔',
'detail' => \json_encode([
'goods_detail' => [[
'goods_id' => '商品编码',
'wxpay_goods_id' => '1001',
'goods_name' => 'iPhone6s 16G',
'goods_num' => 1,
'price' => 528800,
'goods_category' => '123789',
'body' => '苹果手机',
],],
]),
'attach' => '说明',
'out_trade_no' => '1217472501201407033233367018',
'total_fee' => '888',
'fee_type' => 'CNY',
'spbill_create_ip' => '8.8.8.8',
'goods_tag' => '1234',
'limit_pay' => 'no_credit',
'time_start' => '20091225091010',
'time_expire' => '20091227091010',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'face_code' => 'b713b5d2-666c-48',
'sign_type' => 'HMAC-SHA256',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();php
$instance['v2/pay/facepay']->postAsync([
'xml' => [
'deposit' => 'Y',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888888',
'mch_id' => '1900000100',
'sub_mch_id' => '1900000100',
'device_info' => '013467007045764',
'body' => 'image形象店-深圳腾大- QQ公仔',
'detail' => \json_encode([
'goods_detail' => [[
'goods_id' => '商品编码',
'wxpay_goods_id' => '1001',
'goods_name' => 'iPhone6s 16G',
'goods_num' => 1,
'price' => 528800,
'goods_category' => '123789',
'body' => '苹果手机',
],],
]),
'attach' => '说明',
'out_trade_no' => '1217472501201407033233367018',
'total_fee' => '888',
'fee_type' => 'CNY',
'spbill_create_ip' => '8.8.8.8',
'goods_tag' => '1234',
'limit_pay' => 'no_credit',
'time_start' => '20091225091010',
'time_expire' => '20091227091010',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'face_code' => 'b713b5d2-666c-48',
'sign_type' => 'HMAC-SHA256',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();php
$response = $instance->v2->pay->facepay->post([
'xml' => [
'deposit' => 'Y',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888888',
'mch_id' => '1900000100',
'sub_mch_id' => '1900000100',
'device_info' => '013467007045764',
'body' => 'image形象店-深圳腾大- QQ公仔',
'detail' => \json_encode([
'goods_detail' => [[
'goods_id' => '商品编码',
'wxpay_goods_id' => '1001',
'goods_name' => 'iPhone6s 16G',
'goods_num' => 1,
'price' => 528800,
'goods_category' => '123789',
'body' => '苹果手机',
],],
]),
'attach' => '说明',
'out_trade_no' => '1217472501201407033233367018',
'total_fee' => '888',
'fee_type' => 'CNY',
'spbill_create_ip' => '8.8.8.8',
'goods_tag' => '1234',
'limit_pay' => 'no_credit',
'time_start' => '20091225091010',
'time_expire' => '20091227091010',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'face_code' => 'b713b5d2-666c-48',
'sign_type' => 'HMAC-SHA256',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));php
$response = $instance->chain('v2/pay/facepay')->post([
'xml' => [
'deposit' => 'Y',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888888',
'mch_id' => '1900000100',
'sub_mch_id' => '1900000100',
'device_info' => '013467007045764',
'body' => 'image形象店-深圳腾大- QQ公仔',
'detail' => \json_encode([
'goods_detail' => [[
'goods_id' => '商品编码',
'wxpay_goods_id' => '1001',
'goods_name' => 'iPhone6s 16G',
'goods_num' => 1,
'price' => 528800,
'goods_category' => '123789',
'body' => '苹果手机',
],],
]),
'attach' => '说明',
'out_trade_no' => '1217472501201407033233367018',
'total_fee' => '888',
'fee_type' => 'CNY',
'spbill_create_ip' => '8.8.8.8',
'goods_tag' => '1234',
'limit_pay' => 'no_credit',
'time_start' => '20091225091010',
'time_expire' => '20091227091010',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'face_code' => 'b713b5d2-666c-48',
'sign_type' => 'HMAC-SHA256',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));php
$response = $instance['v2/pay/facepay']->post([
'xml' => [
'deposit' => 'Y',
'appid' => 'wx8888888888888888',
'sub_appid' => 'wx8888888888888888',
'mch_id' => '1900000100',
'sub_mch_id' => '1900000100',
'device_info' => '013467007045764',
'body' => 'image形象店-深圳腾大- QQ公仔',
'detail' => \json_encode([
'goods_detail' => [[
'goods_id' => '商品编码',
'wxpay_goods_id' => '1001',
'goods_name' => 'iPhone6s 16G',
'goods_num' => 1,
'price' => 528800,
'goods_category' => '123789',
'body' => '苹果手机',
],],
]),
'attach' => '说明',
'out_trade_no' => '1217472501201407033233367018',
'total_fee' => '888',
'fee_type' => 'CNY',
'spbill_create_ip' => '8.8.8.8',
'goods_tag' => '1234',
'limit_pay' => 'no_credit',
'time_start' => '20091225091010',
'time_expire' => '20091227091010',
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'face_code' => 'b713b5d2-666c-48',
'sign_type' => 'HMAC-SHA256',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));| 返回字典 | 类型 | 描述 |
|---|---|---|
| return_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
| return_msg | string | 返回信息 |
| appid | string | 公众账号ID |
| sub_appid | string | 子商户公众账号ID |
| mch_id | string | 商户号 |
| sub_mch_id | string | 子商户号 |
| device_info | string | 设备号 |
| nonce_str | string | 随机字符串 |
| sign | string | 签名 |
| result_code | string | 业务结果SUCCESS | FAIL 枚举值之一 |
| err_code | string | 错误代码 |
| err_code_des | string | 错误代码描述 |
| openid | string | 用户标识 |
| is_subscribe | string | 是否关注公众账号Y | N 枚举值之一 |
| sub_openid | string | 用户子标识 |
| sub_is_subscribe | string | 是否关注子公众账号Y | N 枚举值之一 |
| trade_type | string | 交易类型 |
| bank_type | string | 付款银行 |
| fee_type | string | 标价币种 |
| total_fee | integer | 标价金额 |
| cash_fee_type | string | 现金支付币种 |
| cash_fee | integer | 现金支付金额 |
| settlement_total_fee | integer | 应结订单金额 |
| coupon_fee | integer | 代金券金额 |
| transaction_id | string | 微信支付订单号 |
| out_trade_no | string | 商户订单号 |
| attach | string | 商家数据包 |
| time_end | string | 支付完成时间 |
| promotion_detail | string | 营销详情JSON格式字符串 |
| promotion_id | string | 券ID |
| name | string | 优惠名称 |
| scope | string | 优惠范围GLOBAL | SINGLE 枚举值之一 |
| type | string | 优惠类型COUPON | DISCOUNT 枚举值之一 |
| amount | string | 优惠券面额 |
| activity_id | string | 活动ID |
| wxpay_contribute | string | 微信出资 |
| merchant_contribute | string | 商户出资 |
| other_contribute | string | 其他出资 |
| goods_detail | object[] | 单品列表 |
| goods_id | string | 商品编码 |
| wxpay_goods_id | string | 微信支付商品编码 |
| goods_name | string | 商品名称 |
| quantity | number | 商品数量 |
| price | number | 商品单价 |
参阅 官方文档