1.下载jsapi SDK 放在vendor目录
在WxPayConfig.php 配置参数
const APPID = '**********************'; //公众号appid
const MCHID = '**********************'; //商户id
const KEY = '**********************'; //商户key
const APPSECRET = '**********************';//公众号secret
2.创建Paywx 控制器
<?php
namespace app\mobile\controller;
use think\Controller;
use think\Db;
use app\common\lib\exception\ApiException;
class Paywx extends Common
{
public function __construct()
{
parent::__construct();
}
//统一下单 调取微信支付接口
public function paymentlive()
{
$data = input();
$volume_info = [
'title' => $data['title'],