小程序
小游戏
企业微信
微信支付
扫描小程序码分享
"code": "PARAM_ERROR",
"message": "结算银行账户开户名称(bank_account_info/account_name)有误:选择“对公银行账户”时,开户名称必须与营业执照或登记证书上的“商户名称”一致"
看网上一些人说是 utf-8 编码问题,微信支付客服也说是我传过来的中文被编码了。可具体该怎么做呢。好难啊~~~~
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
PHP代码上的164-165行不用加;
postman截图上array,明显能看到 id_card_name 没有加密;加密代码在lib readme上有写,如:
<?php use WeChatPay\Crypto\Rsa; // 做一个匿名方法,供后续方便使用,$platformPublicKeyInstance 见初始化章节 $encryptor = static function(string $msg) use ($platformPublicKeyInstance): string { return Rsa::encrypt($msg, $platformPublicKeyInstance); }; $resp = $instance ->chain('v3/applyment4sub/applyment/') ->post([ 'json' => [ 'business_code' => 'APL_98761234', 'contact_info' => [ 'contact_name' => $encryptor('张三'), 'contact_id_number' => $encryptor('110102YYMMDD888X'), 'mobile_phone' => $encryptor('13000000000'), 'contact_email' => $encryptor('abc123@example.com'), ], //... ], 'headers' => [ // $platformCertificateSerial 见初始化章节 'Wechatpay-Serial' => $platformCertificateSerial, ], ]);
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
"account_number" => $encryptor($args["account_number"]),
]
],
'headers' => [
'Wechatpay-Serial' => $platformCertificateSerial,
]);
$this->logger(["getBody" => $resp->getBody()], 'applyMent', true, true);
$result = json_decode((string)$resp->getBody(), true);
$this->logger(["response" => $result], 'applyMent', true, true);
if ($resp->getStatusCode() == 200) {
return $this->returnRes(true, "success", $result);
} else {
//调用失败
return $this->returnRes(false, "进阶失败", $result);
}
} catch (\Exception $e) {
// 进行错误处理
if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
$r = $e->getResponse();
$r = json_decode((str_replace(array("/r","/n","/r/n"),"",$r->getBody())), true);
return $this->returnRes(false, $r["message"], $r);
这个就是utf-8 编码问题
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
PHP代码上的164-165行不用加;
postman截图上array,明显能看到 id_card_name 没有加密;加密代码在lib readme上有写,如:
<?php use WeChatPay\Crypto\Rsa; // 做一个匿名方法,供后续方便使用,$platformPublicKeyInstance 见初始化章节 $encryptor = static function(string $msg) use ($platformPublicKeyInstance): string { return Rsa::encrypt($msg, $platformPublicKeyInstance); }; $resp = $instance ->chain('v3/applyment4sub/applyment/') ->post([ 'json' => [ 'business_code' => 'APL_98761234', 'contact_info' => [ 'contact_name' => $encryptor('张三'), 'contact_id_number' => $encryptor('110102YYMMDD888X'), 'mobile_phone' => $encryptor('13000000000'), 'contact_email' => $encryptor('abc123@example.com'), ], //... ], 'headers' => [ // $platformCertificateSerial 见初始化章节 'Wechatpay-Serial' => $platformCertificateSerial, ], ]);
"account_number" => $encryptor($args["account_number"]),
]
],
'headers' => [
'Wechatpay-Serial' => $platformCertificateSerial,
],
]);
$this->logger(["getBody" => $resp->getBody()], 'applyMent', true, true);
$result = json_decode((string)$resp->getBody(), true);
$this->logger(["response" => $result], 'applyMent', true, true);
if ($resp->getStatusCode() == 200) {
return $this->returnRes(true, "success", $result);
} else {
//调用失败
return $this->returnRes(false, "进阶失败", $result);
}
} catch (\Exception $e) {
// 进行错误处理
if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
$r = $e->getResponse();
$r = json_decode((str_replace(array("/r","/n","/r/n"),"",$r->getBody())), true);
return $this->returnRes(false, $r["message"], $r);
}
}
}
这个就是utf-8 编码问题