支付域名

master
tpingzhang 5 years ago
parent f232f41138
commit b04b6eae28

@ -96,7 +96,7 @@ $config = array(
), //附件上传配置(文件上传类配置)
'ADMIN_DOMAIN' => 'http://mg.wmtxkj.cn/',
'WX_PAY_LIMIT' => 3000,
'CALLBACK_PAY' => 'https://api.wmtxkj.cn/'
'PAY_DOMAIN' => 'https://api.wmtxkj.cn/'
);
return $config;
/* $pay = include(APP_PATH . "/Sdk/Conf/pay.php");

@ -184,7 +184,7 @@ class AppleController extends BaseController{
$data['paymenttype'] = "ZFBZF";
$data['MerRemark'] = "mark";
$data['subject'] = "游戏充值";
$data['notifyurl'] =C('pay_header')."/callback.php/Notify/sq_callback";//通知
$data['notifyurl'] = C('PAY_DOMAIN')."/callback.php/Notify/sq_callback";//通知
$data['returnurl'] = $returl;
$data['mchAppId'] = "wmtxkj.com";
$data['mchAppName'] = "mchAppName";

@ -127,7 +127,7 @@ class WapPayController extends BaseController{
$this->add_deposit($request);
}
$sqpay=new Sqpay();
$returl = C('pay_header'). "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
$returl = C('PAY_DOMAIN'). "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
$data['secret'] = C("sqpay.key");
$data['merno'] = C("sqpay.partner");
$data['amount'] = $request['price'];
@ -135,7 +135,7 @@ class WapPayController extends BaseController{
$data['paymenttype'] = "ZFBZF";
$data['MerRemark'] = "mark";
$data['subject'] = "subject";
$data['notifyurl'] = C('pay_header')."/callback.php/Notify/sq_callback";//通知
$data['notifyurl'] = C('PAY_DOMAIN')."/callback.php/Notify/sq_callback";//通知
$data['returnurl'] = $returl;
$data['mchAppId'] = "wmtxkj.com";
$data['mchAppName'] = "mchAppName";
@ -554,8 +554,7 @@ class WapPayController extends BaseController{
/**
*微信支付
*/
public function weixin_pay()
{
public function weixin_pay() {
#获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组
$request = json_decode(base64_decode(file_get_contents("php://input")), true);
/* file_put_contents(dirname(__FILE__) . '/weixin_paywap.txt',json_encode($request)); */
@ -609,7 +608,7 @@ class WapPayController extends BaseController{
//0 官方 1威富通
if (get_wx_pay_type() == 0) {
if(empty(C('wei_xin.email'))|| empty(C('wei_xin.partner'))||empty(C('wei_xin.key'))){
$this->set_message(1009, "fail", "支付参数未配置");
$this->set_message(1009, "fail", "支付参数未配置");
}
$weixn = new Weixin();
$is_pay = json_decode($weixn->weixin_pay("充值", $request['pay_order_number'], $pay_amount, 'MWEB'), true);
@ -622,24 +621,25 @@ class WapPayController extends BaseController{
$json_data['status'] = 200;
if($request['sdk_version']==1){
$json_data['url'] = $is_pay['mweb_url'];
$json_data['orderno'] =$request['pay_order_number'];
$json_data['paytype'] ="wx";
$json_data['orderno'] = $request['pay_order_number'];
$json_data['paytype'] = "wx";
}else{
if(!empty($request['scheme'])) {
$redirect_url = 'https://api.wmtxkj.com' . "/sdk.php/Spend/pay_success2/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
$redirect_url = C('PAY_DOMAIN') . "/sdk.php/Spend/pay_success2/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
} else {
$redirect_url = 'https://api.wmtxkj.com' . "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'];
$redirect_url = C('PAY_DOMAIN') . "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'];
}
$json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.urlencode( $redirect_url );
$json_data['paytype'] ="wx";
$json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.urlencode( $redirect_url );
$json_data['paytype'] ="wx";
}
}else{
$json_data['status'] = 500;
$json_data['url'] = "https://" . 'api.wmtxkj.com';
$json_data['url'] = C('PAY_DOMAIN');
}
$json_data['cal_url'] = 'https://api.wmtxkj.com';
echo base64_encode(json_encode($json_data));exit;
// $this->redirect('WapPay/weixin_pay_view',['user_id'=>$request['user_id'],'game_id'=>$request['game_id']]);
$json_data['cal_url'] = C('PAY_DOMAIN');
echo base64_encode(json_encode($json_data));
exit;
// $this->redirect('WapPay/weixin_pay_view',['user_id'=>$request['user_id'],'game_id'=>$request['game_id']]);
} else if(get_wx_pay_type() == 1){ // 威富通
if( empty(C('heepay.partner'))||empty(C('heepay.key'))){
$this->set_message(1009, "fail", "支付参数未配置");
@ -718,9 +718,9 @@ class WapPayController extends BaseController{
}
$request['pay_way'] = 8;
if($pay_amount*1<1){
$this->set_message(1011,"fail","单笔交易金额必须大于1元");
}
if($pay_amount*1<1){
$this->set_message(1011,"fail","单笔交易金额必须大于1元");
}
if($request['code']==1){
$this->add_spend($request);
@ -738,9 +738,9 @@ class WapPayController extends BaseController{
}else{
$json_data['status'] = 500;
$json_data['msg']=$res['info'];
$json_data['msg']=$res['info'];
$json_data['url']='http://'.$_SERVER ['HTTP_HOST'];
$json_data['cal_url'] = C("pay_header");
$json_data['cal_url'] = C("PAY_DOMAIN");
}
echo base64_encode(json_encode($json_data)); exit;
@ -1016,7 +1016,8 @@ class WapPayController extends BaseController{
$data['merno'] = C('sqpay.partner');
$data['subject'] = '游戏充值';
$data['ip'] = get_client_ip();
$data['returnurl'] = C('pay_header'). "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
$data['returnurl'] = C('PAY_DOMAIN'). "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
$data['notifyurl'] = C('PAY_DOMAIN')."/callback.php/Notify/sq_callback";
$data['amount'] = $request['price'];
$data['appId'] = C('wei_xin.email');
$data['secret'] = C('sqpay.key');

@ -229,7 +229,7 @@ function small_program(status) {
return false;
}
return false;
return true;
}
$(function() {

@ -44,9 +44,9 @@ class Sqpay
public function sq_wxsmallpay($data){
Log::write("wxpay:".serialize($_REQUEST), Log::DEBUG);
$returnurl = empty($data['returnurl'])?"http://".$_SERVER['HTTP_HOST']:$data['returnurl'];//成功跳转
$returnurl = $data['returnurl'];//成功跳转
$notifyurl = "http://".$_SERVER['HTTP_HOST']."/callback.php/Notify/sq_callback"; //通知
$notifyurl =$data['notifyurl']; //通知
$ordertime =date("Ymdhms",time());
// 168885 12345678
$sign = md5("Amount={$data['amount']}&BillNo={$data['order_no']}&MerNo={$data['merno']}&PayType=SMZF&".strtoupper(md5($data['secret'])));

Loading…
Cancel
Save