总而言之,微信出错概率非常大,官方也没有明确说明,感觉就是可垃圾,弄得对接困难有啥意义
预支付接口回文:输入源“/appid”映射到字段“公众号I (truncated...)是什么原因?在调用“JSAPI下单”接口/v3/pay/transactions/jsapi 时响应内容里提示:“输入源“/appid”映射到字段“公众号I (truncated...)” 我确认我填写的appid是小程序的不是公众号的,使用的是官方的wechatpay-apiv3/wechatpay-php sdk,核心代码如下: // 获取预支付id public static function orderInfo($p){ $url = 'https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi'; // $url = '/v3/pay/transactions/jsapi'; $appId = Config::WxAppId; $mchId = Config::WxMchId; $mchName = Config::WxMchName; $serial_no = Config::WxPayCartNo; $orderNo = dechex(time()) . rand(1000, 9999); $notify_url = Config::Host . Config::BasePath . '/wechat/payNotify'; $score = $p['score']; $openId = '我自己的openid'; // 从本地文件中加载「商户API私钥」,「商户API私钥」会用来生成请求的签名 $merchantPrivateKey = file_get_contents(SS_PLUGIN_APP_DIR.'/certs/apiclient_key.pem'); $merchantPrivateKeyInstance = Rsa::from($merchantPrivateKey, Rsa::KEY_TYPE_PRIVATE); // 从本地文件中加载「微信支付平台证书」,用来验证微信支付应答的签名 $platformCertificate = file_get_contents(SS_PLUGIN_APP_DIR.'/certs/apiclient_cert.pem'); $platformPublicKeyInstance = Rsa::from($platformCertificate, Rsa::KEY_TYPE_PUBLIC); // 从「微信支付平台证书」中获取「证书序列号」 $platformCertificateSerial = PemUtil::parseCertificateSerialNo($platformCertificate); // 构造一个 APIv3 客户端实例 $instance = Builder::factory([ 'mchid' => $mchId, 'serial' => $serial_no, 'privateKey' => $merchantPrivateKeyInstance, 'certs' => [ $platformCertificateSerial => $platformPublicKeyInstance, ], ]); $data = array( "appid" => $appId, "mchid" => $mchId, "description" => "$mchName-积分充值-$score", "out_trade_no" => $orderNo, "time_expire" => time() + 600, "attach" => "自定义数据说明", "notify_url" => $notify_url, "amount" => array( "total" => $p['price'], "currency" => "CNY" ), "payer" => array( "openid" => $openId ) ); try{ $rep = $instance->chain($url)->post($data)->getBody(); return json_decode($rep); }catch(Exception $e){ $code = $e->getCode(); return array('code' => $code, 'rep' => $e->getMessage(), 'req' => $data); } } // $e->getMessage(): 'Client error: `POST https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi` resulted in a `400 Bad Request` response:\n{"code":"PARAM_ERROR","detail":{"location":null,"value":""},"message":"输入源“/appid”映射到字段“公众号I (truncated...)\n' [图片] [图片]
2024-11-29微信支付对接真是可垃圾,弄得大家都对接困难,意义何在
输入源“/appid”映射到字段“公众号ID”必填性规则校验失败,此字段为必填项?native 统一下单接口,返回{ "code":"PARAM_ERROR", "detail":{ "location":null, "value":"" }, "message":"输入源“/appid”映射到字段“公众号ID”必填性规则校验失败,此字段为必填项" } 请求实体{"amount":{"total":"0.1","currency":"CNY"},"mchid":"1601085035","out_trade_no":"12177525012014_07033233368012","appid":"wxf6be053b7d935422","description":"paytest","attach":"desc","notify_url":"https://ddclfpabxapi.jdcgl.com/wxPayBack"}
2024-11-29[图片] [图片] 这是为什么 代码和文件 啥都有 就不知道为何出现这种问题,请大佬们解答
私钥获取过程中显示:系统找不到路径,这是怎么回事?微信支付中显示正常[图片] 但是点击私钥的pem时就是找不到路径,重新导入也不行[图片] [图片]
2024-11-29看来我们都遇见过这个问题,到底是哪里出错了?参数检查无误,到底什么鬼东西
"输入源“/appid”映射到字段“公众号ID”必填性规则校验失败,此字段为必填项"?app微信支付v3接口 返回"输入源“/appid”映射到字段“公众号ID”必填性规则校验失败,此字段为必填项" 开放平台中app已申请并AppID已关联绑定微信支付商户号 调用返回 [图片]
2024-11-27