Merge branch 'dev' of wmtx/sdk into master

不同游戏选择不同支付渠道
master
张谷诚 5 years ago committed by Gogs
commit 5054dda589

@ -1806,6 +1806,101 @@ function get_wx_type(){
}
/**
* 根据用户account查找会长更新支付配置
* @param number $flag type 微信wx 阿里alipay 快捷shortcut
* @return number
*/
function update_pay_config($account, $type='wx') {
if (!$account) return ;
// 查看用户所属的会长
$promote = M('promote', 'tab_')->where([
'account' => $account
])->find();
if (!$promote) return ;
$chain = explode('/', $promote['chain']);
if (!$chain || !$chain[0]) return ;
$map['type'] = $type;
$map['promote_id'] = $chain[0];
$map['status'] = 1;
$payConfig = M('promote_pay_config','tab_')->where($map)->find();
if ($payConfig) {
if ($type == 'wx') {
C('wei_xin.email', $payConfig['appid']); // APP ID
C('wei_xin.partner', $payConfig['account']); // 商户号
C('wei_xin.key', $payConfig['secret']);
}
if ($type == 'alipay') {
C('alipay.appid', $payConfig['appid']);
C('alipay.pub_secret', $payConfig['pub_secret']);
C('alipay.pri_secret', $payConfig['pri_secret']);
}
if ($type == 'shortcut') {
C('sqpay.partner', $payConfig['account']);
C('sqpay.key', $payConfig['secret']);
}
}
}
/**
* 支付回调配置信息
* 根据用户订单ID查找会长更新支付配置
* @param number $flag type 微信wx 阿里alipay 快捷shortcut
* @return number
*/
function update_paycallback_config($orderid, $type='wx') {
if (!$orderid) return ;
$pay_where = substr($orderid, 0, 2);
$account = '';
if ($pay_where == 'SP') { // 游戏充值
$spend = M('spend', 'tab_')->where([
'pay_order_number' => $orderid
])->find();
$account = $spend['user_account'];
}
if ($pay_where == 'PF') { // 平台币充值
$deposit = M('deposit', 'tab_')->where([
'pay_order_number' => $orderid
])->find();
$account = $deposit['user_account'];
}
if (!$account) return ;
// 查看用户所属的会长
$promote = M('promote', 'tab_')->where([
'account' => $account
])->find();
if (!$promote) return ;
$chain = explode('/', $promote['chain']);
if (!$chain || !$chain[0]) return ;
$map['type'] = $type;
$map['promote_id'] = $chain[0];
$map['status'] = 1;
$payConfig = M('promote_pay_config','tab_')->where($map)->find();
if ($payConfig) {
if ($type == 'wx') {
C('wei_xin.email', $payConfig['appid']); // APP ID
C('wei_xin.partner', $payConfig['account']); // 商户号
C('wei_xin.key', $payConfig['secret']);
}
if ($type == 'alipay') {
C('alipay.appid', $payConfig['appid']);
C('alipay.pub_secret', $payConfig['pub_secret']);
C('alipay.pri_secret', $payConfig['pri_secret']);
}
if ($type == 'shortcut') {
C('sqpay.partner', $payConfig['account']);
C('sqpay.key', $payConfig['secret']);
}
}
}
function get_wx_pay_type($flag=0) {
if(MODULE_NAME=='Media'||MODULE_NAME=='Media2'||MODULE_NAME=='Home'){
$map['name']=array('in',array('wei_xin','weixin','weixin_gf'));

@ -52,6 +52,10 @@ class FengHuoApiController extends Controller{
// }
// }
public function _initialize() {
$this->ajaxReturn('接口不存在');
}
/**
* 注册明细
* @param

@ -51,7 +51,7 @@ class PayH5Controller extends BaseController{
}
$request['pay_order_number'] = $pay_info['order_id'];
if(get_zfb_type()==0){ // 支付宝官方
if(get_zfb_type($game_id, $user_id)==0){ // 支付宝官方
if(C('alipay.way')==1/* || ($request['is_create_ordernumer']==1 && C('alipay.way')==0) */){ /* wap */
$request['apitype'] = "alipay";
@ -99,7 +99,7 @@ class PayH5Controller extends BaseController{
'pay_url' => $request['pay_url']
]);
}elseif(get_zfb_type() == 2) { // 双乾
}elseif(get_zfb_type($game_id, $user_id) == 2) { // 双乾
$request['pay_way'] = C('PAY_WAY.SQ_ALIPAY');
$request['pay_status'] = 0;
@ -303,7 +303,7 @@ class PayH5Controller extends BaseController{
$this->other_price($request);
if(get_zfb_type()==0){ // 支付宝官方
if(get_zfb_type($game_id, $user_id)==0){ // 支付宝官方
if(C('alipay.way')==1/* || ($request['is_create_ordernumer']==1 && C('alipay.way')==0) */){ /* wap */
$game_set_data = get_game_set_info($request['game_id']);
@ -346,8 +346,7 @@ class PayH5Controller extends BaseController{
'pay_url' => $request['pay_url']
]);
}elseif(get_zfb_type() == 2) { // 双乾
}elseif(get_zfb_type($game_id, $user_id) == 2) { // 双乾
$request['pay_way'] = C('PAY_WAY.SQ_ALIPAY');
$request['pay_status'] = 0;
$request['spend_ip'] = get_client_ip();

@ -26,7 +26,7 @@ class Sqpay
'MerRemark' => $data['MerRemark'],
'subject' => $data['subject'],
'NotifyURL' => $data['notifyurl'],
'ReturnURL' => $data['returnurl'],
'ReturnURL' => '',//$data['returnurl'],
'mchAppId' => $data['mchAppId'],
'mchAppName' => $data['mchAppName'],
'deviceInfo' => $data['deviceInfo'],

Loading…
Cancel
Save