|
|
|
@ -17,7 +17,9 @@ use Sdk\Model\PayChannelIntentionModel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PayH5Controller extends BaseController{
|
|
|
|
|
|
|
|
|
|
const ALI_PAY = 1;
|
|
|
|
|
const WX_PAY = 2;
|
|
|
|
|
const EXPRESS_PAY = 4;
|
|
|
|
|
/**
|
|
|
|
|
* 平台币 alipay 充值
|
|
|
|
|
*/
|
|
|
|
@ -66,7 +68,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$game = M('game', 'tab_')->where(['id' => $game_id])->find();
|
|
|
|
|
$pay_info = get_payment_config(1, $game, $request['user_id']);
|
|
|
|
|
$pay_info = get_payment_config(self::ALI_PAY, $game, $request['user_id']);
|
|
|
|
|
if ($pay_info['code'] != 0) {
|
|
|
|
|
echo json_encode(['code'=>1010,'msg'=> $pay_info['msg']]);
|
|
|
|
|
exit;
|
|
|
|
@ -75,6 +77,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$pay_info = $pay_info['data'];
|
|
|
|
|
$pay_conf['id'] = $pay_info['id'];
|
|
|
|
|
$pay_conf['merchant_id'] = $pay_info['id'];
|
|
|
|
|
$pay_conf['merchant_way'] = self::ALI_PAY;
|
|
|
|
|
|
|
|
|
|
if ($pay_info['channel'] == 1) { // 支付宝官方
|
|
|
|
|
|
|
|
|
@ -358,7 +361,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
|
|
|
|
|
$this->other_price($request);
|
|
|
|
|
|
|
|
|
|
$pay_info = get_payment_config(1, $game, $request['user_id']);
|
|
|
|
|
$pay_info = get_payment_config(self::ALI_PAY, $game, $request['user_id']);
|
|
|
|
|
if ($pay_info['code'] != 0) {
|
|
|
|
|
echo json_encode(['code'=>1010,'msg'=> $pay_info['msg']]);
|
|
|
|
|
exit;
|
|
|
|
@ -367,6 +370,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$pay_info = $pay_info['data'];
|
|
|
|
|
$pay_conf['id'] = $pay_info['id'];
|
|
|
|
|
$pay_conf['merchant_id'] = $pay_info['id'];
|
|
|
|
|
$pay_conf['merchant_way'] = self::ALI_PAY;
|
|
|
|
|
if ($pay_info['channel'] == 1) { // 支付宝官方
|
|
|
|
|
// $game_set_data = get_game_set_info($request['game_id']);
|
|
|
|
|
$request['apitype'] = "alipay";
|
|
|
|
@ -728,7 +732,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$game = M('game', 'tab_')->where(['id' => $game_id])->find();
|
|
|
|
|
$pay_info = get_payment_config(2, $game, $request['user_id']);
|
|
|
|
|
$pay_info = get_payment_config(self::WX_PAY, $game, $request['user_id']);
|
|
|
|
|
if ($pay_info['code'] != 0) {
|
|
|
|
|
echo json_encode(['code'=>1010,'msg'=> $pay_info['msg']]);
|
|
|
|
|
exit;
|
|
|
|
@ -737,6 +741,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$pay_info = $pay_info['data'];
|
|
|
|
|
$pay_conf['id'] = $pay_info['id'];
|
|
|
|
|
$pay_conf['merchant_id'] = $pay_info['id'];
|
|
|
|
|
$pay_conf['merchant_way'] = self::WX_PAY;
|
|
|
|
|
|
|
|
|
|
//0 官方 1威富通 2俊付通
|
|
|
|
|
// if (get_wx_pay_type() == 0) {
|
|
|
|
@ -748,7 +753,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/user_token/".$this->userToken."/paytype/weixinpay/game_id/{$game_id}";
|
|
|
|
|
$request['pay_url'] = $json_data['url']."&tx_client=hideopen";
|
|
|
|
|
$request['merchant_id'] = $pay_info['id'];
|
|
|
|
|
$request['merchant_way'] = 2;
|
|
|
|
|
$request['merchant_way'] = self::WX_PAY;
|
|
|
|
|
$this->add_deposit($request, 1);
|
|
|
|
|
// .(is_ssl()?'https%3A%2F%2F':'http%3A%2F%2F'). $_SERVER ['HTTP_HOST'] . "%2Fsdk.php%2FSpend%2Fpay_success%2Forderno%2F".$request['pay_order_number'].'%2Fgame_id%2F'.$request['game_id'] ;
|
|
|
|
|
/* if (I('request.api_ver') == 1) {
|
|
|
|
@ -1447,7 +1452,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$this->other_price($request);
|
|
|
|
|
$pay_amount = $request['price'];
|
|
|
|
|
|
|
|
|
|
$pay_info = get_payment_config(2, $game, $request['user_id']);
|
|
|
|
|
$pay_info = get_payment_config(self::WX_PAY, $game, $request['user_id']);
|
|
|
|
|
if ($pay_info['code'] != 0) {
|
|
|
|
|
echo json_encode(['code'=>1010,'msg'=> $pay_info['msg']]);
|
|
|
|
|
exit;
|
|
|
|
@ -1456,6 +1461,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$pay_info = $pay_info['data'];
|
|
|
|
|
$pay_conf['id'] = $pay_info['id'];
|
|
|
|
|
$pay_conf['merchant_id'] = $pay_info['id'];
|
|
|
|
|
$pay_conf['merchant_way'] = self::WX_PAY;
|
|
|
|
|
|
|
|
|
|
//0 官方 1威富通 2俊付通
|
|
|
|
|
// if (get_wx_pay_type() == 0) {
|
|
|
|
@ -1469,7 +1475,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.urlencode(C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/game_id/{$request['game_id']}/paytype/weixinpay");
|
|
|
|
|
$request['pay_url'] = $json_data['url'] . "&tx_client=hideopen";
|
|
|
|
|
$request['merchant_id'] = $pay_info['id'];
|
|
|
|
|
$request['merchant_way'] = 2;
|
|
|
|
|
$request['merchant_way'] = self::WX_PAY;
|
|
|
|
|
$this->add_spend($request,1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|