Skip to content

Commit

Permalink
update: 适配v2rayN订阅ss,trojan,vmess/易支付回调显示success/套餐折算判断usedd
Browse files Browse the repository at this point in the history
  • Loading branch information
BobCoderS9 committed May 22, 2023
1 parent dc41b30 commit 5dfac2c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/Controllers/LinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,10 @@ public static function getSub($user, $sub, $opts, $Rule)
case 3: // V2
$Rule['type'] = 'vmess';
$return_url .= URL::get_NewAllUrl($user, $Rule);
$Rule['type'] = 'ss';
$return_url .= URL::get_NewAllUrl($user, $Rule);
$Rule['type'] = 'trojan';
$return_url .= URL::get_NewAllUrl($user, $Rule);
$getListExtend = $Rule['extend'] ? self::getListExtend($user, 'v2rayn') : [];
break;
case 4: // Trojan
Expand Down
5 changes: 0 additions & 5 deletions src/Controllers/MetronController.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,6 @@ public function formCheck($request, $response, $args)
*/
public function PackageConversion($request, $response, $args)
{
$mt = MtAuth::Auth();
if (!$mt['ret']) {
return $response->getBody()->write(json_encode($mt, JSON_UNESCAPED_UNICODE));
}

if (!MetronSetting::get('shop_conversion')) {
$res = ['ret' => 0, 'msg' => '管理员设置不允许折算'];
return $response->getBody()->write(json_encode($res, JSON_UNESCAPED_UNICODE));
Expand Down
4 changes: 2 additions & 2 deletions src/Metron/Metron.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ public function getConversionInfo($user, $bought)
],
];
} else { /* 是常规套餐 */
/*if ($bought->usedd === 0 ){
if ($bought->usedd === 0 ){
$res = ['ret' => 0, 'msg' => '该套餐已失效, 不能折算余额'];
return $res;
}*/
}
/* 用户等级和套餐的不一样, 可能被管理修改过 */
if ( $shopinfo['class'] != $user->class) {
$res = ['ret' => 0, 'msg' => '您的等级和套餐等级不符,请联系管理处理'];
Expand Down
4 changes: 2 additions & 2 deletions src/Services/Gateway/Epay.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ public function notify($request, $response, $args)
$trade_status = $_GET['trade_status'];
if ($trade_status == 'TRADE_SUCCESS') {
$this->postPayment($out_trade_no, $type);
return json_encode(['state' => 'success', 'msg' => '支付成功']);
die('SUCCESS');
}else{
return json_encode(['state' => 'fail', 'msg' => '支付失败']);
die('FAIL');
}
} else {
return '非法请求';
Expand Down

0 comments on commit 5dfac2c

Please sign in to comment.