苹果内购

master
tpingzhang 5 years ago
parent a565d5470a
commit d31cc2217c

@ -185,9 +185,9 @@ class ExchangeController extends BaseController{
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
}
file_put_contents("./Application/Sdk/Scheme/".$request['game_id'].".txt",$request['scheme']);
// file_put_contents("./Application/Sdk/Scheme/".$request['game_id'].".txt",$request['scheme']);
if(get_game_appstatus2($request['game_id'])&&$request['is_create_ordernumer']!=1){ /* 第三方支付 */
if(get_game_appstatus2($request['game_id'])/* &&$request['is_create_ordernumer']!=1 */){ /* 第三方支付 */
$prefix = $request['code'] == 1 ? "SP_" : "PF_"; // SP
$out_trade_no = $prefix.date('Ymd').date('His').sp_random_string(4);
$request['pay_order_number'] = $out_trade_no;
@ -199,7 +199,8 @@ class ExchangeController extends BaseController{
$url = C('PAY_DOMAIN') . '/sdk.php?s=/Spend/'.$payPage.'&user_id='.$request['user_id'].'&game_id='.$request['game_id'].'&type=1'.'&user_token='.$userToken.'&action=pay'.'&extend='.urlencode($request['extend']);
echo base64_encode(json_encode(array('status'=>200,'out_trade_no'=>$out_trade_no,'img'=>$url)));exit;
// 只走第三方支付 不走苹果支付
}elseif(!get_game_appstatus2($request['game_id'])&&$request['is_create_ordernumer']==1){ /* 废弃 苹果支付 */
}elseif(!get_game_appstatus2($request['game_id'])/* &&$request['is_create_ordernumer']==1 */){ /* 废弃 苹果支付 */
#获取订单信息
$prefix = $request['code'] == 1 ? "SP_" : "PF_";
$out_trade_no = $prefix.date('Ymd').date('His').sp_random_string(4);
@ -207,7 +208,7 @@ class ExchangeController extends BaseController{
$request['pay_order_number'] = $out_trade_no;
$request['pay_status'] = 0;
$request['pay_way'] = 7;
$request['title'] = $request['productId'];
// $request['title'] = $request['productId'];
$request['spend_ip'] = get_client_ip();
if($request['code'] == 1 ){
#TODO添加消费记录

Loading…
Cancel
Save