master
tping 4 years ago
parent 7ecfc1bbc3
commit 838c224f3e

@ -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);
}

@ -489,7 +489,7 @@ class ShortcutController extends BaseController{
exit;
}
$game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find();
$game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('id, game_type_id, pay_status')->find();
if($game['pay_status'] == 0){
echo json_encode(['code'=>0, 'msg'=> "该游戏暂时无法充值,请联系客服!"]);
exit;
@ -585,11 +585,22 @@ class ShortcutController extends BaseController{
}
}
$pay_info = get_payment_config(PayH5Controller::EXPRESS_PAY, $game, I('request.user_id'));
if ($pay_info['code'] != 0) {
echo json_encode(['code'=>1010,'msg'=> $pay_info['msg']]);
exit;
}
$pay_conf = json_decode($pay_info['data']['config'], true);
$pay_info = $pay_info['data'];
$pay_conf['id'] = $pay_info['id'];
$request['merchant_id'] = $pay_info['id'];
$request['merchant_way'] = PayH5Controller::EXPRESS_PAY;
$yeepay = new Yeepay();
$data['appKey'] = C('yeepay.key');
$data['privateKey'] = C('yeepay.private_key');
$data['parentMerchantNo'] = C('yeepay.parent_merchant');
$data['merchantNo'] = C('yeepay.partner');
$data['appKey'] = $pay_conf['key'];//C('yeepay.key');
$data['privateKey'] = $pay_conf['private_key'];//C('yeepay.private_key');
$data['parentMerchantNo'] = $pay_conf['parent_merchant'];//C('yeepay.parent_merchant');
$data['merchantNo'] = $pay_conf['partner'];//C('yeepay.partner');
$data['orderId'] = $request['pay_order_number'];
$data['orderAmount'] = $request['price'];
$data['notifyUrl'] = C('PAY_DOMAIN')."/callback.php/Notify/yeepay_callback";

Loading…
Cancel
Save