Skip to content

发起转账到QQ钱包

当QQ用户参与商户提供的活动并且商户需要转账到QQ钱包时,商户需调用发起转账到QQ钱包接口发起申请转账。同时,支持商户指定回调的URL接收对应的通知信息。

请求参数类型描述
jsonobject声明请求的JSON数据结构
appidstringQQ互联开放平台AppID
out_bill_nostring商户单号
openidstring收款用户OpenID
user_qqstring收款用户QQ号
user_namestring收款用户姓名
transfer_amountnumber转账金额
transfer_remarkstring转账备注
notify_urlstring通知地址
transfer_scene_idstring转账场景ID
1401 枚举值
transfer_scene_report_infosobject[]转账场景报备信息
info_typestring信息类型
info_contentstring信息内容
headersobject声明请求的头参数
Wechatpay-Serialstring微信支付公钥ID/平台证书序列号
php
$instance->v3->fundApp->mchTransfer->transferToQqWalletBills->postAsync([
  'json' => [
    'appid'                       => '102022609',
    'out_bill_no'                 => 'plfk2020042013',
    'openid'                      => 'o-MYE42l80oelYMDE34nYD456Xoy',
    'user_qq'                     => '490379403',
    'user_name'                   => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
    'transfer_amount'             => 400000,
    'transfer_remark'             => '2020年4月报销',
    'notify_url'                  => 'https://www.weixin.qq.com/wxpay/pay.php',
    'transfer_scene_id'           => '1401',
    'transfer_scene_report_infos' => [[
      'info_type'    => '活动名称',
      'info_content' => '注册会员有礼',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/fund-app/mch-transfer/transfer-to-qq-wallet-bills')->postAsync([
  'json' => [
    'appid'                       => '102022609',
    'out_bill_no'                 => 'plfk2020042013',
    'openid'                      => 'o-MYE42l80oelYMDE34nYD456Xoy',
    'user_qq'                     => '490379403',
    'user_name'                   => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
    'transfer_amount'             => 400000,
    'transfer_remark'             => '2020年4月报销',
    'notify_url'                  => 'https://www.weixin.qq.com/wxpay/pay.php',
    'transfer_scene_id'           => '1401',
    'transfer_scene_report_infos' => [[
      'info_type'    => '活动名称',
      'info_content' => '注册会员有礼',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/fund-app/mch-transfer/transfer-to-qq-wallet-bills']->postAsync([
  'json' => [
    'appid'                       => '102022609',
    'out_bill_no'                 => 'plfk2020042013',
    'openid'                      => 'o-MYE42l80oelYMDE34nYD456Xoy',
    'user_qq'                     => '490379403',
    'user_name'                   => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
    'transfer_amount'             => 400000,
    'transfer_remark'             => '2020年4月报销',
    'notify_url'                  => 'https://www.weixin.qq.com/wxpay/pay.php',
    'transfer_scene_id'           => '1401',
    'transfer_scene_report_infos' => [[
      'info_type'    => '活动名称',
      'info_content' => '注册会员有礼',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->fundApp->mchTransfer->transferToQqWalletBills->post([
  'json' => [
    'appid'                       => '102022609',
    'out_bill_no'                 => 'plfk2020042013',
    'openid'                      => 'o-MYE42l80oelYMDE34nYD456Xoy',
    'user_qq'                     => '490379403',
    'user_name'                   => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
    'transfer_amount'             => 400000,
    'transfer_remark'             => '2020年4月报销',
    'notify_url'                  => 'https://www.weixin.qq.com/wxpay/pay.php',
    'transfer_scene_id'           => '1401',
    'transfer_scene_report_infos' => [[
      'info_type'    => '活动名称',
      'info_content' => '注册会员有礼',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/fund-app/mch-transfer/transfer-to-qq-wallet-bills')->post([
  'json' => [
    'appid'                       => '102022609',
    'out_bill_no'                 => 'plfk2020042013',
    'openid'                      => 'o-MYE42l80oelYMDE34nYD456Xoy',
    'user_qq'                     => '490379403',
    'user_name'                   => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
    'transfer_amount'             => 400000,
    'transfer_remark'             => '2020年4月报销',
    'notify_url'                  => 'https://www.weixin.qq.com/wxpay/pay.php',
    'transfer_scene_id'           => '1401',
    'transfer_scene_report_infos' => [[
      'info_type'    => '活动名称',
      'info_content' => '注册会员有礼',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/fund-app/mch-transfer/transfer-to-qq-wallet-bills']->post([
  'json' => [
    'appid'                       => '102022609',
    'out_bill_no'                 => 'plfk2020042013',
    'openid'                      => 'o-MYE42l80oelYMDE34nYD456Xoy',
    'user_qq'                     => '490379403',
    'user_name'                   => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
    'transfer_amount'             => 400000,
    'transfer_remark'             => '2020年4月报销',
    'notify_url'                  => 'https://www.weixin.qq.com/wxpay/pay.php',
    'transfer_scene_id'           => '1401',
    'transfer_scene_report_infos' => [[
      'info_type'    => '活动名称',
      'info_content' => '注册会员有礼',
    ],],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));

转账场景ID(transfer_scene_id) 及 转账场景报备信息(transfer_scene_report_infos) 有如下固定搭配组合要求:

php
'transfer_scene_id'           => '1401', // 活动奖励
'transfer_scene_report_infos' => [       // 固定传两组
  [
    'info_type'    => '活动名称',   // 固定值
    'info_content' => '新会员有礼', // 示例值
  ],
  [
    'info_type'    => '奖励说明',   // 固定值
    'info_content' => '抽奖一等奖', // 示例值
  ],
],
返回字典类型描述
mchidstring商户号
out_bill_nostring商户单号
transfer_bill_nostring微信转账单号
appidstringQQ互联开放平台AppID
statestring单据状态
ACCEPTED | PROCESSING | WAIT_USER_CONFIRM | TRANSFERING | SUCCESS | FAIL | CANCELING | CANCELLED 枚举值之一
transfer_amountnumber转账金额
transfer_remarkstring转账备注
openidstring收款用户OpenID
user_qqstring收款用户QQ号
user_namestring收款用户姓名
fail_reasonstring失败原因
create_timestring单据创建时间
update_timestring最后一次状态变更时间

参阅 官方文档

Published on the GitHub by TheNorthMemory