omakei/tembo

A package to simplify integration between Laravel web apps with Tembo.

Fund package maintenance!
Omakei

v1.0.0 2025-05-27 17:04 UTC

This package is auto-updated.

Last update: 2025-05-28 12:22:33 UTC


README

Tembo Logo

Laravel Tembo

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.