小程序
小游戏
企业微信
微信支付
扫描小程序码分享
调用微信支付 使用错误的transfer_scene_id 10101 微信接口返回错误, 这是正常的校验返回。
调用微信支付 使用我后台设置的transfer_scene_id的1010 显示403 请问这是什么问题?
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
user_name 是空值的话,连key也不要传,用法文档可以参考这里 https://wechatpay.im/openapi/v3/fund-app/mch-transfer/transfer-bills/transfer
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
try {
$response = $instance->chain('v3/fund-app/mch-transfer/transfer-bills/transfer')->post([
'json' => [
'appid' => 'wxf636efh567hg4356',
'out_bill_no' => 'plfk2020042013',
'openid' => 'o-MYE42l80oelYMDE34nYD456Xoy',
'user_name' => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45',
'transfer_amount' => 400000,
'transfer_remark' => '2020年4月报销',
'notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php',
'user_recv_perception' => '现金奖励',
'transfer_scene_id' => '1000',
'transfer_scene_report_infos' => [[
'info_type' => '活动名称',
'info_content' => '注册会员有礼',
],],
'authorization_id' => '201202504101000123456789012',
'sponsor_mchid' => '1900001109',
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
]);
} catch (\Exception $e) {
// 进行错误处理
echo $e->getMessage(), PHP_EOL;
if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
$r = $e->getResponse();
echo $r->getStatusCode() . ' ' . $r->getReasonPhrase(), PHP_EOL;
echo (string) $r->getBody(), PHP_EOL, PHP_EOL, PHP_EOL;
}
echo $e->getTraceAsString(), PHP_EOL;
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
user_name 是空值的话,连key也不要传,用法文档可以参考这里 https://wechatpay.im/openapi/v3/fund-app/mch-transfer/transfer-bills/transfer
try {$response = $instance->chain('v3/fund-app/mch-transfer/transfer-bills/transfer')->post(['json' => ['appid' => 'wxf636efh567hg4356','out_bill_no' => 'plfk2020042013','openid' => 'o-MYE42l80oelYMDE34nYD456Xoy','user_name' => '757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45','transfer_amount' => 400000,'transfer_remark' => '2020年4月报销','notify_url' => 'https://www.weixin.qq.com/wxpay/pay.php','user_recv_perception' => '现金奖励','transfer_scene_id' => '1000','transfer_scene_report_infos' => [['info_type' => '活动名称','info_content' => '注册会员有礼',],],'authorization_id' => '201202504101000123456789012','sponsor_mchid' => '1900001109',],'headers' => ['Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',],]);} catch (\Exception $e) {// 进行错误处理echo $e->getMessage(), PHP_EOL;if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {$r = $e->getResponse();echo $r->getStatusCode() . ' ' . $r->getReasonPhrase(), PHP_EOL;echo (string) $r->getBody(), PHP_EOL, PHP_EOL, PHP_EOL;}echo $e->getTraceAsString(), PHP_EOL;}