Skip to content

Commit

Permalink
Merge pull request #1 from egyjs/config-response-URL
Browse files Browse the repository at this point in the history
Update Arb.php
  • Loading branch information
egyjs authored Apr 2, 2024
2 parents 7f742e8 + 923e6c5 commit 462b987
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions config/arb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]
];
8 changes: 4 additions & 4 deletions src/Arb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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');
}

/**
Expand All @@ -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');
}

/**
Expand Down

0 comments on commit 462b987

Please sign in to comment.