<?php
namespace app\mobile\controller;
use think\facade\Session;
use think\facade\Db;
use app\common\variable\MsgCode;
use app\common\controller\Pay as PayController;
use app\common\controller\Orders as OrdersController;
use app\common\model\NotifyApplepay as NotifyApplepayModel;
use app\common\model\Orders as OrdersModel;
use app\common\model\PushTask as PushTaskModel;
use app\common\model\UserWx as UserWxModel;

use applepay\ApplePay;

class Pay extends Base
{
    public function generateOrderInfo()
    {
        if (request()->isPost()) {
            $User=Session::get('User');
            $D=request()->post();
            $D['uid']=$User['id'];
            $D['company_id']=$User['company_id'];
            $D['resume_id']=$User['resume_id'];
            $D['role_type']=$User['role_type'];
            $D['channel_type']=request()->ApiInfo['app_id'];
            $D['app']='h5';
            return PayController::generateOrderInfo($D);
        }
    }
    public function getOrderInfoByOtrade()
    {
        if (request()->isPost()) {
            $User=Session::get('User');
            $D=request()->post();
            $D['uid']=$User['id'];
            $D['app']='h5';
            return PayController::getOrderInfoByOtrade($D);
        }
    }
    public function cancelOrder()
    {
        if (request()->isPost()) {
            $User=Session::get('User');
            $D=request()->post();
            $D['uid']=$User['id'];
            return OrdersController::cancelOrder($D,false,false);
        }
    }
    public function getOrderInfoStatus()
    {
        if (request()->isPost()) {
            $User=Session::get('User');
            $D=request()->post();
            $D['uid']=$User['id'];
            return OrdersController::getOrderInfoStatus($D,false,false);
        }
    }
    public function delOrder()
    {
        if (request()->isPost()) {
            $User=Session::get('User');
            $D=request()->post();
            $D['uid']=$User['id'];
            return OrdersController::cancelOrder($D,true,false);
        }
    }
}
