master
“‘ 5 years ago
parent 96ca80221b
commit 9316dedc6c

@ -103,69 +103,69 @@ class Ipa365Controller extends BaseController{
* 发起支付 * 发起支付
*/ */
public function pay() { public function pay() {
// $userId = $this->userinfo['user_id']; $userId = $this->userinfo['user_id'];
// if (!$userId ) { if (!$userId ) {
// $this->error("请登入", "/mobile.php/ssg/login"); $this->error("请登入", "/mobile.php/ssg/login");
// } }
// $gameId = I("game_id", 0); $gameId = I("game_id", 0);
// $price = self::signprice; $price = self::signprice;
// if (!$userId || !$gameId) { if (!$userId || !$gameId) {
// $this->error("参数有误!"); $this->error("参数有误!");
// } }
// $payLog = M('game_supersign', 'tab_')->where(array( $payLog = M('game_supersign', 'tab_')->where(array(
// 'user_id' => $userId, 'user_id' => $userId,
// 'game_id' => $gameId, 'game_id' => $gameId,
// 'pay_status' => 0 'pay_status' => 0
// ))->find(); ))->find();
// if ($payLog) { if ($payLog) {
// $orderId = $payLog['order_id']; $orderId = $payLog['order_id'];
// } else { } else {
// $orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签 $orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签
// $gameInfo = M('game', 'tab_')->field('supersign_token')->where(array( $gameInfo = M('game', 'tab_')->field('supersign_token')->where(array(
// 'id' => $gameId, 'id' => $gameId,
// ))->find(); ))->find();
// if (!$gameInfo['supersign_token']) { if (!$gameInfo['supersign_token']) {
// $this->error("超级签token未填写"); $this->error("超级签token未填写");
// } }
// $r = M('game_supersign', 'tab_')->add(array( $r = M('game_supersign', 'tab_')->add(array(
// 'udid' => '', 'udid' => '',
// 'user_id' => $userId, 'user_id' => $userId,
// 'game_id' => $gameId, 'game_id' => $gameId,
// 'order_id' => $orderId, 'order_id' => $orderId,
// 'pay_price' => $price, 'pay_price' => $price,
// 'pay_status' => 0, 'pay_status' => 0,
// 'ticket' => '', // 调用安装的时候分配 'ticket' => '', // 调用安装的时候分配
// 'token' => $gameInfo['supersign_token'], 'token' => $gameInfo['supersign_token'],
// 'create_time' => time() 'create_time' => time()
// )); ));
// if (!$r) return -1; if (!$r) return -1;
// } }
// $param['price'] = $price; $param['price'] = $price;
// $param['sdk_version'] = '2'; $param['sdk_version'] = '2';
// $param['user_id'] = $userId; $param['user_id'] = $userId;
// $param['game_id'] = $gameId; $param['game_id'] = $gameId;
// $param['order_id'] = $orderId; $param['order_id'] = $orderId;
// $param['apitype'] = "alipay"; $param['apitype'] = "alipay";
// $param['config'] = "alipay"; $param['config'] = "alipay";
// $param['signtype']= "MD5"; $param['signtype']= "MD5";
// $param['server'] = "alipay.wap.create.direct.pay.by.user"; $param['server'] = "alipay.wap.create.direct.pay.by.user";
// $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); $ret = $this->alipay($param);
// $this->assign("price", self::signprice); $this->assign("price", self::signprice);
// $this->assign("url", $ret['url']); $this->assign("url", $ret['url']);
// $this->assign("order_id", $orderId); $this->assign("order_id", $orderId);
// pp($orderId); // pp($orderId);
// redirect($ret['url']); // redirect($ret['url']);

Loading…
Cancel
Save