多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
微信支付 ``` ~~~ case 'JSAPI': // 小程序 公众号内支付都是用的这个 这个必须要openid // 组装格式 $params = [ 'body' => '充值', 'out_trade_no' => $order['order_no'], 'total_fee' => $order['money']*100, 'attach' => $order['id'], 'trade_type' => 'JSAPI', 'openid' => $openid, 'notify_url' => $notify_url ]; // 返回格式 { "appId": "wx1xxxxxxxxxxxxx", "nonceStr": "u0kw9tx3u5e90tvk8gnfq011fxougzb9", "package": "prepay_id=wx15170742121232620e810ae99e818e0000", "timeStamp": "1626340062", "signType": "MD5", "paySign": "E243D607CE376ED64C8E5F31AD987DFC" } break; case 'MWEB': // H5移动端使用的是这个 返回就是一个地址 跳转就行 $params = [ 'body' => '充值', 'out_trade_no' => $order['order_no'], 'total_fee' => 1, //$order['money']*100 'attach' => $order['id'], 'trade_type' => 'MWEB', 'notify_url' => $notify_url, 'scene_info'=>json_encode([ 'h5_info'=>[ 'type'=>'充值', //场景类型 'wap_url'=>$wxParam['url'],//WAP网站URL地址 'wap_name'=>'充值',//WAP 网站名 ] ]) ]; break; case 'NATIVE': // pc 扫码支付就是这个 也是一个地址 需要自己生成二维码返回前端 $params = [ 'body' => '充值', 'out_trade_no' => $cur['order_no'], 'total_fee' => 1,// $cur['money']*100 'attach' => $cur['id'], 'trade_type' => 'NATIVE', 'notify_url' => $notify_url ]; break; case 'APP': // app支付 会自动调用起手机内的微信来支付 // 组装格式 $params = [ 'body' => 充值', 'out_trade_no' => $order['order_no'], 'total_fee' => $order['money']*100, 'attach' => $order['id'], 'trade_type' => 'APP', 'notify_url' => $notify_url ]; // 返回格式 { "appid": "wx1xxxxxxxxxxxxx", "noncestr": "y7u2aeqv9gpsmynifcgwyq24641ud7qe", "package": "Sign=WXPay", "partnerid": "1234567878", "prepayid": "wx02143020453674d7d828d9f98712120000", "timestamp": 1627885820, "sign": "4924E17AD1394CE9D8BBE7502410836A" } break; ~~~ ```