From 6fa90c7060385010bba41328596173b96552aee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Thu, 17 Dec 2020 12:47:46 +0100 Subject: [PATCH] Change webhook order --- app/Http/Controllers/PaymentWebhookController.php | 2 +- app/PaymentDrivers/CheckoutCom/CreditCard.php | 2 +- routes/api.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/PaymentWebhookController.php b/app/Http/Controllers/PaymentWebhookController.php index c4c67b9fc12c..f024a282d32d 100644 --- a/app/Http/Controllers/PaymentWebhookController.php +++ b/app/Http/Controllers/PaymentWebhookController.php @@ -21,7 +21,7 @@ class PaymentWebhookController extends Controller $this->middleware('guest'); } - public function __invoke(PaymentWebhookRequest $request, string $company_gateway_id, string $company_key) + public function __invoke(PaymentWebhookRequest $request, string $company_key, string $company_gateway_id) { $payment = $request->getPayment(); $client = is_null($payment) ? $request->getClient() : $payment->client; diff --git a/app/PaymentDrivers/CheckoutCom/CreditCard.php b/app/PaymentDrivers/CheckoutCom/CreditCard.php index 5b7a75369744..b3654c9d6a40 100644 --- a/app/PaymentDrivers/CheckoutCom/CreditCard.php +++ b/app/PaymentDrivers/CheckoutCom/CreditCard.php @@ -129,8 +129,8 @@ class CreditCard $payment->{'3ds'} = ['enabled' => true]; $payment->{'success_url'} = route('payment_webhook', [ - 'company_gateway_id' => $this->checkout->company_gateway->hashed_id, 'company_key' => $this->checkout->client->company->company_key, + 'company_gateway_id' => $this->checkout->company_gateway->hashed_id, 'hash' => $this->checkout->payment_hash->hash, ]); } diff --git a/routes/api.php b/routes/api.php index 06aaafe67a6f..ab9635e2ef8c 100644 --- a/routes/api.php +++ b/routes/api.php @@ -185,6 +185,6 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a Route::post('support/messages/send', 'Support\Messages\SendingController'); }); -Route::match(['get', 'post'], 'payment_webhook/{company_gateway_id}/{company_key}', 'PaymentWebhookController')->name('payment_webhook'); +Route::match(['get', 'post'], 'payment_webhook/{company_key}/{company_gateway_id}', 'PaymentWebhookController')->name('payment_webhook'); Route::fallback('BaseController@notFound');