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