nabcellent/laravel-kyanda

Kyanda API Library

v2.1.1 2023-03-06 17:31 UTC

README

GitHub TestCI Workflow Github StyleCI Workflow codecov Total Downloads License

This is a Laravel package that interfaces with Kyanda Payments Api. The API enables you to initiate mobile payments, disburse payments to mobile and bank, purchase airtime & bundles* and to pay for utility bills.

Check out their api documentation.

Documentation

Installation

You can install the package via composer:

composer require nabcellent/laravel-kyanda

The package will automatically register itself.

You can publish the config file with the following artisan command:

php artisan kyanda:install

Getting Started

  • Account

Enables you to check the status of items

  1. Account balance
Account::balance();
  1. Transaction status
Account::transactionStatus("KYAAPI___");
  • Utility

Enables purchase of payment of goods and services

  1. Airtime Purchase
Utility::airtimePurchase(0712345678, 100);
  1. Bill Payment
Utility::billPayment(11011011011, 1000, Providers::KPLC_PREPAID);
  • Notification

Enables registration of callback url via API call

  1. Instant Payment Notification callback registration
Notification::registerCallbackURL();
  • Payments

Coming soon


NOTE: Phone Number Validation

The phone validator was built using regex and the latest allocation of prefixes by Communication authority of Kenya (Apr, 2021). Check the docs to see the pdf listing with allocations.

Testing

You can run the tests with:

composer test

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

License

The MIT License (MIT). Please see License File for more information.