Implement Raven Atlas easily with Laravel
The current features have been implemented
composer require localdev/laravel-raven-atlas
After installation, to register the service provider, open config/app.php
and add the following to the providers
key.
'providers' => [
/*
* Package Service Providers...
*/
...
Localdev\RavenAtlas\RavenAtlasServiceProvider::class,
...
]
Also add this to the aliases
'aliases' => [
...
'RavenAtlas' => Localdev\RavenAtlas\Facades\RavenAtlas::class,
...
]
Publish the configuration file using this command:
php artisan vendor:publish --provider="Localdev\RavenAtlas\RavenAtlasServiceProvider"
Open your .env file and add your public key and secret key. Get your keys from here
RAVEN_PUBLIC_KEY='RVPUB-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-xxxxxxxxxxxxx'
RAVEN_SECRET_KEY='RVSEC-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-xxxxxxxxxxxxx'
RAVEN_BASE_URL='https://integrations.getravenbank.com/v1/'
RAVEN_WEBHOOK_SECRET='xxxxxxxxx'
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities. I will appreciate that a lot. Also please add your name to the credits.
Kindly follow me on twitter!
The current features have been implemented
- Virtual Accounts Collections
- Virtual Cards
- Bank Transfer
- Bill Payments
- Transactions
- Verifications
- Webhooks
$payload = [
'first_name'=>'John',
'last_name'=>'Doe',
'phone'=>'08012345678',
'email'=>'johndoe@mail.xyz',
'amount'=>'2000'
];
$response = RavenAtlas::collections()->initiate($payload);
$payload = [
'bvn'=> '1234567890',
'nin'=> '12345678901',
'phone'=> '080123456789',
'email'=> 'johndoe@mail.xyz',
'currency'=> 'usd',
'amount'=> '20',
'image'=> 'string'
];
$response = RavenAtlas::cards()->generate($payload);
$payload = [
'card_id'=>'62f22f80fc9b4e40441831e9',
'amount'=>'2000'
];
$response = RavenAtlas::cards()->fund($payload);
$card_id = '62f22f80fc9b4e40441831e9'
$response = RavenAtlas::cards()->getCard($card_id);
$response = RavenAtlas::cards()->getCards();
$card_id = '62f22f80fc9b4e40441831e9';
$transactions = RavenAtlas::cards()->transactions($card_id);
$payload = [
'card_id'=>'62f22f80fc9b4e40441831e9'
];
$response = RavenAtlas::cards()->freeze($payload);
$payload = [
'card_id'=>'62f22f80fc9b4e40441831e9'
];
$response = RavenAtlas::cards()->unfreeze($payload);
$payload = [
'card_id'=>'62f22f80fc9b4e40441831e9',
'amount'=>'2000'
];
$response = RavenAtlas::cards()->withdraw($payload);
$response = RavenAtlas::cards()->alert();
$response = RavenAtlas::cards()->fees();
$response = RavenAtlas::transfers()->banks();
$payload = [
'amount'=> '2000',
'bank'=>'Access Bank',
'bank_code'=>'044',
'currency'=>'NGN',
'account_number'=>'1234567890',
'account_name'=>'John Doe',
'narration'=>'Transfer to John Doe account',
'reference'=>'rv_1234567890987654321'
];
$response = RavenAtlas::transfers()->initiate($payload);
$payload = [
'bank'=>'035',
'account_number'=>'7790913943'
];
$response = RavenAtlas::transfers()->findAccount($payload);
$trx_ref = '202206041843ACJHBAJ';
$response = RavenAtlas::transfers()->getTransfer($trx_ref);
$response = RavenAtlas::transactions()->all();
$response = RavenAtlas::bills()->dataPlans();
$payload = [
'code'=>'glo100',
'phone_number'=>'09052137639',
'provider_code'=>'1',
'merchant_reference'=>'123456'
];
$response = RavenAtlas::bills()->purchaseData($payload);
$response = RavenAtlas::bills()->dataRecords();
$payload = [
'bvn'=>'22278595765'
];
$response = RavenAtlas::verifications()->bvn($payload);
$payload = [
'nin'=>'87223631145'
];
$response = RavenAtlas::verifications()->nin($payload);
$payload = [
'vin'=>'90F5B23A8C532428586'
];
$response = RavenAtlas::verifications()->pvc($payload);
$payload = [
'passport_number'=>'B54386879',
'first_name'=>'JOHN',
'last_name'=>'DOE',
'date_of_birth'=>'1997-08-06',
'phone_number'=>'075456612902'
];
$response = RavenAtlas::verifications()->passport($payload);
$payload = [
'license_number'=>'RUM47482AA01',
'full_name'=>'JOHN DOE',
'date_of_birth'=>'1995-08-06',
'phone_number'=>'075456612902'
];
$response = RavenAtlas::verifications()->passport($payload);
$payload = [
'image'=>'@file',
'type'=>'bvn',
'token'=>'22278595765',
];
$response = RavenAtlas::verifications()->imageMatch($payload);
Go to app/Http/Middleware/VerifyCsrfToken.php
and add the web route handling your webhook to the $except
array
protected $except = [
'/webhook/raven',
];
Setup a function in your controller to handle the webhook.
public function webhook(Request $request)
{
// This verifies the webhook
$verify = RavenAtlas::verifyWebhook();
if ($verify == true) {
// do something with the webhook payload
...
return response()->json("OK", 200);
}
return response()->json("Error", 400);
}
The MIT License (MIT). Please see License File for more information.
This project is still a work in progress.