- 预支付接口回文:输入源“/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' [图片] [图片]
06-02 - 已经认证个人主体的小程序如何进行企业认证?
个人认证已经通过了,但是小程序发布时说需要企业认证,重新认证的时候系统默认给选了个人,不能改怎么办呢?
04-03 - 小程序备案需要提交可使用的体验版本吗?
我的小程序提交备案申请的时候还有bug,可能无法使用,在提交后(初审通过管局审核中)我又更新了体验版,这个情况会影响备案通过吗?
03-27 - 小游戏项目的真机调试和预览按钮为什么被禁用了?
[图片] 如上图,我的小游戏项目在左侧模拟器里能正常运行,但是真机调试和预览按钮为什么被禁用了?
2021-11-01 - 根据工具提示创建了一个新的小游戏项目,开发工具打开后为何报错module "assets/game?
详细报错如下: VM18 WAGame.js:2 Unhandled promise rejection Error: module "assets/game.js" is not defined at require (VM34 WAGameSubContext.js:2) at a (VM34 WAGameSubContext.js:2) at VM46 game.js:1 at require (VM34 WAGameSubContext.js:2) at <anonymous>:6:11 at Object.Module.onRuntimeInitialized (gfx_emsc.js:3730) at doRun (gfx_emsc.js:3806) at run (gfx_emsc.js:3820) at runCaller (gfx_emsc.js:3748) at removeRunDependency (gfx_emsc.js:1437)(env: Windows,mg,1.05.2106300; lib: 2.19.2)
2021-10-26 - 小程序如何开启、设置wifi热点呢?有api吗?
小程序如何开启、设置wifi热点供附近的人连接呢?有相关api吗?
2018-09-28