/tanda

This package provides you with a simple tool to make requests to Tanda APIs

Primary LanguagePHPOtherNOASSERTION

Tanda

Latest Version on Packagist Total Downloads Build Status StyleCI

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

composer require edlugz/tanda

Publish Migration Files

php artisan vendor:publish --provider="EdLugz\Tanda\TandaServiceProvider" --tag="migrations"

Fill in all the details you will be requiring for your application. Here are the env variables for quick copy paste.

TANDA_RESULT_URL
TANDA_C2B_RESULT_URL
TANDA_CLIENT_ID
TANDA_CLIENT_SECRET
TANDA_ORG_ID
TANDA_BASE_URL=

Usage

Using the facade

Sub Wallet

Tanda::subwallet()->create($name, $ipnUrl, $username, $password, $customFieldsKeyValue = []);
Tanda::subwallet()->get();
Tanda::subwallet()->update($walletId, $name, $username, $password, $ipnUrl);

C2B - Fund Wallet (send stk push to mobile number)

Tanda::C2B()->request($serviceProviderId, $merchantWallet, $mobileNumber, $amount, $customFieldsKeyValue = []);

P2P - send to internal wallets

Tanda::P2P()->send($senderWallet, $receiverWallet, $amount, $customFieldsKeyValue = []);

B2C - send to bank accounts and mobile wallets

Tanda::B2C()->bank($merchantWallet, $bankCode, $amount, $accountNumber, $narration, $customFieldsKeyValue = []);
Tanda::B2C()->mobile($merchantWallet, $serviceProviderId, $amount, $mobileNumber, $customFieldsKeyValue = []);

B2B - to paybills and till numbers

Tanda::B2B()->buygoods($merchantWallet, $amount, $till, $contact, $customFieldsKeyValue = []);
Tanda::B2B()->paybill($merchantWallet, $amount, $paybill, $accountNumber, $contact, $customFieldsKeyValue = []);

Airtime - prepaid airtime (pinless topup)

Tanda::airtime()->prepaid($serviceProviderId, $amount, $mobileNumber, $customFieldsKeyValue = []);

Utility - kplc, nairobi water and paid tv

Tanda::utility()->postpaid($serviceProviderId, $amount, $accountNumber, $customFieldsKeyValue = []);
Tanda::utility()->prepaid($amount, $accountNumber, $contact, $customFieldsKeyValue = []);
Tanda::utility()->tv($serviceProviderId, $amount, $accountNumber, $customFieldsKeyValue = []);

Transaction - check status

Tanda::transaction()->status($transactionId);

Helper functions - get mno network based on mobile number

Tanda::helper()->serviceProvider($mobileNumber);

Helper functions - receive payout results

Tanda::helper()->payout($data);

Helper functions - receive c2b results

Tanda::helper()->c2b($data);

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email eddy.lugaye@gmail.com instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.