diff --git a/config/arb.php b/config/arb.php index 0b4841a..5c21f78 100644 --- a/config/arb.php +++ b/config/arb.php @@ -11,4 +11,8 @@ 'tranportal_password' => env('ARB_TRANPORTAL_PASSWORD'), 'resource_key' => env('ARB_RESOURCE_KEY'), // your resource key 'currency_code' => env('ARB_CURRENCY_CODE', '682'), + 'redirect' => [ + 'success' => env('ARB_REDIRECT_SUCCESS', 'http://localhost:8000/arb/response'), + 'fail' => env('ARB_REDIRECT_FAIL', 'http://localhost:8000/arb/response'), + ] ]; diff --git a/src/Arb.php b/src/Arb.php index eeb397e..c555c33 100644 --- a/src/Arb.php +++ b/src/Arb.php @@ -17,12 +17,12 @@ class Arb /** * @var string The URL to redirect to after a successful payment. */ - protected string $success_url = 'https://api-dev.lockers.com.sa/arb/response'; + protected ?string $success_url; /** * @var string The URL to redirect to after a failed payment. */ - protected string $error_url = 'https://api-dev.lockers.com.sa/arb/response'; + protected ?string $error_url; /** * @var array The data to be sent with the payment request. @@ -284,7 +284,7 @@ public function successUrl(?string $url = null): string|self return $this; } - return $this->success_url; + return $this->success_url ?? config('arb.redirect.success'); } /** @@ -301,7 +301,7 @@ public function failUrl(?string $url = null): string|self return $this; } - return $this->error_url; + return $this->error_url ?? config('arb.redirect.fail'); } /**