-
Notifications
You must be signed in to change notification settings - Fork 4
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
Victor Ighalo
committed
Aug 12, 2020
1 parent
946c648
commit 2a50200
Showing
13 changed files
with
635 additions
and
11 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
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
This service provides access to making secure transactions by collecting the shoppers bank account details and process the payment. | ||
|
||
###Authorize | ||
> | ||
```php | ||
try{ | ||
$uuid = bin2hex(random_bytes(6)); | ||
$transaction_ref = strtoupper(trim($uuid)); | ||
|
||
$payload = [ | ||
"amount" => "1000.00", | ||
"accountName" => "Customer Bank Account Name", | ||
"accountNumber" => "1234567890", | ||
"bankCode" => "033", | ||
"currency" => "NGN", | ||
"country" => "NG", | ||
"email" => "[email protected]" , | ||
"paymentReference" => $transaction_ref | ||
]; | ||
|
||
$trans = SeerBit::Account()->Authorize($payload); | ||
|
||
}catch (\Exception $e){ | ||
|
||
} | ||
|
||
``` | ||
> | ||
###Banks List | ||
> | ||
```php | ||
try{ | ||
$trans = SeerBit::Resources()->Banks(); | ||
}catch (\Exception $e){ | ||
} | ||
|
||
``` | ||
> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,220 @@ | ||
This service provides access to making secure transactions by collecting the shoppers card details and process payment using pre-authentication approach and immediate charge. | ||
|
||
|
||
###Authorize One Time | ||
Authorize and Tokenize a transaction before capturing. | ||
The card will be tokenized automatically after a successful transaction. | ||
|
||
> | ||
```php | ||
try{ | ||
$uuid = bin2hex(random_bytes(6)); | ||
$transaction_ref = strtoupper(trim($uuid)); | ||
|
||
$payload = [ | ||
"currency" => "KES", | ||
"country" => "KE", | ||
"cardNumber" => "5123450000000008", | ||
"expiryMonth" => "06", | ||
"expiryYear" => "21", | ||
"amount" => "100.00", | ||
"cvv" => "100", | ||
"email" => "[email protected]", | ||
"fullName" => "Anonymous Shopper", | ||
"paymentReference" => $transaction_ref | ||
]; | ||
|
||
$trans = SeerBit::Card()->AuthorizeOnetime($payload); | ||
|
||
}catch (\Exception $e){ | ||
|
||
} | ||
|
||
``` | ||
> | ||
###Authorize With Token | ||
Authorize a transaction with a customer token before capturing | ||
|
||
> | ||
```php | ||
try{ | ||
$uuid = bin2hex(random_bytes(6)); | ||
$transaction_ref = strtoupper(trim($uuid)); | ||
|
||
$payload = [ | ||
"currency" => "KES", | ||
"country" => "KE", | ||
"cardToken" => "tk_1d67fb8a-ee8f-4fad-80e7-c30d2d", | ||
"amount" => "100.00", | ||
"email" => "[email protected]", | ||
"fullName" => "Anonymous Shopper", | ||
"paymentReference" => $transaction_ref | ||
]; | ||
|
||
$trans = SeerBit::Card()->AuthorizeWithToken($payload); | ||
|
||
}catch (\Exception $e){ | ||
|
||
} | ||
|
||
``` | ||
> | ||
###Captutue | ||
Capture an authorized transaction | ||
|
||
> | ||
```php | ||
try{ | ||
|
||
$payload = [ | ||
"currency" => "KES", | ||
"country" => "KE", | ||
"amount" => "100.00", | ||
"paymentReference" => "captured_transaction_reference" | ||
]; | ||
|
||
$trans = SeerBit::Card()->Capture($payload); | ||
|
||
}catch (\Exception $e){ | ||
|
||
} | ||
|
||
``` | ||
> | ||
###Cancel | ||
Cancel an authorized transaction | ||
|
||
> | ||
```php | ||
try{ | ||
|
||
$payload = [ | ||
"currency" => "KES", | ||
"country" => "KE", | ||
"amount" => "100.00", | ||
"paymentReference" => "captured_transaction_reference" | ||
]; | ||
|
||
$trans = SeerBit::Card()->Cancel($payload); | ||
|
||
}catch (\Exception $e){ | ||
|
||
} | ||
|
||
``` | ||
> | ||
|
||
###Refund | ||
Refund an authorized transaction | ||
|
||
> | ||
```php | ||
try{ | ||
|
||
$payload = [ | ||
"currency" => "KES", | ||
"country" => "KE", | ||
"amount" => "100.00", | ||
"paymentReference" => "captured_transaction_reference" | ||
]; | ||
|
||
$trans = SeerBit::Card()->Refund($payload); | ||
|
||
}catch (\Exception $e){ | ||
|
||
} | ||
|
||
``` | ||
> | ||
###Tokenize | ||
Tokenize customer's card | ||
|
||
> | ||
```php | ||
try{ | ||
|
||
$uuid = bin2hex(random_bytes(6)); | ||
$transaction_ref = strtoupper(trim($uuid)); | ||
|
||
$payload = [ | ||
"fullName" => "Victor Ighalo", | ||
"currency" => "KES", | ||
"country" => "KE", | ||
"cardNumber" => "5123450000000008", | ||
"expiryMonth" => "06", | ||
"expiryYear" => "21", | ||
"paymentReference" => $transaction_ref | ||
]; | ||
|
||
$trans = SeerBit::Card()->Tokenize($payload); | ||
|
||
}catch (\Exception $e){ | ||
|
||
} | ||
|
||
``` | ||
> | ||
|
||
###Non 3DS Direct Debit plus tokenization | ||
Debit a customer's card without 3DS authentication process. | ||
The card will be tokenized automatically after a successful transaction. | ||
|
||
> | ||
```php | ||
try{ | ||
|
||
$uuid = bin2hex(random_bytes(6)); | ||
$transaction_ref = strtoupper(trim($uuid)); | ||
|
||
$payload = [ | ||
"fullName" => "Victor Ighalo", | ||
"currency" => "KES", | ||
"country" => "KE", | ||
"cardNumber" => "5123450000000008", | ||
"expiryMonth" => "06", | ||
"expiryYear" => "21", | ||
"paymentReference" => $transaction_ref | ||
]; | ||
|
||
$trans = SeerBit::Card()->Non3DSOneTime($payload); | ||
|
||
}catch (\Exception $e){ | ||
|
||
} | ||
|
||
``` | ||
> | ||
###Non 3DS Direct Debit with token | ||
Debit a customer's card without 3DS authentication process. | ||
|
||
> | ||
```php | ||
try{ | ||
|
||
$uuid = bin2hex(random_bytes(6)); | ||
$transaction_ref = strtoupper(trim($uuid)); | ||
|
||
$payload = [ | ||
"amount" => "1000.00", | ||
"fullName" => "john doe", | ||
"currency" => "NGN", | ||
"country" => "NG", | ||
"email" => "[email protected]", | ||
"cardToken" => "tk_e4cae021-e2ce-4b59-9b1e-3f859cefd" | ||
]; | ||
|
||
$trans = SeerBit::Card()->Non3DSWithToken($payload); | ||
|
||
}catch (\Exception $e){ | ||
|
||
} | ||
|
||
``` | ||
> |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#Introduction | ||
|
||
# This SDK enables direct and structured interction with SeerBit API | ||
|
||
Once installed you can easily configure the SDK by providing your credentials in your environment file configuration. | ||
|
||
For full documentation of SeerBit visit [mkdocs.org](https://www.docs.seerbit.com). | ||
|
||
|
||
## Requirements | ||
This package can be used with Laravel 5.8 or higher | ||
PHP 7.1 or higher | ||
|
||
## Installation | ||
|
||
The preferred method is via [composer](https://getcomposer.org). Follow the composer | ||
[installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have | ||
composer installed. | ||
|
||
Once composer is installed, execute the following command in your project root to install this library: | ||
|
||
```bash | ||
composer require seerbit/seerbit-laravel | ||
``` | ||
|
||
The service provider will automatically register itself. | ||
|
||
You can publish the config file with: | ||
```bash | ||
php artisan vendor:publish --provider="SeerbitLaravel\SeerbitServiceProvider" --tag="config" | ||
``` | ||
This is the contents of the config file that will be published to your app's directory path `config/seerbit.php`: | ||
```php | ||
return [ | ||
'environment' => env('SEERBIT_ENVIRONMENT', \Seerbit\Environment::LIVE), | ||
'public_key' => env('SEERBIT_PUBLIC_KEY'), | ||
'secret_key' => env('SEERBIT_SECRET_KEY'), | ||
'token' => env('SEERBIT_TOKEN'), | ||
]; | ||
|
||
``` | ||
|
||
#### | ||
You can find both public and secret keys from your merchant dashboard. | ||
|
||
The token can be generated following the guides [here](https://doc.seerbit.com/getstarted/authentication) | ||
|
||
Replace them by changes the key values in your **.env** file. | ||
|
||
`SEERBIT_ENVIRONMENT="public_key"` | ||
|
||
### | ||
Clear your config cache and restart the server after installation to ensure your config will be loaded. If you’ve been caching configurations locally, clear your config cache with either of these commands: | ||
|
||
```bash | ||
php artisan optimize:clear | ||
# or | ||
php artisan config:clear | ||
``` | ||
|
||
###Usage | ||
Import the namespace: | ||
use SeerbitLaravel\Facades\Seerbit; |
Oops, something went wrong.