Skip to content

支付押金(人脸支付)

商户通过支付押金(人脸)接口发起押金支付请求;用户使用微信支付完成押金支付,支付完成后扣除相应金额,并生成押金交易记录,下发押金支付凭证;支付成功后,为用户下发押金支付凭证;注意:当押金超过一个月未进行处理,会自动执行退款。

请求参数类型描述
xmlobject声明请求的XML数据结构
depositstring是否押金支付
Y | N 枚举值之一
appidstring公众账号ID
sub_appidstring子商户公众账号ID
mch_idstring商户号
sub_mch_idstring子商户号
device_infostring设备号
bodystring商品描述
detailstring商品详情JSON格式字符串
goods_detailobject[]单品列表
goods_idstring商品编码
wxpay_goods_idstring微信支付商品编码
goods_namestring商品名称
goods_numnumber商品数量
pricenumber商品单价
goods_categorystring商品类目ID
bodystring商品描述信息
attachstring附加数据
out_trade_nostring商户订单号
total_feeinteger总金额
fee_typestring货币类型
spbill_create_ipstring终端IP
goods_tagstring订单优惠标记
limit_paystring指定支付方式
time_startstring交易起始时间
time_expirestring交易结束时间
openidstring用户标识
face_codestring授权码
sign_typestring签名类型
HMAC-SHA256 枚举值
php
$instance->v2->deposit->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/deposit/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/deposit/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->deposit->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/deposit/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/deposit/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_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
appidstring公众账号ID
sub_appidstring子商户公众账号ID
mch_idstring商户号
sub_mch_idstring子商户号
device_infostring设备号
nonce_strstring随机字符串
signstring签名
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
err_codestring错误代码
err_code_desstring错误代码描述
openidstring用户标识
is_subscribestring是否关注公众账号
Y | N 枚举值之一
sub_openidstring用户子标识
sub_is_subscribestring是否关注子公众账号
Y | N 枚举值之一
trade_typestring交易类型
bank_typestring付款银行
fee_typestring标价币种
total_feeinteger标价金额
cash_fee_typestring现金支付币种
cash_feeinteger现金支付金额
settlement_total_feeinteger应结订单金额
coupon_feeinteger代金券金额
transaction_idstring微信支付订单号
out_trade_nostring商户订单号
attachstring商家数据包
time_endstring支付完成时间
promotion_detailstring营销详情JSON格式字符串
promotion_idstring券ID
namestring优惠名称
scopestring优惠范围
GLOBAL | SINGLE 枚举值之一
typestring优惠类型
COUPON | DISCOUNT 枚举值之一
amountstring优惠券面额
activity_idstring活动ID
wxpay_contributestring微信出资
merchant_contributestring商户出资
other_contributestring其他出资
goods_detailobject[]单品列表
goods_idstring商品编码
wxpay_goods_idstring微信支付商品编码
goods_namestring商品名称
quantitynumber商品数量
pricenumber商品单价

参阅 官方文档

Published on the GitHub by TheNorthMemory