diff --git a/src/Gateway/Driver.php b/src/Gateway/Driver.php index af702a1b..5786315e 100644 --- a/src/Gateway/Driver.php +++ b/src/Gateway/Driver.php @@ -64,9 +64,7 @@ public function getSuccessUrl(Order $order): string { $url = $this->config['success_url'] ?? Config::get('bazar.gateway.urls.success'); - return URL::to(str_replace(['{order}'], [$order->uuid], $url ?? '/'), [ - 'driver' => $this->name, - ]); + return URL::to(str_replace(['{order}'], [$order->uuid], $url ?? '/')); } /** @@ -76,9 +74,7 @@ public function getFailureUrl(Order $order): string { $url = $this->config['failure_url'] ?? Config::get('bazar.gateway.urls.failure'); - return URL::to(str_replace(['{order}'], [$order->uuid], $url ?? '/'), [ - 'driver' => $this->name, - ]); + return URL::to(str_replace(['{order}'], [$order->uuid], $url ?? '/')); } /** diff --git a/src/Http/Controllers/GatewayController.php b/src/Http/Controllers/GatewayController.php index b407622b..b0264a99 100644 --- a/src/Http/Controllers/GatewayController.php +++ b/src/Http/Controllers/GatewayController.php @@ -2,9 +2,9 @@ namespace Cone\Bazar\Http\Controllers; +use Cone\Bazar\Gateway\Response; use Cone\Bazar\Support\Facades\Gateway; use Illuminate\Http\Request; -use Symfony\Component\HttpFoundation\Response; class GatewayController extends Controller { @@ -15,7 +15,9 @@ public function capture(Request $request, string $driver): Response { $gateway = Gateway::driver($driver); - return $gateway->handleCapture($request, $gateway->resolveOrderForCapture($request))->toResponse($request); + return $gateway->handleCapture( + $request, $gateway->resolveOrderForCapture($request) + ); } /** @@ -23,6 +25,6 @@ public function capture(Request $request, string $driver): Response */ public function notification(Request $request, string $driver): Response { - return Gateway::driver($driver)->handleNotification($request)->toResponse($request); + return Gateway::driver($driver)->handleNotification($request); } }