调用接口:https://api.mch.weixin.qq.com/v3/fund-app/mch-transfer/transfer-bills
报错内容:Client error: `POST https://api.mch.weixin.qq.com/v3/fund-app/mch-transfer/transfer-bills` resulted in a `403 Forbidden` response
- 小程序端支付是能正常使用
- 使用wechatpay/wechatpay php版
- 商家转帐功能已开通
这是提交的参数
$order = [
"appid" => "wx****",
"out_bill_no" => "plasdf12456",
"transfer_scene_id" => "1005",
"openid" => "on5S15FTWo9Mv3iu_cK1kGUsQeUE",
"transfer_amount" => 100,
"transfer_remark" => "测试转帐",
"notify_url" => "https://xxxx.cn/wechat/transfer",
"transfer_scene_report_infos" => array [
0 => array [
"info_type" => "岗位类型",
"info_content" => "外卖员"
],
1 => array [
"info_type" => "报酬说明",
"info_content" => "推广佣金提现"
]
];
$instance = Builder::factory([
'mchid' => $config["mch_id"], // 商户号
'serial' => $config["mch_serial"], //「商户API证书」的「证书序列号」
'privateKey' => Rsa::from($config["ssl_key"], Rsa::KEY_TYPE_PRIVATE), // 商户API私钥
'certs' => [
$config["pub_key_id"] => Rsa::from($config["public_key"], Rsa::KEY_TYPE_PUBLIC), // 微信公钥
],
]);
$resp = $instance->chain(“/v3/fund-app/mch-transfer/transfer-bills”)->post([
'json' => $order,
'headers'=>[
'Wechatpay-Serial'=>$config["pub_key_id"]
]
]);

$response->getBody(); // 返回响应体对象
$response->getBody()->getContents(); // 返回响应体的内容作为字符串
你好 辛苦打印下具体报错信息
[403]ClientException in RequestException.php line 111Client error: `POST https://api.mch.weixin.qq.com/v3/fund-app/mch-transfer/transfer-bills` resulted in a `403 Forbidden` response403 权限异常,打印一下报错返回的 body就知道问题了