Skip to content

提交付款码支付

通过本接口提交微信支付付款码支付订单。

请求参数类型描述
base_uristring声明接入点https://apihk.mch.weixin.qq.com/(香港接入)
jsonobject声明请求的JSON数据结构
mchidstring商户号
appidstringAPPID
sub_mchidstring子商户号
sp_mchidstring机构商户号
sp_appidstring机构APPID
sub_appidstring子商户APPID
descriptionstring商品描述
attachstring商户数据
out_trade_nostring商户订单号
goods_tagstring商品标记
trade_typestring交易类型
limit_paystring指定支付方式
merchant_category_codestringMCC码
payerobject支付者
auth_codestring授权码
amountobject订单金额
totalinteger总金额
currencystring货币类型
scene_infoobject场景信息
device_idstring商户端设备号
device_ipstring商户端设备IP
payer_client_ipstring用户终端IP
operator_idstring操作员ID
store_infoobject商户门店信息
idstring编号
namestring名称
addressstring详细地址
detailobject[]优惠功能
cost_priceinteger订单原价
receipt_idstring商品小票ID
goods_detailobject[]单品列表
goods_idstring商品编码
wxpay_goods_idstring微信侧商品编码
goods_namestring商品名称
quantityinteger商品数量
priceinteger商品单价
php
$instance->v3->global->micropay->transactions->pay->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sp_mchid' => '1900000100',
    'sp_appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888888',
    'description' => 'image形象店-深圳腾大- QQ公仔',
    'attach' => '自定义数据',
    'out_trade_no' => '1217752501201407033233368018',
    'goods_tag' => 'WXG',
    'trade_type' => 'MICROPAY',
    'limit_pay' => 'no_credit',
    'merchant_category_code' => '1011',
    'payer' => [
      'auth_code' => '120061098828009406',
    ],
    'amount' => [
      'total' => 888,
      'currency' => 'HKD',
    ],
    'scene_info' => [
      'device_id' => '013467007045764',
      'device_ip' => '128.0.0.1',
      'payer_client_ip' => '128.0.0.1',
      'operator_id' => '123145',
      'store_info' => [
        'id' => '0001',
        'name' => '腾讯大厦分店',
        'address' => '广东省深圳市南山区科技中一道10000号',
      ],
    ],
    'detail' => [[
      'cost_price' => 608800,
      'receipt_id' => 'wx123',
      'goods_detail' => [[
        'goods_id' => '商品编码',
        'wxpay_goods_id' => '1001',
        'goods_name' => 'iPhone6s 16G',
        'quantity' => 1,
        'price' => 528800,
      ],],
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/global/micropay/transactions/pay')->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sp_mchid' => '1900000100',
    'sp_appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888888',
    'description' => 'image形象店-深圳腾大- QQ公仔',
    'attach' => '自定义数据',
    'out_trade_no' => '1217752501201407033233368018',
    'goods_tag' => 'WXG',
    'trade_type' => 'MICROPAY',
    'limit_pay' => 'no_credit',
    'merchant_category_code' => '1011',
    'payer' => [
      'auth_code' => '120061098828009406',
    ],
    'amount' => [
      'total' => 888,
      'currency' => 'HKD',
    ],
    'scene_info' => [
      'device_id' => '013467007045764',
      'device_ip' => '128.0.0.1',
      'payer_client_ip' => '128.0.0.1',
      'operator_id' => '123145',
      'store_info' => [
        'id' => '0001',
        'name' => '腾讯大厦分店',
        'address' => '广东省深圳市南山区科技中一道10000号',
      ],
    ],
    'detail' => [[
      'cost_price' => 608800,
      'receipt_id' => 'wx123',
      'goods_detail' => [[
        'goods_id' => '商品编码',
        'wxpay_goods_id' => '1001',
        'goods_name' => 'iPhone6s 16G',
        'quantity' => 1,
        'price' => 528800,
      ],],
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/global/micropay/transactions/pay']->postAsync([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sp_mchid' => '1900000100',
    'sp_appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888888',
    'description' => 'image形象店-深圳腾大- QQ公仔',
    'attach' => '自定义数据',
    'out_trade_no' => '1217752501201407033233368018',
    'goods_tag' => 'WXG',
    'trade_type' => 'MICROPAY',
    'limit_pay' => 'no_credit',
    'merchant_category_code' => '1011',
    'payer' => [
      'auth_code' => '120061098828009406',
    ],
    'amount' => [
      'total' => 888,
      'currency' => 'HKD',
    ],
    'scene_info' => [
      'device_id' => '013467007045764',
      'device_ip' => '128.0.0.1',
      'payer_client_ip' => '128.0.0.1',
      'operator_id' => '123145',
      'store_info' => [
        'id' => '0001',
        'name' => '腾讯大厦分店',
        'address' => '广东省深圳市南山区科技中一道10000号',
      ],
    ],
    'detail' => [[
      'cost_price' => 608800,
      'receipt_id' => 'wx123',
      'goods_detail' => [[
        'goods_id' => '商品编码',
        'wxpay_goods_id' => '1001',
        'goods_name' => 'iPhone6s 16G',
        'quantity' => 1,
        'price' => 528800,
      ],],
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->global->micropay->transactions->pay->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sp_mchid' => '1900000100',
    'sp_appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888888',
    'description' => 'image形象店-深圳腾大- QQ公仔',
    'attach' => '自定义数据',
    'out_trade_no' => '1217752501201407033233368018',
    'goods_tag' => 'WXG',
    'trade_type' => 'MICROPAY',
    'limit_pay' => 'no_credit',
    'merchant_category_code' => '1011',
    'payer' => [
      'auth_code' => '120061098828009406',
    ],
    'amount' => [
      'total' => 888,
      'currency' => 'HKD',
    ],
    'scene_info' => [
      'device_id' => '013467007045764',
      'device_ip' => '128.0.0.1',
      'payer_client_ip' => '128.0.0.1',
      'operator_id' => '123145',
      'store_info' => [
        'id' => '0001',
        'name' => '腾讯大厦分店',
        'address' => '广东省深圳市南山区科技中一道10000号',
      ],
    ],
    'detail' => [[
      'cost_price' => 608800,
      'receipt_id' => 'wx123',
      'goods_detail' => [[
        'goods_id' => '商品编码',
        'wxpay_goods_id' => '1001',
        'goods_name' => 'iPhone6s 16G',
        'quantity' => 1,
        'price' => 528800,
      ],],
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/global/micropay/transactions/pay')->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sp_mchid' => '1900000100',
    'sp_appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888888',
    'description' => 'image形象店-深圳腾大- QQ公仔',
    'attach' => '自定义数据',
    'out_trade_no' => '1217752501201407033233368018',
    'goods_tag' => 'WXG',
    'trade_type' => 'MICROPAY',
    'limit_pay' => 'no_credit',
    'merchant_category_code' => '1011',
    'payer' => [
      'auth_code' => '120061098828009406',
    ],
    'amount' => [
      'total' => 888,
      'currency' => 'HKD',
    ],
    'scene_info' => [
      'device_id' => '013467007045764',
      'device_ip' => '128.0.0.1',
      'payer_client_ip' => '128.0.0.1',
      'operator_id' => '123145',
      'store_info' => [
        'id' => '0001',
        'name' => '腾讯大厦分店',
        'address' => '广东省深圳市南山区科技中一道10000号',
      ],
    ],
    'detail' => [[
      'cost_price' => 608800,
      'receipt_id' => 'wx123',
      'goods_detail' => [[
        'goods_id' => '商品编码',
        'wxpay_goods_id' => '1001',
        'goods_name' => 'iPhone6s 16G',
        'quantity' => 1,
        'price' => 528800,
      ],],
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/global/micropay/transactions/pay']->post([
  'base_uri' => 'https://apihk.mch.weixin.qq.com/', // 接入点(香港接入)
  'json' => [
    'mchid' => '1900000109',
    'appid' => 'wx8888888888888888',
    'sub_mchid' => '1900000109',
    'sp_mchid' => '1900000100',
    'sp_appid' => 'wx8888888888888888',
    'sub_appid' => 'wx8888888888888888',
    'description' => 'image形象店-深圳腾大- QQ公仔',
    'attach' => '自定义数据',
    'out_trade_no' => '1217752501201407033233368018',
    'goods_tag' => 'WXG',
    'trade_type' => 'MICROPAY',
    'limit_pay' => 'no_credit',
    'merchant_category_code' => '1011',
    'payer' => [
      'auth_code' => '120061098828009406',
    ],
    'amount' => [
      'total' => 888,
      'currency' => 'HKD',
    ],
    'scene_info' => [
      'device_id' => '013467007045764',
      'device_ip' => '128.0.0.1',
      'payer_client_ip' => '128.0.0.1',
      'operator_id' => '123145',
      'store_info' => [
        'id' => '0001',
        'name' => '腾讯大厦分店',
        'address' => '广东省深圳市南山区科技中一道10000号',
      ],
    ],
    'detail' => [[
      'cost_price' => 608800,
      'receipt_id' => 'wx123',
      'goods_detail' => [[
        'goods_id' => '商品编码',
        'wxpay_goods_id' => '1001',
        'goods_name' => 'iPhone6s 16G',
        'quantity' => 1,
        'price' => 528800,
      ],],
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
idstring微信支付订单号
mchidstring商户号
appidstringAPPID
sub_mchidstring子商户号
sp_mchidstring机构商户号
sp_appidstring机构APPID
sub_appidstring子商户APPID
out_trade_nostring商户订单号
trade_typestring交易类型
trade_statestring交易状态
trade_state_descstring交易状态描述
bank_typestring付款银行
attachstring商户数据
success_timestring支付完成时间
payerobject支付者
openidstring用户标识
sp_openidstring用户标识(机构)
sub_openidstring用户标识(特约商户)
amountobject订单金额
totalinteger订单金额
currencystring货币类型
payer_totalinteger用户支付金额
payer _currencystring支付货币类型
exchange_rateobject汇率
typestring汇率类型
rateinteger汇率值
detailobject[]优惠功能
promotion_idstring券ID
namestring优惠名称
scopestring优惠范围
typestring优惠类型
amountinteger优惠券面额
currencystring货币类型
activity_idstring活动ID
wechatpay_contribute_amountinteger微信出资
merchant_contribute_amountinteger商户出资
other_contribute_amountinteger其他出资
goods_detailobject[]单品列表
goods_idstring商品编码
goods_remarkstring商品备注
quantityinteger商品数量
priceinteger商品价格

参阅 官方文档

Published on the GitHub by TheNorthMemory