diff --git a/src/Gateway/Driver.php b/src/Gateway/Driver.php index 0c44b9c5..22cd50c3 100644 --- a/src/Gateway/Driver.php +++ b/src/Gateway/Driver.php @@ -66,7 +66,7 @@ public function getCaptureUrl(Order $order): string */ public function getSuccessUrl(Order $order): string { - return str_replace(['{order}'], [$order->uuid], $this->config['success_url'] ?? '/'); + return URL::to(str_replace(['{order}'], [$order->uuid], $this->config['success_url'] ?? '/')); } /** @@ -74,7 +74,7 @@ public function getSuccessUrl(Order $order): string */ public function getFailureUrl(Order $order): string { - return str_replace(['{order}'], [$order->uuid], $this->config['failure_url'] ?? '/'); + return URL::to(str_replace(['{order}'], [$order->uuid], $this->config['failure_url'] ?? '/')); } /** diff --git a/src/Gateway/Response.php b/src/Gateway/Response.php index e5aa6fdf..604a1d2f 100644 --- a/src/Gateway/Response.php +++ b/src/Gateway/Response.php @@ -86,6 +86,6 @@ public function toResponse($request): BaseResponse new JsonResponse($this->toArray()); } - new RedirectResponse($this->url); + return new RedirectResponse($this->url); } }