<?php
namespace app\common\game;
use \think\Db;
use \think\Cookie;
use \think\Session;
use \think\Cache;
use think\Controller;

class Alipay_dmf extends Controller {
    
    static function pay($ck,$money,$land_id=''){
        
          $post = array(
             'url' => base64_encode((config('url'))),
             'order_num' => $ck['order_num'], 
             'money' => $money,
             'alipay_dmf_key' => $ck['alipay_dmf_key']
          );
             
           $result =json_decode(curl("http://api.fssy.cc/pay/alipay/pay",http_build_query($post),''),true);

           if($result['code'] && $result['code']=='10000' && $result['qr_code']){
               $url = $result['qr_code'];
               $msg = 'ok';
           }else{
               $msg = '发起支付失败,请联系客服';
           }
        

           if (isMobile()){
              $mob='alipay_h5';
           }else{
          	  $mob='alipay_ewm';
           }
          
           $order['order_id']=$ck['order_num'];
	       $order['order_url']=$url;
	       $order['alipay_url']=$result['qr_code'];
	       $order['order_message']=$msg;
	       $order['order_mb']=$mob;
           $order['hy_sign']='';
           $order['hy_time']='';
	       return $order;
        
    }
}