| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- /**
- * 官网的公共控制器类
- *
- */
- namespace app\home\controller;
- use app\common\library\AirwallexPay;
- use think\Controller;
- class Pay extends Controller
- {
- public function airwallex()
- {
- $pay = new AirwallexPay();
- $pay->getToken();
- // $money = input('money', 0, 'intval');
- $orderid = input('orderid', '');
- $goods = input('goods', '');
- $urltype = input('urltype',1);
- $money = cache('memberCoin:real_amount:'.$orderid);
- if($urltype == 1){
- $return_url = 'https://www.46yx.com/coin_airwallex/recharge.html';
- }elseif($urltype == 3){
- $return_url = "https://" . HTTP_HOST_URL . "/v1.pay_return/pay_success_airwallex.html";
- }
- if($money<0){
- echo 'money err'; exit();
- }
- if(!$orderid){
- echo 'orderid err'; exit();
- }
- $result = $pay->createOrder($money, $orderid,$return_url);
- $result['goods'] = $goods;
- $this->assign('result', $result);
- return $this->fetch();
- }
- }
|