omakei / tembo
A package to simplify integration between Laravel web apps with Tembo.
Fund package maintenance!
Omakei
Requires
- php: ^8.4
- illuminate/contracts: ^10.0||^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3||^2.0
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
README
Laravel Tembo
A package to simplify integration between Laravel web apps with Tembo.
Installation
You can install the package via composer:
composer require omakei/tembo
You can publish the config file with:
php artisan vendor:publish --tag="tembo-config"
This is the contents of the published config file:
return [ /* |-------------------------------------------------------------------------- | Tembo Account ID for (Banking & Wallets, Collect Money, Make Payment) API's |-------------------------------------------------------------------------- | | This value is the account ID of your application as provided by Tembo. | */ 'accountId' => env('TEMBO_ACCOUNT_ID', 'Tembo'), /* |-------------------------------------------------------------------------- | Tembo Secret Key for (Banking & Wallets, Collect Money, Make Payment) API's |-------------------------------------------------------------------------- | | This value is the secret key of your application as provided by Tembo. | */ 'secretKey' => env('TEMBO_SECRET_KEY', 'Tembo'), /* |-------------------------------------------------------------------------- | Tembo Token for (Merchant Virtual Accounts, eKYC Services, Remittance Services) API's |-------------------------------------------------------------------------- | | This value is the Bearer token of your application as provided by Tembo. | */ 'token' => env('TEMBO_TOKEN', 'Bearer Tembo Token'), /* |-------------------------------------------------------------------------- | Tembo Environment |-------------------------------------------------------------------------- | | This value is the environment of your application as registered on Tembo. | */ 'environment' => env('TEMBO_ENVIRONMENT', 'sandbox'), ];
Usage
Merchant Virtual Accounts
Create Merchant Virtual Account
use Omakei\Tembo\Tembo; $tembo = new Tembo; $response = $tembo->createMerchantVirtualAccount([ 'companyName' => 'TEMBOPLUS COMPANY LIMITED', 'reference' => 'VT87038HZS', ]);
Create Merchant Virtual Account using Facade Class
use Omakei\Tembo\Facades\Tembo; $response = Tembo::createMerchantVirtualAccount([ 'companyName' => 'TEMBOPLUS COMPANY LIMITED', 'reference' => 'VT87038HZS', ]);
Callback
When the package the callbacks from tembo it will dispatch Event depending on the callback called. You can create a listener and do further process with the callback data which will be pass when the event get dispatch.
On you App\Providers\EventServiceProvider
register a listeners
for the following events.
use Omakei\Tembo\Events\RemittanceCallback; use Omakei\Tembo\Events\TemboCallback; use Omakei\Tembo\Events\UtilityPaymentsCallback; use Omakei\Tembo\Events\WalletToMobileCallback; use App\Listeners\YourEventListener; /** * The event listener mappings for the application. * * @var array */ protected $listen = [ RemittanceCallback::class => [ YourEventListener::class, ], TemboCallback::class => [ YourEventListener::class, ], UtilityPaymentsCallback::class => [ YourEventListener::class, ], WalletToMobileCallback::class => [ YourEventListener::class, ], ];
Tembo documentation
You can find more details about tembo on their documentation in this link Tembo Documentation.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.