diff --git a/app/Http/Controllers/Pay/AlipayController.php b/app/Http/Controllers/Pay/AlipayController.php index b64072f0..e8ae966d 100644 --- a/app/Http/Controllers/Pay/AlipayController.php +++ b/app/Http/Controllers/Pay/AlipayController.php @@ -78,6 +78,9 @@ public function notifyUrl(Request $request) if (!$payGateway) { return 'error'; } + if($payGateway->pay_handleroute != '/pay/alipay'){ + return 'fail'; + } $config = [ 'app_id' => $payGateway->merchant_id, 'ali_public_key' => $payGateway->merchant_key, diff --git a/app/Http/Controllers/Pay/CoinbaseController.php b/app/Http/Controllers/Pay/CoinbaseController.php index 9cbf5c04..30487b80 100644 --- a/app/Http/Controllers/Pay/CoinbaseController.php +++ b/app/Http/Controllers/Pay/CoinbaseController.php @@ -92,6 +92,9 @@ public function notifyUrl(Request $request) if (!$payGateway) { return 'fail'; } + if($payGateway->pay_handleroute != 'pay/coinbase'){ + return 'fail'; + } $secret = $payGateway->merchant_pem;//共享密钥 $sig2 = hash_hmac( 'sha256', $payload, $secret ); $result_str=array("confirmed","resolved");//返回的结果字符串数组 diff --git a/app/Http/Controllers/Pay/EpusdtController.php b/app/Http/Controllers/Pay/EpusdtController.php index 37a7d147..8dba0475 100644 --- a/app/Http/Controllers/Pay/EpusdtController.php +++ b/app/Http/Controllers/Pay/EpusdtController.php @@ -79,6 +79,9 @@ public function notifyUrl(Request $request) if (!$payGateway) { return 'fail'; } + if($payGateway->pay_handleroute != 'pay/epusdt'){ + return 'fail'; + } $signature = $this->epusdtSign($data, $payGateway->merchant_id); if ($data['signature'] != $signature) { //不合法的数据 return 'fail'; //返回失败 继续补单 diff --git a/app/Http/Controllers/Pay/MapayController.php b/app/Http/Controllers/Pay/MapayController.php index a6e0e485..9b99840f 100644 --- a/app/Http/Controllers/Pay/MapayController.php +++ b/app/Http/Controllers/Pay/MapayController.php @@ -62,6 +62,9 @@ public function notifyUrl(Request $request) if (!$payGateway) { return 'fail'; } + if($payGateway->pay_handleroute != '/pay/mapay'){ + return 'fail'; + } $query = signquery_string($data); if (!$data['pay_no'] || md5($query . $payGateway->merchant_pem ) != $data['sign']) { //不合法的数据 return 'fail'; //返回失败 继续补单 diff --git a/app/Http/Controllers/Pay/PayjsController.php b/app/Http/Controllers/Pay/PayjsController.php index 956a3ff5..62e2de65 100644 --- a/app/Http/Controllers/Pay/PayjsController.php +++ b/app/Http/Controllers/Pay/PayjsController.php @@ -57,6 +57,9 @@ public function notifyUrl(Request $request) if (!$payGateway) { return 'error'; } + if($payGateway->pay_handleroute != '/pay/payjs'){ + return 'fail'; + } config(['payjs.mchid' => $payGateway->merchant_id, 'payjs.key' => $payGateway->merchant_pem]); $notify_info = Payjs::notify(); $totalFee = bcdiv($notify_info['total_fee'], 100, 2); diff --git a/app/Http/Controllers/Pay/PaypalPayController.php b/app/Http/Controllers/Pay/PaypalPayController.php index b5eb4e44..70451d50 100644 --- a/app/Http/Controllers/Pay/PaypalPayController.php +++ b/app/Http/Controllers/Pay/PaypalPayController.php @@ -95,6 +95,9 @@ public function returnUrl(Request $request) if (!$payGateway) { return 'error'; } + if($payGateway->pay_handleroute != '/pay/paypal'){ + return 'error'; + } $paypal = new ApiContext( new OAuthTokenCredential( $payGateway->merchant_key, diff --git a/app/Http/Controllers/Pay/PaysapiController.php b/app/Http/Controllers/Pay/PaysapiController.php index 5c4b51d9..f45f42e3 100644 --- a/app/Http/Controllers/Pay/PaysapiController.php +++ b/app/Http/Controllers/Pay/PaysapiController.php @@ -89,7 +89,9 @@ public function notifyUrl(Request $request) if (!$payGateway) { return 'error'; } - + if($payGateway->pay_handleroute != '/pay/paysapi'){ + return 'error'; + } $temps = md5($data['orderid'] . $data['orderuid'] . $data['paysapi_id'] . $data['price'] . $data['realprice'] . $payGateway->merchant_pem); if ($temps != $data['key']){ return 'fail'; diff --git a/app/Http/Controllers/Pay/WepayController.php b/app/Http/Controllers/Pay/WepayController.php index 124e8c3d..1797053d 100644 --- a/app/Http/Controllers/Pay/WepayController.php +++ b/app/Http/Controllers/Pay/WepayController.php @@ -66,6 +66,9 @@ public function notifyUrl() if (!$payGateway) { return 'error'; } + if($payGateway->pay_handleroute != '/pay/wepay'){ + return 'error'; + } $config = [ 'app_id' => $payGateway->merchant_id, 'mch_id' => $payGateway->merchant_key, diff --git a/app/Http/Controllers/Pay/YipayController.php b/app/Http/Controllers/Pay/YipayController.php index 0e1a5795..d2f8e7e3 100644 --- a/app/Http/Controllers/Pay/YipayController.php +++ b/app/Http/Controllers/Pay/YipayController.php @@ -67,6 +67,9 @@ public function notifyUrl(Request $request) if (!$payGateway) { return 'fail'; } + if($payGateway->pay_handleroute != '/pay/yipay'){ + return 'fail'; + } ksort($data); //重新排序$data数组 reset($data); //内部指针指向数组中的第一个元素 $sign = '';