uid,2)){ $v = getConfigValue('recharge_switch'); if (!$v) $this->error('维护中,暂时关闭'); $price = input('price'); $pay_type = input('pay_type'); if (!$price || !$pay_type) $this->error('参数错误'); if (!isAmount($price)) $this->error('金额错误'); $order_no = get_order_sn(); $data = [ 'order_no'=>$order_no, 'm_id'=>$this->uid, 'price'=>$price, 'pay_price'=>$price, 'pay_type'=>$pay_type ]; if (Db::name('store_member_recharge')->insert($data)){ $com = true; switch ($pay_type){ case 'ylh5': $callback_url = 'http://'.$_SERVER['SERVER_NAME'].'/pages/mine/qianbao'; $huiju = new HuijuH5Pay(); $notify_url = 'http://'.$_SERVER['SERVER_NAME'].'/index.php/api/Pay/ylrechargeNotify';//回调地址 $result = $huiju->ylh5Pay($order_no,$callback_url,$notify_url,'余额充值',$price,$this->uid,2); if ($result['ra_Code']=='100'){ $retrun_data['order_no'] = $order_no; $retrun_data['pay'] = $result['rc_Result']; }else{ $com = false; } break; case 'zfbh5': $callback_url = 'http://'.$_SERVER['SERVER_NAME'].'/pages/mine/qianbao'; $huiju = new HuijuH5Pay(); $notify_url = 'http://'.$_SERVER['SERVER_NAME'].'/index.php/api/Pay/ylrechargeNotify';//回调地址 $result = $huiju->ylh5Pay($order_no,$callback_url,$notify_url,'余额充值',$price,$this->uid,1); if ($result['ra_Code']=='100'){ $retrun_data['order_no'] = $order_no; $retrun_data['pay'] = $result['rc_Result']; }else{ $com = false; } break; default: $com = false; break; } if ($com){ $this->success('成功',$retrun_data); }else{ $this->error('调起支付失败,请稍后重试'); } }else{ $this->error('失败,请稍后重试'); } }else{ $this->error('请求过快'); } } }