From c6874ddf7ebf813d1f5ce670c42c205571c88dde Mon Sep 17 00:00:00 2001 From: "M.H Rezaei tabar" Date: Wed, 16 Oct 2019 08:49:38 +0330 Subject: [PATCH] add document to README.md --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index cfc297a..5994489 100644 --- a/README.md +++ b/README.md @@ -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) \ No newline at end of file