-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
M.H Rezaei tabar
authored and
M.H Rezaei tabar
committed
Oct 16, 2019
1 parent
126e3c6
commit c6874dd
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,40 @@ | ||
# vandar-laravel | ||
laravel library for vandar gateway | ||
|
||
##Installation | ||
###step 1 | ||
run this command : | ||
``composer require rfmhb2/vandar-laravel`` | ||
###step 2 | ||
add this to ``config/services.php`` | ||
```php | ||
'vandar' => [ | ||
'api' => '6cc20e798ba30a2f352c0bf7ebfed11158af14b7', | ||
'test' => false | ||
] | ||
``` | ||
you can find your api in [vandar dashboard](dash.vandar.io). | ||
##Usage | ||
before stating usage of this package first add this line top of the class | ||
```php | ||
use Vandar\Laravel\Facade\Vandar; | ||
``` | ||
first you most send payment request like this | ||
```php | ||
$result = Vandar::request($amount, $mobile = null, $factorNumber = null, $description = null, $callback); | ||
``` | ||
and save ``$result['token']`` for verify payment. | ||
now you can redirect user to gateway | ||
```php | ||
Vandar::redirect(); | ||
//or | ||
Vandar::redirectUrl(); | ||
``` | ||
when user done payment, vandar redirect user to ``$callback`` with a token in url. you can verify payment with pass token to verify method like this | ||
```php | ||
$token=$_GET['token']; | ||
$result = Vandar::verify($token); | ||
``` | ||
you can read more about responses and api [here](https://docs.vandar.io/). | ||
## bug report | ||
if you find a bug add [issue](https://github.com/rfmhb2/vandar-laravel/issues) |