Authored by cailing

h5订单取消时增加间隔检查

... ... @@ -444,4 +444,22 @@ class CartData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 选择支付,校验时间间隔,插入数据
* @param string $uid
* @param string $orderCode
* @param int $payment 14:银联手机支付 15:支付宝手机 18:支付宝wap(wap) 19:微信支付 22:微信wap(wap) 26:QQ钱包手机支付
* @return type
*/
public static function savePrePayInfo($uid, $orderCode, $payment)
{
$param = Yohobuy::param();
$param['method'] = 'app.order.savePrePayInfo';
$param['uid'] = $uid;
$param['orderCode'] = $orderCode;
$param['payment'] = $payment;
return Yohobuy::get(SearchData::getUrl('search'), $param);
}
}
... ...
... ... @@ -3,6 +3,7 @@
use Action\AbstractAction;
use Plugin\Helpers;
use LibModels\Wap\Home\OrderData;
use LibModels\Wap\Home\CartData;
use Plugin\Pay\weixin\JsApiPay;
use Plugin\Pay\weixin\lib\WxPayUnifiedOrder;
use Plugin\Pay\weixin\lib\WxPayApi;
... ... @@ -131,5 +132,33 @@ class PayController extends AbstractAction
} while (false);
}
/**
* 选择支付时,时间间隔校验插入
*/
public function addPaymentIntervalAction()
{
$data = array('code'=>400,'message'=>'','data'=>'');
do {
if (!$this->isAjax()) {
break;
}
$uid = $this->getUid(TRUE);
$orderCode = $this->get('orderCode','');
$payment = $this->get('payment',0);
if (!$uid || !$orderCode || !$payment) {
break;
}
$res = CartData::savePrePayInfo($uid, $orderCode, $payment);
$data = array('code'=>$res['code'],'message'=>$res['message'],'data'=>$res['data']);
} while (false);
$this->echoJson($data);
}
}
... ...