小程序
小游戏
企业微信
微信支付
扫描小程序码分享
微信支付商户调这个接口报错,请问是什么原因?
https://fraud.mch.weixin.qq.com/risk/getpublickey
Array
(
[return_code] => SUCCESS
[return_msg] => SYSTEM_ERR
[result_code] => FAIL
[err_code] => SYSTEM_ERROR
[err_code_desc] => SYSTEM_ERR: INNER_ERR
)
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
composer require wechatpay/wechatpay
<?php require_once('./vendor/autoload.php'); $mchid = ''; $key = ''; $apiclient_key = '/path/to/apiclient_key.pem'; $apiclient_cert = '/path/to/apiclient_cert.pem'; use WeChatPay\Builder; use WeChatPay\Transformer; $instance = Builder::factory([ 'serial' => 'nop', 'privateKey' => 'any', 'certs' => ['any' => null], 'mchid' => $mchid, 'secret' => $key, 'merchant' => [ 'key' => $apiclient_key, 'cert' => $apiclient_cert, ] ]); $res = $instance->v2->risk->getpublickey->post([ 'xml' => [ 'mch_id' => $mchid, 'sign_type' => 'MD5', ], 'security' => true, 'base_uri' => 'https://fraud.mch.weixin.qq.com/', ]); var_dump(Transformer::toArray((string)$res->getBody()));
array(5) { ["return_code"]=> string(7) "SUCCESS" ["return_msg"]=> string(2) "OK" ["result_code"]=> string(7) "SUCCESS" ["mch_id"]=> string(10) "" ["pub_key"]=> string(426) "-----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEA43u03cMF3QEgWDOy2nhUCEu0QxUzNRVgQfghRSmweBSeuufh6keu Qca30T+RwsiUU5tafKZFgeaUbOiQTvtBvt49pYUZKoWufl/RBqWkLtf0eOeaAzRF cAbGPm+ZM8tHhsFBAnrKASe72gZEUGodMsS7jRG9lGQMFPoksUwLVcnXYmHkOQrm KvF8AwkBgdVaMgyYShMys+sLjfrtcMc+SnnTt7T7aJBjsyhoRWvyF3OL+rMwwPfN 4+ugAOopBuGMCwPz2GRXLzzxoJqIhAlO/WxqlII95i0wrI9QL224HbW1C0RWrvGe Ugr8GSWz3ywXPWUf3VIDGLwXZE8gN6liDwIDAQAB -----END RSA PUBLIC KEY----- " }
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
composer require wechatpay/wechatpay
<?php require_once('./vendor/autoload.php'); $mchid = ''; $key = ''; $apiclient_key = '/path/to/apiclient_key.pem'; $apiclient_cert = '/path/to/apiclient_cert.pem'; use WeChatPay\Builder; use WeChatPay\Transformer; $instance = Builder::factory([ 'serial' => 'nop', 'privateKey' => 'any', 'certs' => ['any' => null], 'mchid' => $mchid, 'secret' => $key, 'merchant' => [ 'key' => $apiclient_key, 'cert' => $apiclient_cert, ] ]); $res = $instance->v2->risk->getpublickey->post([ 'xml' => [ 'mch_id' => $mchid, 'sign_type' => 'MD5', ], 'security' => true, 'base_uri' => 'https://fraud.mch.weixin.qq.com/', ]); var_dump(Transformer::toArray((string)$res->getBody()));
array(5) { ["return_code"]=> string(7) "SUCCESS" ["return_msg"]=> string(2) "OK" ["result_code"]=> string(7) "SUCCESS" ["mch_id"]=> string(10) "" ["pub_key"]=> string(426) "-----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEA43u03cMF3QEgWDOy2nhUCEu0QxUzNRVgQfghRSmweBSeuufh6keu Qca30T+RwsiUU5tafKZFgeaUbOiQTvtBvt49pYUZKoWufl/RBqWkLtf0eOeaAzRF cAbGPm+ZM8tHhsFBAnrKASe72gZEUGodMsS7jRG9lGQMFPoksUwLVcnXYmHkOQrm KvF8AwkBgdVaMgyYShMys+sLjfrtcMc+SnnTt7T7aJBjsyhoRWvyF3OL+rMwwPfN 4+ugAOopBuGMCwPz2GRXLzzxoJqIhAlO/WxqlII95i0wrI9QL224HbW1C0RWrvGe Ugr8GSWz3ywXPWUf3VIDGLwXZE8gN6liDwIDAQAB -----END RSA PUBLIC KEY----- " }