- 小程序中数组赋值后,显示长度为0,转化成字符串为空. 求解?
[图片][图片]
2021-11-05 - 小程序发放代金券,code换取的openid,仍提示 appid与openid不匹配,求解?
小程序appid= wx65abf9de01c6955f 用户登录后,用code换取的openid = okTtO5TKc6evEH_guNljYmAXauSs 商户号:1526204451,已与appid绑定,有java做的后台能正常发券,重新用wechatpay-php开发后遇到问题 调用结果{"code":"INVALID_REQUEST","message":"appid与openid不匹配"} php源码如下: public function wxSendCoupons(array $params){ $openid='okTtO5TKc6evEH_guNljYmAXauSs'; $wx = $this->getWxApiInstance(); $resp = $wx ->v3->marketing->favor->users->$openid->coupons ->postAsync([ 'headers'=>['Content-type'=>"application/json;charset-utf8"], 'json'=>[ 'stock_id'=>'16007953', 'out_request_no'=>'1526204451'.date('Ymd').'-'.'1134123412', 'stock_creator_mchid'=>'1526204451', 'appid'=>'wx65abf9de01c6955f' ] ]) ->then(static function ($response) { $s = $response->getBoday(); error_log('return Data:' . $s, 3, self::$infoFile); echo $s; }) ->otherwise(static function ($e) { if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) { $s = $e->getResponse()->getBody(); error_log('return Data:' . $s, 3, self::$infoFile); echo $s; return $s; } }) ->wait(); } [图片][图片]
2021-11-02