Merge branch 'dev-cz' of 47.111.118.107:/srv/git/platform into dev-cz

master
chenzhi 5 years ago
commit 0669d15e3e

@ -209,6 +209,31 @@ Log::write(serialize($order_info), Log::DEBUG);
}
/**
*超级签微信充值回调
*/
public function supersign_wxpay_notify(){
$xml = file_get_contents('php://input');
$Swiftpass=new Swiftpass(C('wei_xin.partner'), C('wei_xin.key'));
$Swiftpass->resHandler->setContent($xml);
$Swiftpass->resHandler->setKey( C('wei_xin.key'));
if($Swiftpass->resHandler->isTenpaySign()){
if($Swiftpass->resHandler->getParameter('status') == 0 && $Swiftpass->resHandler->getParameter('result_code') == 0){
$trade_no=$Swiftpass->resHandler->getParameter('transaction_id');
$out_trade_no = $Swiftpass->resHandler->getParameter('out_trade_no');
$this->supersign_pay_notify(array(
'trade_id' => $trade_no,
'order_id' => $out_trade_no
));
echo 'success';
}else{
echo 'failure';
}
}else{
echo 'failure';
}
}
/**
* 支付宝退款回调

@ -270,7 +270,8 @@ class CoinOrderController extends BaseController
//官方
header("Content-type:text/html;charset=utf-8");
Vendor("WxPayPubHelper.WxPayPubHelper");
$unifiedOrder = new \UnifiedOrder_pub("wx0ba5be5c8bb9f1b7", "1555280551","wDst6e8d0nGUh4hcwBgv8caJmDE1Mxql");
//$unifiedOrder = new \UnifiedOrder_pub("wx0ba5be5c8bb9f1b7", "1555280551","wDst6e8d0nGUh4hcwBgv8caJmDE1Mxql");
$unifiedOrder = new \UnifiedOrder_pub(C("wei_xin.email"), C("wei_xin.partner"),C("wei_xin.key"));
// $des='平台币充值';
$unifiedOrder->setParameter("body", $title);//商品描述
//自定义订单号,此处仅作举例

@ -1,5 +1,6 @@
<?php
namespace Sdk\Controller;
use Org\WeixinSDK\Weixin;
use Think\Controller;
use Org\Ipa365SDK\Ipa365;
use Mobile\Controller\SsgController;
@ -120,14 +121,15 @@ class Ipa365Controller extends BaseController{
'game_id' => $gameId,
'pay_status' => 0
))->find();
$gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array(
'id' => $gameId,
))->find();
if ($payLog) {
$orderId = $payLog['order_id'];
} else {
$orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签
$gameInfo = M('game', 'tab_')->field('supersign_token')->where(array(
'id' => $gameId,
))->find();
if (!$gameInfo['supersign_token']) {
$this->error("超级签token未填写");
}
@ -158,17 +160,22 @@ class Ipa365Controller extends BaseController{
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
$param['callback'] = "https://m.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
//$param['callback'] = "https://m.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
//$param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
$param['callback'] = "https://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
$ret = $this->alipay($param);
$this->assign("url", $ret['url']);
$weixn = new Weixin();
$wx_pay = json_decode($weixn->weixin_pay('超级签消费', $orderId, $price, 'MWEB', 4), true);
$this->assign("wxurl", $wx_pay['mweb_url']);
$this->assign("price", self::signprice);
$this->assign("url", $ret['url']);
$this->assign("order_id", $orderId);
// pp($orderId);
// redirect($ret['url']);
$this->assign("game_name",$gameInfo['game_name']);
$this->assign("callback",$param['callback']);
$this->display();
}
@ -209,12 +216,19 @@ class Ipa365Controller extends BaseController{
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
$param['callback'] = "https://m.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
//$param['callback'] = "https://m.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
//$param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
$ret = $this->alipay($param);
$param['callback'] = "https://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
$ret = $this->alipay($param);
$this->assign("url", $ret['url']);
$weixn = new Weixin();
$wx_pay = json_decode($weixn->weixin_pay('超级签消费', $orderId, $price, 'MWEB', 4), true);
$this->assign("wxurl", $wx_pay['mweb_url']);
$this->assign("price", $price);
$this->assign("order_id", $payLog['order_id']);
$this->assign("game_id", $payLog['game_id']);
@ -393,7 +407,7 @@ class Ipa365Controller extends BaseController{
->setUserId($param['user_id'])
->setSdkVersion($param['sdk_version']);
$pay_['url']= $pay->buildRequestForm($vo);
$pay_['out_trade_no']= $out_trade_no;
//$pay_['out_trade_no']= $out_trade_no;
return $pay_;
}

@ -40,8 +40,8 @@ body{
</div>
</div> -->
<div class="title" >
<img class="gologin" src="__IMG__/ssg/alipay/back.png" style="margin-left:.24rem;">
<div style="font-size: .32rem;color: #fff;">天宫计</div>
<img class="gologin" src="__IMG__/ssg/alipay/back.png" style="margin-left:.24rem;" onclick="javascript:history.go(-1)">
<div style="font-size: .32rem;color: #fff;">{$game_name}</div>
<div class="titleright" style="margin-right:.24rem;"></div>
</div>
<!-- 其他通道 -->
@ -74,22 +74,22 @@ body{
</div>
</div>
<!-- 微信回调弹框 -->
<div id="alert_box" style="height: 100vh;background:rgba(41,41,41,.8);position:fixed;z-index:9999;top: 0px;width: 100%;">
<div id="alert_box" style="height: 100vh;background:rgba(41,41,41,.8);position:fixed;z-index:9999;top: 0px;width: 100%;" hidden>
<div style="top:50%;margin-top: -1.5rem;position: fixed;width: 6.3rem;left: 50%;margin-left: -3.2rem;background-color: #fff;border-radius:.3rem;">
<img onclick="closeAlert()" src="__IMG__/ssg/alipay/close.png" style="width: .3rem;height: .3rem;position: absolute;left: .3rem;top: .3rem;">
<div style="line-height:1.4rem;font-size:.32rem;text-align: center;">
请确认微信支付是否已完成
</div>
<a href="javascript:" style="line-height:1rem;font-size:.28rem;text-align: center;color: red;width: 100%;display: block;border-top: 1px solid #f5f5f5;border-bottom: 1px solid #f5f5f5;">
<a href="{$callback}" style="line-height:1rem;font-size:.28rem;text-align: center;color: red;width: 100%;display: block;border-top: 1px solid #f5f5f5;border-bottom: 1px solid #f5f5f5;">
已完成支付
</a>
<a href="javascript:" style="line-height:1rem;font-size:.28rem;text-align: center;color: #A9A9A9;width: 100%;display: block;">
<a href="javascript:" style="line-height:1rem;font-size:.28rem;text-align: center;color: #A9A9A9;width: 100%;display: block;" onclick="javascript;location.reload();">
支付遇到问题,重新支付
</a>
</div>
</div>
<!-- 触屏订单通道 -->
<div class="m-order hidden">
<div class="m-order">
<div style="padding: .3rem;">
<div style="width: 6.9rem;height: 1.7rem;background-color: #fff;border-radius:10px;margin: auto;font-size: .28rem;color:#292929;">
<div style="display: flex;height: .8rem; justify-content: space-between;align-items:center;padding: 0 .3rem;">
@ -108,7 +108,7 @@ body{
<span>{$price}</span>
</div>
<a class="order-payinfo-item"
href="#;" onclick="jump('{$url}', '{$order_id}')"
href="#;" onclick="jump('{$url}', '{$order_id}','alipay')"
title="支付宝" style="padding: .3rem 0;width: 6.3rem;margin-left: .3rem;">
<div class="order-payinfo-icon" style="width: .7rem;height: .7rem;">
<img src="__IMG__/ssg/alipay/zfb-pic.jpg" style="width: 100%;height: 100%;border: 0px;" alt="支付宝">
@ -118,8 +118,9 @@ body{
<div class="pay-meta">推荐支付宝用户使用</div>
</div>
</a>
<if condition="$wxurl neq ''">
<a class="order-payinfo-item"
href="#;" onclick="jump('{$url}', '{$order_id}')"
href="#;" onclick="jump('{$wxurl}', '{$order_id}','wxpay')"
title="微信支付" style="padding: .3rem 0;width: 6.3rem;margin-left: .3rem;">
<div class="order-payinfo-icon" style="width: .7rem;height: .7rem;">
<img src="__IMG__/ssg/alipay/wxpay.png" style="width: 100%;height: 100%;border: 0px;" alt="微信支付">
@ -129,6 +130,7 @@ body{
<div class="pay-meta">推荐微信用户使用</div>
</div>
</a>
</if>
</div>
</div>
<!--<div class="footer-pay">
@ -136,12 +138,18 @@ body{
</div>-->
</body>
<script>
function jump(pay_url, order_id) {
if(isWeiXin()){
function jump(pay_url, order_id,paytype='alipay') {
if(paytype=='alipay'){
window.location.href = pay_url;
}else{
showAlert();
window.open(pay_url,"_blank");
}
/*if(isWeiXin()){
window.location.href = "/sdk.php/Ipa365/paytip/order_id/"+order_id;
}else{
window.location.href=pay_url;
}
}*/
}
//判断是否是微信浏览器的函数
function isWeiXin(){

@ -21,8 +21,7 @@ class Weixin
// $data['pay_type'] = "weixin";
//使用统一支付接口
if ($tt == 1) { //扫码
if ($tt == 1 || $tt == 4) { //扫码 || 超级签h5
$notifyy="notify";
$unifiedOrder = new \UnifiedOrder_pub(C('wei_xin.email'), C('wei_xin.partner'), C('wei_xin.key'));
@ -47,7 +46,11 @@ class Weixin
$unifiedOrder->setParameter("total_fee", $pay_amount * 100);//总金额
if($tt==4){
$unifiedOrder->setParameter("notify_url", "http://" . $_SERVER['HTTP_HOST'] . "/callback.php/Notify/supersign_wxpay_notify");//通知地址
}else{
$unifiedOrder->setParameter("notify_url", "http://" . $_SERVER['HTTP_HOST'] . "/callback.php/Notify/wxpay_callback/method/".$notifyy);//通知地址
}
$unifiedOrder->setParameter("trade_type", $trade_type);//交易类型

Loading…
Cancel
Save