- 想在小程序页面的根节点 <page> 上动态加一个 class 如何实现?
如题所述
2023-08-25 - 云托管微信支付得到"参数格式校验错误",问题在哪里?
云托管的后端发起支付,得到错误 {"errcode":0,"errmsg":"ok","respdata":{"return_code":"FAIL","return_msg":"参数格式校验错误"}} 后端 php 代码如下(curl部分来自 TCloudBase/wxcloudrun-pay-demo ) public function directPay() { $url = 'http://api.weixin.qq.com/_/pay/unifiedOrder'; $hdr = Request::header(); $data = array( "out_trade_no" => time(), "body" => "测试支付", "total_fee" => 50, "openid" => $hdr["x-wx-openid"], "env_id" => $hdr["x-wx-env"], "spbill_create_ip" => $hdr["x-original-forwarded-for"], "sub_mch_id" => "151195123", "callback_type" => 2, "container" => array( "service" => $hdr["x-wx-service"], "path" => "/api/payback", ) ); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode($data), CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ), )); $response = curl_exec($curl); curl_close($curl); return $response; } 很急!
2023-05-06