mirror of
https://github.com/v2board/v2board.git
synced 2025-06-14 13:47:49 +08:00
update
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Services\PaymentService;
|
||||
use App\Utils\Helper;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Payment;
|
||||
@ -56,7 +57,8 @@ class PaymentController extends Controller
|
||||
if (!Payment::create([
|
||||
'name' => $request->input('name'),
|
||||
'payment' => $request->input('payment'),
|
||||
'config' => $request->input('config')
|
||||
'config' => $request->input('config'),
|
||||
'uuid' => Helper::guid()
|
||||
])) {
|
||||
abort(500, '保存失败');
|
||||
}
|
||||
|
@ -11,10 +11,10 @@ use App\Http\Controllers\Controller;
|
||||
|
||||
class PaymentController extends Controller
|
||||
{
|
||||
public function notify($method, $id, Request $request)
|
||||
public function notify($method, $uuid, Request $request)
|
||||
{
|
||||
try {
|
||||
$paymentService = new PaymentService($method, $id);
|
||||
$paymentService = new PaymentService($method, null, $uuid);
|
||||
$verify = $paymentService->notify($request->input());
|
||||
if (!$verify) abort(500, 'verify error');
|
||||
if (!$this->handle($verify['trade_no'], $verify['callback_no'])) {
|
||||
|
@ -21,7 +21,7 @@ class GuestRoute
|
||||
// Telegram
|
||||
$router->post('/telegram/webhook', 'Guest\\TelegramController@webhook');
|
||||
// Payment
|
||||
$router->match(['get', 'post'], '/payment/notify/{method}/{id}', 'Guest\\PaymentController@notify');
|
||||
$router->match(['get', 'post'], '/payment/notify/{method}/{uuid}', 'Guest\\PaymentController@notify');
|
||||
// Comm
|
||||
$router->get ('/comm/config', 'Guest\\CommController@config');
|
||||
});
|
||||
|
Reference in New Issue
Block a user