Parcourir la source

BUG修复

1. 修复Coupon添加失败问题;
2. 修复众多支付渠道无法区别异步回调的问题;
3. 码支付 可以使用在生成环境中;
4.更新Logs
兔姬桑 il y a 4 ans
Parent
commit
759cbe58d3

+ 2 - 0
app/Http/Controllers/AuthController.php

@@ -199,6 +199,8 @@ class AuthController extends Controller
 			default: // 不启用验证码
 				break;
 		}
+
+		return 0;
 	}
 
 

+ 1 - 1
app/Http/Controllers/CouponController.php

@@ -53,7 +53,7 @@ class CouponController extends Controller
 		if($request->isMethod('POST')){
 			$this->validate($request, [
 				'name'            => 'required',
-				'sn'              => 'mail|unique:coupon',
+				'sn'              => 'unique:coupon',
 				'type'            => 'required|integer|between:1,3',
 				'usage'           => 'required|integer|between:1,2',
 				'num'             => 'required|integer|min:1',

+ 1 - 0
app/Http/Controllers/Gateway/AbstractPayment.php

@@ -55,6 +55,7 @@ abstract class AbstractPayment
 		$payment = Payment::whereSn($data)->first();
 		// 是否为余额购买套餐
 		if($payment){
+			Payment::whereSn($data)->update(['status' => 1]);
 			$order = Order::find($payment->oid);
 		}else{
 			$order = Order::find($data);

+ 12 - 11
app/Http/Controllers/Gateway/AopF2F.php

@@ -34,7 +34,8 @@ class AopF2F extends AbstractPayment
 		/** @var AopTradePreCreateResponse $response */
 		$aliResponse = $request->send();
 
-		$payment->qr_code = 'http://qr.topscan.com/api.php?text='.$aliResponse->getQrCode().'&bg=ffffff&fg=000000&pt=1c73bd&m=10&w=400&el=1&inpt=1eabfc&logo=https://t.alipayobjects.com/tfscom/T1Z5XfXdxmXXXXXXXX.png';//后备:https://cli.im/api/qrcode/code?text=".$aliResponse->getQrCode()."&mhid=5EfGCwztyckhMHcmI9ZcOKs
+		$payment->qr_code = 'http://qr.topscan.com/api.php?text='.$aliResponse->getQrCode().'&bg=ffffff&fg=000000&pt=1c73bd&m=10&w=400&el=1&inpt=1eabfc&logo=https://t.alipayobjects.com/tfscom/T1Z5XfXdxmXXXXXXXX.png';
+		//后备:https://cli.im/api/qrcode/code?text=".$aliResponse->getQrCode()."&mhid=5EfGCwztyckhMHcmI9ZcOKs
 		$payment->save();
 
 		return Response::json(['status' => 'success', 'data' => $payment->sn, 'message' => '创建订单成功!']);
@@ -45,10 +46,9 @@ class AopF2F extends AbstractPayment
 		$gateway = Omnipay::create('Alipay_AopF2F');
 		$gateway->setSignType('RSA2'); //RSA/RSA2
 		$gateway->setAppId(parent::$systemConfig['f2fpay_app_id']);
-		$gateway->setPrivateKey(parent::$systemConfig['f2fpay_private_key']); // 可以是路径,也可以是密钥内容
-		$gateway->setAlipayPublicKey(parent::$systemConfig['f2fpay_public_key']); // 可以是路径,也可以是密钥内容
-		$notifyUrl = (parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/payment/notify';
-		$gateway->setNotifyUrl($notifyUrl);
+		$gateway->setPrivateKey(parent::$systemConfig['f2fpay_private_key']);
+		$gateway->setAlipayPublicKey(parent::$systemConfig['f2fpay_public_key']);
+		$gateway->setNotifyUrl((parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/callback/notify?method=f2fpay');
 
 		return $gateway;
 	}
@@ -56,16 +56,17 @@ class AopF2F extends AbstractPayment
 	public function notify($request)
 	{
 		$gateway = self::createGateway();
-		$aliRequest = $gateway->completePurchase();
-		$aliRequest->setParams($_POST);
+		$request = $gateway->completePurchase();
+		$request->setParams($_POST);
 
 		try{
 			/** @var AopCompletePurchaseResponse $response */
-			$aliResponse = $aliRequest->send();
-			$pid = $aliResponse->data('out_trade_no');
-			if($aliResponse->isPaid()){
-				self::postPayment($pid, '支付宝当面付');
+			$response = $request->send();
+			if($response->isPaid()){
+				self::postPayment($response->data('out_trade_no'), '支付宝当面付');
 				exit('success');
+			}else{
+				exit('fail');
 			}
 		}catch(Exception $e){
 			Log::error('支付宝当面付 '.$e);

+ 1 - 1
app/Http/Controllers/Gateway/BitpayX.php

@@ -59,7 +59,7 @@ class BitpayX extends AbstractPayment
 			'pay_currency'      => $request->input('type') == 1? 'ALIPAY' : 'WECHAT',
 			'title'             => '支付单号:'.$payment->sn,
 			'description'       => parent::$systemConfig['subject_name']? : parent::$systemConfig['website_name'],
-			'callback_url'      => (parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/payment/notify',
+			'callback_url'      => (parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/callback/notify?method=bitpayx',
 			'success_url'       => parent::$systemConfig['website_url'].'/invoices',
 			'cancel_url'        => parent::$systemConfig['website_url'],
 			'token'             => $this->sign($this->prepareSignId($payment->sn)),

+ 28 - 31
app/Http/Controllers/Gateway/CodePay.php

@@ -2,7 +2,6 @@
 
 namespace App\Http\Controllers\Gateway;
 
-use App\Components\Curl;
 use App\Http\Models\Payment;
 use Auth;
 use Response;
@@ -23,24 +22,24 @@ class CodePay extends AbstractPayment
 			'pay_id'     => $payment->sn,
 			'type'       => $request->input('type'),//1支付宝支付 2QQ钱包 3微信支付
 			'price'      => $payment->amount,
-			'page'       => 4,
+			'page'       => 1,
 			'outTime'    => 900,
 			'param'      => '',
-			'notify_url' => (parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/payment/notify',//通知地址
-			'return_url' => parent::$systemConfig['website_url'].'/payment/'.$payment->sn,//跳转地址
+			'notify_url' => (parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/callback/notify?method=codepay',
+			'return_url' => parent::$systemConfig['website_url'].'/invoices',
 		];
 
-		ksort($data); //重新排序$data数组
-		reset($data); //内部指针指向数组中的第一个元素
+		ksort($data);
+		reset($data);
 
-		$sign = ''; //初始化需要签名的字符为空
-		$urls = ''; //初始化URL参数为空
+		$sign = '';
+		$urls = '';
 
-		foreach($data as $key => $val){ //遍历需要传递的参数
+		foreach($data as $key => $val){
 			if($val == '' || $key == 'sign'){
 				continue;
-			} //跳过这些不参数签名
-			if($sign != ''){ //后面追加&拼接URL
+			}
+			if($sign != ''){
 				$sign .= '&';
 				$urls .= '&';
 			}
@@ -49,38 +48,36 @@ class CodePay extends AbstractPayment
 		}
 		$query = $urls.'&sign='.md5($sign.parent::$systemConfig['codepay_key']); //创建订单所需的参数
 		$url = parent::$systemConfig['codepay_url'].$query; //支付页面
-		$result = json_decode(Curl::send($url));
-
-		$payment->qr_code = $result->qrcode;// 获取收款二维码内容
-		$payment->save();
 
-		return Response::json(['status' => 'success', 'data' => $payment->sn, 'message' => '创建订单成功!']);
+		return Response::json(['status' => 'success', 'url' => $url, 'message' => '创建订单成功!']);
 	}
 
 	public function notify($request)
 	{
-		//以下五行无需更改
-		ksort($_POST); //排序post参数
-		reset($_POST); //内部指针指向数组中的第一个元素
-		$sign = '';//初始化
-		foreach($_POST as $key => $val){ //遍历POST参数
+		ksort($_POST);
+		reset($_POST);
+		$sign = '';
+		foreach($_POST as $key => $val){
 			if($val == '' || $key == 'sign'){
 				continue;
-			} //跳过这些不签名
+			}
 			if($sign){
 				$sign .= '&';
-			} //第一个字符串签名不加& 其他加&连接起来参数
-			$sign .= "$key=$val"; //拼接为url参数形式
+			}
+			$sign .= "$key=$val";
 		}
-		if(!$_POST['pay_no'] || md5($sign.parent::$systemConfig['codepay_key']) != $_POST['sign']){ //不合法的数据
-			exit('fail'); //返回失败,等待下次回调
+		if(!$_POST['pay_no'] || md5($sign.parent::$systemConfig['codepay_key']) != $_POST['sign']){
+			exit('fail');
 		}
+		$payment = Payment::whereSn($_POST['pay_id'])->first();
 
-		$pay_id = $_POST['pay_id']; //需要充值的ID 或订单号 或用户名
-
-		$this->postPayment($pay_id, '码支付');
-
-		exit('success'); //返回成功 不要删除哦
+		if($payment){
+			if($payment->status == 0){
+				$this->postPayment($_POST['pay_id'], '码支付');
+			}
+			exit('success');
+		}
+		exit('fail');
 	}
 
 	public function getReturnHTML($request)

+ 1 - 1
app/Http/Controllers/Gateway/PayJs.php

@@ -25,7 +25,7 @@ class PayJs extends AbstractPayment
 			'total_fee'    => $payment->amount*100,
 			'out_trade_no' => $payment->sn,
 			'attach'       => '',
-			'notify_url'   => (parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/payment/notify',
+			'notify_url'   => (parent::$systemConfig['website_callback_url']? : parent::$systemConfig['website_url']).'/callback/notify?method=payjs',
 		]);
 
 		if(!$result->return_code){

+ 17 - 7
app/Http/Controllers/PaymentController.php

@@ -15,6 +15,7 @@ use App\Http\Models\Payment;
 use App\Http\Models\PaymentCallback;
 use Auth;
 use Illuminate\Http\Request;
+use Log;
 use Response;
 
 /**
@@ -30,7 +31,12 @@ class PaymentController extends Controller
 
 	public static function notify(Request $request)
 	{
-		return self::getClient()->notify($request);
+		self::$method = $request->input('method');
+
+		Log::info(self::$method."回调接口[POST]:".self::$method.var_export($request->all(), TRUE));
+		$result = self::getClient()->notify($request);		
+
+		return 0;
 	}
 
 	public static function getClient()
@@ -64,13 +70,17 @@ class PaymentController extends Controller
 	public static function getStatus(Request $request)
 	{
 		$payment = Payment::whereSn($request->input('sn'))->first();
-		if($payment->status > 0){
-			return Response::json(['status' => 'success', 'data' => '', 'message' => '支付成功']);
-		}elseif($payment->status < 0){
-			return Response::json(['status' => 'error', 'data' => '', 'message' => '订单超时未支付,已自动关闭']);
-		}else{
-			return Response::json(['status' => 'fail', 'data' => '', 'message' => '等待支付']);
+		if($payment){
+			if($payment->status == 1){
+				return Response::json(['status' => 'success', 'data' => '', 'message' => '支付成功']);
+			}elseif($payment->status == -1){
+				return Response::json(['status' => 'error', 'data' => '', 'message' => '订单超时未支付,已自动关闭']);
+			}else{
+				return Response::json(['status' => 'fail', 'data' => '', 'message' => '等待支付']);
+			}
 		}
+
+		return Response::json(['status' => 'error', 'data' => '', 'message' => '未知订单']);
 	}
 
 	// 创建支付订单

+ 2 - 2
app/Http/Controllers/UserController.php

@@ -282,7 +282,7 @@ class UserController extends Controller
 			User::query()->whereId(Auth::user()->id)->decrement('balance', $renewCost*100);
 
 			// 记录余额操作日志
-			$this->addUserBalanceLog(Auth::user()->id, '', Auth::user()->balance, Auth::user()->balance-$renewCost, -1*$renewCost, '用户自行重置流量');
+			Helpers::addUserBalanceLog(Auth::user()->id, '', Auth::user()->balance, Auth::user()->balance-$renewCost, -1*$renewCost, '用户自行重置流量');
 
 			return Response::json(['status' => 'success', 'data' => '', 'message' => '重置成功']);
 		}
@@ -654,7 +654,7 @@ class UserController extends Controller
 		try{
 			DB::beginTransaction();
 			// 写入日志
-			$this->addUserBalanceLog(Auth::user()->id, 0, Auth::user()->balance, Auth::user()->balance+$coupon->amount, $coupon->amount, '用户手动充值 - [充值券:'.$request->input('coupon_sn').']');
+			Helpers::addUserBalanceLog(Auth::user()->id, 0, Auth::user()->balance, Auth::user()->balance+$coupon->amount, $coupon->amount, '用户手动充值 - [充值券:'.$request->input('coupon_sn').']');
 
 			// 余额充值
 			User::uid()->increment('balance', $coupon->amount*100);

+ 1 - 1
app/Http/Middleware/VerifyCsrfToken.php

@@ -12,6 +12,6 @@ class VerifyCsrfToken extends Middleware
 	 * @var array
 	 */
 	protected $except = [
-		"payment/notify"
+		"callback/notify"
 	];
 }

+ 1 - 3
app/Mail/nodeCrashWarning.php

@@ -18,14 +18,12 @@ class nodeCrashWarning extends Mailable implements ShouldQueue
 	public function __construct($id)
 	{
 		$this->id = $id;
-
 	}
 
 	public function build()
 	{
-		$view['content'] = NotificationLog::query()->whereId($this->id)->first()->content;
 
-		return $this->view('emails.nodeCrashWarning', $view)->subject('节点阻断警告');
+		return $this->view('emails.nodeCrashWarning')->subject('节点阻断警告')->with(['content' => NotificationLog::query()->whereId($this->id)->first()->content]);
 	}
 
 	// 发件失败处理

+ 3 - 3
composer.json

@@ -14,7 +14,7 @@
     "ext-json": "*",
     "ext-openssl": "*",
     "barryvdh/laravel-debugbar": "^3",
-    "barryvdh/laravel-ide-helper": "^2.6",
+    "barryvdh/laravel-ide-helper": "^2.7",
     "fideloper/proxy": "^4.3",
     "guzzlehttp/guzzle": "^6.5",
     "ipip/db": "^1.0",
@@ -32,9 +32,9 @@
     "overtrue/laravel-lang": "^3.0",
     "phpoffice/phpspreadsheet": "^1.11",
     "predis/predis": "^1.1",
-    "rap2hpoutre/laravel-log-viewer": "^1",
+    "rap2hpoutre/laravel-log-viewer": "^1.5",
+    "scyllaly/hcaptcha": "^4.1",
     "spatie/laravel-permission": "^3.11",
-    "ssrpanel/hcaptcha": "^2.0",
     "xhat/payjs": "^1.4"
   },
   "require-dev": {

+ 70 - 72
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "e73cace61805e36a643229eea4709ba6",
+    "content-hash": "0b550602bf4341c4d624f01f9422ea61",
     "packages": [
         {
             "name": "barryvdh/laravel-debugbar",
@@ -82,16 +82,16 @@
         },
         {
             "name": "barryvdh/laravel-ide-helper",
-            "version": "v2.6.7",
+            "version": "v2.7.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/barryvdh/laravel-ide-helper.git",
-                "reference": "edd69c5e0508972c81f1f7173236de2459c45814"
+                "reference": "5f677edc14bdcfdcac36633e6eea71b2728a4dbc"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/edd69c5e0508972c81f1f7173236de2459c45814",
-                "reference": "edd69c5e0508972c81f1f7173236de2459c45814",
+                "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/5f677edc14bdcfdcac36633e6eea71b2728a4dbc",
+                "reference": "5f677edc14bdcfdcac36633e6eea71b2728a4dbc",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -113,7 +113,7 @@
                 "illuminate/config": "^5.5|^6|^7",
                 "illuminate/view": "^5.5|^6|^7",
                 "mockery/mockery": "^1.3",
-                "orchestra/testbench": "^3|^4",
+                "orchestra/testbench": "^3|^4|^5",
                 "phpro/grumphp": "^0.17.1",
                 "squizlabs/php_codesniffer": "^3"
             },
@@ -155,7 +155,7 @@
                 "phpstorm",
                 "sublime"
             ],
-            "time": "2020-02-25T20:41:32+00:00"
+            "time": "2020-04-22T09:57:26+00:00"
         },
         {
             "name": "barryvdh/reflection-docblock",
@@ -4815,16 +4815,16 @@
         },
         {
             "name": "rap2hpoutre/laravel-log-viewer",
-            "version": "v1.4.0",
+            "version": "v1.5.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/rap2hpoutre/laravel-log-viewer.git",
-                "reference": "3506baaddbe5661fc4482b048db2ec5cfc5f9025"
+                "reference": "52c2a39ffbaafab13afb7e537c6c53f06e0b5cf5"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/rap2hpoutre/laravel-log-viewer/zipball/3506baaddbe5661fc4482b048db2ec5cfc5f9025",
-                "reference": "3506baaddbe5661fc4482b048db2ec5cfc5f9025",
+                "url": "https://api.github.com/repos/rap2hpoutre/laravel-log-viewer/zipball/52c2a39ffbaafab13afb7e537c6c53f06e0b5cf5",
+                "reference": "52c2a39ffbaafab13afb7e537c6c53f06e0b5cf5",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -4876,7 +4876,60 @@
                 "logging",
                 "lumen"
             ],
-            "time": "2020-03-05T20:25:07+00:00"
+            "time": "2020-04-22T20:15:55+00:00"
+        },
+        {
+            "name": "scyllaly/hcaptcha",
+            "version": "4.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/Scyllaly/hcaptcha.git",
+                "reference": "97ca32c09f9f04ac10aaf394485f0ec49e5a6a75"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/Scyllaly/hcaptcha/zipball/97ca32c09f9f04ac10aaf394485f0ec49e5a6a75",
+                "reference": "97ca32c09f9f04ac10aaf394485f0ec49e5a6a75",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "guzzlehttp/guzzle": "^6.2",
+                "illuminate/support": "5.0.*|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*",
+                "php": ">=5.5.5"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.8"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Scyllaly\\HCaptcha\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "scyllaly",
+                    "email": "scyllaly@github.com"
+                }
+            ],
+            "description": "hCaptcha For Laravel5.x",
+            "keywords": [
+                "captcha",
+                "hcaptcha",
+                "laravel",
+                "laravel5"
+            ],
+            "time": "2020-04-21T16:58:39+00:00"
         },
         {
             "name": "seld/jsonlint",
@@ -5057,61 +5110,6 @@
             ],
             "time": "2020-03-03T21:31:02+00:00"
         },
-        {
-            "name": "ssrpanel/hcaptcha",
-            "version": "2.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/Scyllaly/hcaptcha.git",
-                "reference": "3536768d467270f95054375554060cf75c7b9198"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/Scyllaly/hcaptcha/zipball/3536768d467270f95054375554060cf75c7b9198",
-                "reference": "3536768d467270f95054375554060cf75c7b9198",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "guzzlehttp/guzzle": "^6.2",
-                "illuminate/support": "5.0.*|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*",
-                "php": ">=5.5.5"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "~4.8"
-            },
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "SSRPanel\\HCaptcha\\": "src/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "ssrpanel",
-                    "email": "admin@ssrpanel.com"
-                }
-            ],
-            "description": "hCaptcha For Laravel5.x",
-            "keywords": [
-                "captcha",
-                "hcaptcha",
-                "laravel",
-                "laravel5",
-                "ssrpanel"
-            ],
-            "abandoned": "scyllaly/hcaptcha",
-            "time": "2020-04-13T16:54:55+00:00"
-        },
         {
             "name": "swiftmailer/swiftmailer",
             "version": "v6.2.3",
@@ -7971,16 +7969,16 @@
         },
         {
             "name": "phpunit/phpunit",
-            "version": "8.5.3",
+            "version": "8.5.4",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/phpunit.git",
-                "reference": "67750516bc02f300e2742fed2f50177f8f37bedf"
+                "reference": "8474e22d7d642f665084ba5ec780626cbd1efd23"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/67750516bc02f300e2742fed2f50177f8f37bedf",
-                "reference": "67750516bc02f300e2742fed2f50177f8f37bedf",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8474e22d7d642f665084ba5ec780626cbd1efd23",
+                "reference": "8474e22d7d642f665084ba5ec780626cbd1efd23",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -8056,7 +8054,7 @@
                 "testing",
                 "xunit"
             ],
-            "time": "2020-03-31T08:52:04+00:00"
+            "time": "2020-04-23T04:39:42+00:00"
         },
         {
             "name": "sebastian/code-unit-reverse-lookup",

+ 2 - 2
config/app.php

@@ -157,7 +157,7 @@ return [
 		Misechow\NoCaptcha\NoCaptchaServiceProvider::class, // Google reCAPTCHA
 		Overtrue\LaravelLang\TranslationServiceProvider::class, // 多国语言包功能
 		Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class,//日志查看
-		SSRPanel\HCaptcha\HCaptchaServiceProvider::class, //HCaptcha
+		Scyllaly\HCaptcha\HCaptchaServiceProvider::class, //HCaptcha
 
 		/*
 		 * Application Service Providers...
@@ -199,7 +199,7 @@ return [
 		'File'         => Illuminate\Support\Facades\File::class,
 		'Gate'         => Illuminate\Support\Facades\Gate::class,
 		'Hash'         => Illuminate\Support\Facades\Hash::class,
-		'HCaptcha'     => SSRPanel\HCaptcha\Facades\HCaptcha::class,
+		'HCaptcha'     => Scyllaly\HCaptcha\Facades\HCaptcha::class,
 		'Lang'         => Illuminate\Support\Facades\Lang::class,
 		'Log'          => Illuminate\Support\Facades\Log::class,
 		'Mail'         => Illuminate\Support\Facades\Mail::class,

+ 17 - 10
resources/views/admin/system.blade.php

@@ -1038,6 +1038,18 @@
 											<span class="text-help offset-md-3"> 用于在支付渠道的商品标题显示 </span>
 										</div>
 									</div>
+									<div class="form-group col-lg-6">
+										<div class="row">
+											<label class="col-form-label col-md-3" for="website_callback_url">通用支付回调地址</label>
+											<div class="col-md-7">
+												<div class="input-group">
+													<input type="text" class="form-control" id="website_callback_url" value="{{$website_callback_url}}"/>
+													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('website_callback_url')">修改</button></span>
+												</div>
+											</div>
+											<span class="text-help offset-md-3"> 防止因为网站域名被DNS投毒后导致支付无法正常回调,需带http://或https:// </span>
+										</div>
+									</div>
 								</div>
 								<div class="row pb-70">
 									<div class="form-group col-lg-6">
@@ -1062,14 +1074,14 @@
 									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
-											<label class="col-md-3 col-form-label" for="f2fpay_private_key">RSA私钥</label>
+											<label class="col-md-3 col-form-label" for="f2fpay_private_key">应用私钥</label>
 											<div class="col-md-7">
 												<div class="input-group">
 													<input class="form-control" type="text" id="f2fpay_private_key" value="{{$f2fpay_private_key}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('f2fpay_private_key')">修改</button></span>
 												</div>
 											</div>
-											<span class="text-help offset-md-3">即:rsa_private_key,不包括首尾格式</span>
+											<span class="text-help offset-md-3">生成秘钥软件生成时,产生的应用秘钥</span>
 										</div>
 									</div>
 									<div class="form-group col-lg-6">
@@ -1081,7 +1093,7 @@
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('f2fpay_public_key')">修改</button></span>
 												</div>
 											</div>
-											<span class="text-help offset-md-3"> 注意不是RSA公钥 </span>
+											<span class="text-help offset-md-3"> 注意不是应用公钥! </span>
 										</div>
 									</div>
 								</div>
@@ -1090,7 +1102,7 @@
 										<div class="row">
 											<label class="col-md-3 col-form-label">码支付</label>
 											<div class="col-md-7">
-												请到 <a href="https://codepay.fateqq.com/i/377289">码支付</a> 申请账号,然后下载登录其挂机软件
+												请到 <a href="https://codepay.fateqq.com/i/377289" target="_blank">码支付</a> 申请账号,然后下载登录其挂机软件
 											</div>
 										</div>
 									</div>
@@ -1210,7 +1222,7 @@
             $('#referral_type').selectpicker('val', {{$referral_type}});
             $('#is_email_filtering').selectpicker('val', {{$is_email_filtering}});
             $('#initial_labels_for_user').selectpicker('val', [{{$initial_labels_for_user}}]);
-            $('#is_notification').selectpicker('val', {{$is_notification}});
+            $('#is_notification').selectpicker('val', '{{$is_notification}}');
             $('#is_AliPay').selectpicker('val', '{{$is_AliPay}}');
             $('#is_QQPay').selectpicker('val', '{{$is_QQPay}}');
             $('#is_WeChatPay').selectpicker('val', '{{$is_WeChatPay}}');
@@ -1278,11 +1290,6 @@
             });
         }
 
-        // 自动去除公钥和私钥中的空格和换行
-        $("#alipay_public_key,#alipay_private_key,#f2fpay_public_key,#f2fpay_private_key").on('input', function () {
-            $(this).val($(this).val().replace(/(\s+)/g, ''));
-        });
-
         // 生成网站安全码
         function makeWebsiteSecurityCode() {
             $.get("/makeSecurityCode", function (ret) {

+ 3 - 0
resources/views/coupon/addCoupon.blade.php

@@ -150,18 +150,21 @@
             if ($(this).val() === '2') {
                 $("#discount").attr("required", true);
                 $("#amount").attr("required", false);
+                $("#rule").attr("required", true);
                 $(".discount").show();
                 $(".usage").show();
                 $(".amount").hide();
             } else if ($(this).val() === '3') {
                 $("#discount").attr("required", false);
                 $("#amount").attr("required", true);
+                $("#rule").attr("required", false);
                 $(".discount").hide();
                 $(".usage").hide();
                 $(".amount").show();
             } else {
                 $("#discount").attr("required", false);
                 $("#amount").attr("required", true);
+                $("#rule").attr("required", true);
                 $(".discount").hide();
                 $(".usage").show();
                 $(".amount").show();

+ 0 - 1
resources/views/emails/activeUser.blade.php

@@ -77,7 +77,6 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 0 - 1
resources/views/emails/closeTicket.blade.php

@@ -74,7 +74,6 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 0 - 1
resources/views/emails/newTicket.blade.php

@@ -74,7 +74,6 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 1 - 2
resources/views/emails/nodeCrashWarning.blade.php

@@ -68,13 +68,12 @@
 								<tr style="padding:0;text-align:left;vertical-align:top">
 									<th style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0;text-align:left">
 										<div class="release" style="padding-top:5px;padding-left:20px;padding-bottom:20px;">
-											<p>{{$content}}</p>
+											<p>{!! $content !!}</p>
 										</div>
 									</th>
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tr></tbody>
 							</table>
 						</td>
 					</tr>

+ 0 - 1
resources/views/emails/replyTicket.blade.php

@@ -74,7 +74,6 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 0 - 1
resources/views/emails/sendUserInfo.blade.php

@@ -121,7 +121,6 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 0 - 1
resources/views/emails/sendVerifyCode.blade.php

@@ -74,7 +74,6 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 0 - 1
resources/views/emails/userExpireWarning.blade.php

@@ -74,7 +74,6 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 0 - 1
resources/views/emails/userExpireWarningToday.blade.php

@@ -74,7 +74,6 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 0 - 1
resources/views/emails/userTrafficWarning.blade.php

@@ -74,7 +74,6 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 4 - 3
routes/web.php

@@ -130,7 +130,7 @@ Route::group(['middleware' => ['isForbidden', 'isAdminLogin', 'isAdmin']], funct
 		Route::post("del", "SensitiveWordsController@delSensitiveWords"); // 删除敏感词
 	});
 	Route::get("payment/callbackList", "PaymentController@callbackList"); // 支付回调日志
-	Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index'); // 系统运行日志
+	Route::get('logs', '\Rap2hpoutre\Controllers\LogViewerController@index'); // 系统运行日志
 });
 
 Route::group(['middleware' => ['isForbidden', 'isMaintenance', 'isLogin']], function(){
@@ -161,8 +161,9 @@ Route::group(['middleware' => ['isForbidden', 'isMaintenance', 'isLogin']], func
 
 	Route::group(['prefix' => 'payment'], function(){
 		Route::post('purchase', 'PaymentController@purchase'); // 创建支付
-		Route::any('notify', 'PaymentController@notify'); //支付回调
 		Route::get('getStatus', 'PaymentController@getStatus'); // 获取支付单状态
 		Route::get('{sn}', 'PaymentController@detail'); // 支付单详情
 	});
-});
+});
+
+Route::post('callback/notify', 'PaymentController@notify'); //支付回调