Skip to content

Commit

Permalink
Apply fixes from Duster
Browse files Browse the repository at this point in the history
  • Loading branch information
indykoning authored and actions-user committed Jan 22, 2025
1 parent b79481e commit 979126e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
use Rapidez\Core\Http\Controllers\OrderController;
use Rapidez\Core\Http\Controllers\GetSignedCheckoutController;
use Rapidez\Core\Http\Controllers\OrderController;
use Rapidez\Core\Http\Middleware\VerifyAdminToken;

Route::middleware('api')->prefix('api')->group(function () {
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Route::get('checkout/success', config('rapidez.routing.controllers.checkout-success'))->name('checkout.success');

Route::get('checkout/onepage/success', fn () => redirect(route('checkout.success', request()->query()), 308));
Route::get('checkout/signed', SignedCheckoutController::class)->name('signed-checkout');;
Route::get('checkout/signed', SignedCheckoutController::class)->name('signed-checkout');
Route::get('checkout/{step?}', config('rapidez.routing.controllers.checkout'))->middleware('auth:magento-cart')->name('checkout');
Route::get('search', config('rapidez.routing.controllers.search'))->name('search');
Route::fallback(config('rapidez.routing.controllers.fallback'));
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Controllers/GetSignedCheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class GetSignedCheckoutController
public function __invoke(Request $request)
{
$data = $request->validate([
'mask' => 'required',
'mask' => 'required',
'token' => 'nullable',
]);
$cachekey = (string)Str::uuid();
Cache::put('checkout-'.$cachekey, $data, static::URL_TIMEOUT);
$cachekey = (string) Str::uuid();
Cache::put('checkout-' . $cachekey, $data, static::URL_TIMEOUT);

return ['url' => URL::signedRoute('signed-checkout', ['key' => $cachekey], static::URL_TIMEOUT)];
}
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Controllers/SignedCheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SignedCheckoutController
{
public function __invoke(Request $request)
{
if (! $request->hasValidSignature() || !Cache::has('checkout-' . $request->get('key'))) {
if (! $request->hasValidSignature() || ! Cache::has('checkout-' . $request->get('key'))) {
return redirect(config('rapidez.magento_url'), 301);
}

Expand All @@ -19,7 +19,7 @@ public function __invoke(Request $request)

$response = redirect()->to('checkout');

if (!Quote::whereQuoteIdOrCustomerToken($data['mask'] ?? $data['token'])->exists()) {
if (! Quote::whereQuoteIdOrCustomerToken($data['mask'] ?? $data['token'])->exists()) {
return redirect(config('rapidez.magento_url'), 301);
}

Expand Down

0 comments on commit 979126e

Please sign in to comment.