1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- // +---------------------------------------------------------------------+
- // | NiuCloud | [ WE CAN DO IT JUST NiuCloud ] |
- // +---------------------------------------------------------------------+
- // | Copy right 2019-2029 www.niucloud.com |
- // +---------------------------------------------------------------------+
- // | Author | NiuCloud <niucloud@outlook.com> |
- // +---------------------------------------------------------------------+
- // | Repository | https://github.com/niucloud/framework.git |
- // +---------------------------------------------------------------------+
- declare (strict_types = 1);
- namespace addon\wechatpay\event;
- use addon\wechatpay\model\Pay as PayModel;
- /**
- * 生成支付
- */
- class Pay
- {
- /**
- * 支付
- */
- public function handle($params)
- {
- // print_r($params);die;
- if($params["pay_type"] == "wechatpay"){
- $app_type = $params['app_type'];
- $is_weapp = 0;
- switch ($app_type){
- case 'h5' :
- $trade_type = "MWEB";
- break;
- case 'wechat' :
- $trade_type = "JSAPI";
- break;
- case 'weapp' :
- $is_weapp = 1;
- $trade_type = "JSAPI";
- break;
- case 'app' :
- $trade_type = "APP";
- break;
- case 'pc' :
- $trade_type = "NATIVE";
- break;
- }
- $params["trade_type"] = $trade_type;
- $pay_model = new PayModel($is_weapp);
- print_r($params);die;
- $result = $pay_model->pay($params);
- return $result;
- }
- }
- }
|