|
|
|
@ -90,8 +90,7 @@ class AppleController extends BaseController{
|
|
|
|
|
public function apple_alipay_pay($user_id,$game_id){
|
|
|
|
|
#获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组
|
|
|
|
|
//echo json_encode(['code'=>0,'msg'=> $user_id."game:".$game_id]);exit;
|
|
|
|
|
$request = $this->get_sdk_request($game_id);
|
|
|
|
|
$request['pay_order_number'] = "SP_".date('Ymd').date('His').sp_random_string(4);
|
|
|
|
|
$request = $this->get_sdk_request($game_id, $user_id);
|
|
|
|
|
$request['pay_status'] = 0;
|
|
|
|
|
$request['pay_way'] = C("PAY_WAY.ALIPAY");
|
|
|
|
|
$request['spend_ip'] = get_client_ip();
|
|
|
|
@ -360,8 +359,7 @@ class AppleController extends BaseController{
|
|
|
|
|
*/
|
|
|
|
|
public function apple_weixin_pay($user_id,$game_id)
|
|
|
|
|
{
|
|
|
|
|
$request = $this->get_sdk_request($game_id);
|
|
|
|
|
$request['pay_order_number'] = "SP_".date('Ymd').date('His').sp_random_string(4);
|
|
|
|
|
$request = $this->get_sdk_request($game_id, $user_id);
|
|
|
|
|
$request['pay_status'] = 0;
|
|
|
|
|
$request['pay_way'] = C("PAY_WAY.WEIXIN");
|
|
|
|
|
$request['spend_ip'] = get_client_ip();
|
|
|
|
@ -400,11 +398,13 @@ class AppleController extends BaseController{
|
|
|
|
|
//$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
|
|
|
|
|
redirect(U('Spend/notice_v1',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'订单号重复,请关闭支付页面重新支付')));exit;
|
|
|
|
|
}
|
|
|
|
|
$table = $request['code'] == 1 ? "spend" : "deposit";
|
|
|
|
|
/* $table = $request['code'] == 1 ? "spend" : "deposit";
|
|
|
|
|
$prefix = $request['code'] == 1 ? "SP_" : "PF_";
|
|
|
|
|
$request['pay_way'] = 3;
|
|
|
|
|
$request['pay_order_number'] = $prefix."_".date('Ymd').date('His').sp_random_string(4); */
|
|
|
|
|
$request['pay_way'] = C('PAY_WAY.WEIXIN');
|
|
|
|
|
$request['pay_status'] = 0;
|
|
|
|
|
$request['spend_ip'] = get_client_ip();
|
|
|
|
|
|
|
|
|
|
//折扣
|
|
|
|
|
$user = get_user_entity($request['user_id']);
|
|
|
|
|
$discount = $this->get_discount($request['game_id'],$user['promote_id'],$request['user_id']);
|
|
|
|
@ -644,8 +644,14 @@ class AppleController extends BaseController{
|
|
|
|
|
* @author 鹿文学
|
|
|
|
|
*/
|
|
|
|
|
public function apple_platform_pay($user_id,$game_id) {
|
|
|
|
|
$file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt");
|
|
|
|
|
$request = json_decode(think_decrypt($file),true);
|
|
|
|
|
/* $file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt");
|
|
|
|
|
$request = json_decode(think_decrypt($file),true); */
|
|
|
|
|
|
|
|
|
|
$request = $this->get_sdk_request($game_id, $user_id);
|
|
|
|
|
$request['pay_status'] = 0;
|
|
|
|
|
// $request['pay_way'] = C("PAY_WAY.ALIPAY");
|
|
|
|
|
$request['spend_ip'] = get_client_ip();
|
|
|
|
|
$out_trade_no = $request['pay_order_number'];
|
|
|
|
|
|
|
|
|
|
$code = $_POST['way'];
|
|
|
|
|
|
|
|
|
@ -675,7 +681,6 @@ class AppleController extends BaseController{
|
|
|
|
|
// $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
|
|
|
|
|
redirect(U('Spend/notice_v1',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'订单号重复,请关闭支付页面重新支付')));exit;
|
|
|
|
|
}
|
|
|
|
|
$out_trade_no = "PF_" . date('Ymd') . date('His') . sp_random_string(4);
|
|
|
|
|
$request['order_number'] = $out_trade_no;
|
|
|
|
|
$request['pay_order_number'] = $out_trade_no;
|
|
|
|
|
$request['out_trade_no'] = $out_trade_no;
|
|
|
|
|