超级签微信支付

master
zhengchanglong 5 years ago
parent bb0a399ef7
commit 2dc6304ec3

@ -64,7 +64,7 @@ class NotifyController extends BaseController
//获取回调订单信息 //获取回调订单信息
$order_info = $pay->getInfo(); $order_info = $pay->getInfo();
Log::write(serialize($order_info), Log::DEBUG); Log::write(serialize($order_info), Log::DEBUG);
if ($order_info['status']) { if ($order_info['status']) {
$pay_where = substr($order_info['out_trade_no'], 0, 2); $pay_where = substr($order_info['out_trade_no'], 0, 2);
@ -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';
}
}
/** /**
* 支付宝退款回调 * 支付宝退款回调

@ -1,5 +1,6 @@
<?php <?php
namespace Sdk\Controller; namespace Sdk\Controller;
use Org\WeixinSDK\Weixin;
use Think\Controller; use Think\Controller;
use Org\Ipa365SDK\Ipa365; use Org\Ipa365SDK\Ipa365;
use Mobile\Controller\SsgController; use Mobile\Controller\SsgController;
@ -158,18 +159,21 @@ class Ipa365Controller extends BaseController{
$param['payway'] = 1; $param['payway'] = 1;
$param['title'] = $price; $param['title'] = $price;
$param['body'] = $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['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['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); $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("price", self::signprice);
$this->assign("url", $ret['url']);
$this->assign("order_id", $orderId); $this->assign("order_id", $orderId);
// pp($orderId);
// redirect($ret['url']);
$this->display(); $this->display();
} }
@ -209,12 +213,19 @@ class Ipa365Controller extends BaseController{
$param['payway'] = 1; $param['payway'] = 1;
$param['title'] = $price; $param['title'] = $price;
$param['body'] = $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['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['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']); $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("price", $price);
$this->assign("order_id", $payLog['order_id']); $this->assign("order_id", $payLog['order_id']);
$this->assign("game_id", $payLog['game_id']); $this->assign("game_id", $payLog['game_id']);

@ -79,6 +79,17 @@
<div class="pay-meta">支持支付宝</div> <div class="pay-meta">支持支付宝</div>
</div> </div>
</a> </a>
<!--<a class="order-payinfo-item"
href="#;" onclick="jump('{$wxurl}', '{$order_id}')"
title="支付宝">
<div class="order-payinfo-icon">
<img src="__IMG__/ssg/alipay/zfb-pic.jpg" alt="微信支付">
</div>
<div class="order-payinfo-con">
<div class="pay-title">微信支付</div>
<div class="pay-meta">支持微信支付</div>
</div>
</a>-->
</div> </div>
</div> </div>
<div class="footer-pay"> <div class="footer-pay">

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

Loading…
Cancel
Save