Download the PHP package brotechsploit/daraja without Composer

On this page you can find all versions of the php package brotechsploit/daraja. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package daraja

brotechsploit daraja APi intergration

mpesa stk push made easy , b2c , b2b

Daraja API PHP SDK

A lightweight Object-Oriented PHP SDK for integrating with the Safaricom Daraja API for effecient mpesa payments

This package simplifies working with Daraja services such as STK Push, STK Push Query, OAuth token generation, and other supported endpoints.


Features


Requirements


Installation

Install the package using Composer:


Project Structure


Configuration

edit the .env file with the valid safaricom daraja credentials and place it in the home directory folder to prevent read file errors

Example: MPESA_CONSUMER_KEY=qP50LHCHnaIJajKsOMZAxbC3v0PoGvaj4GhQa02pszLy0e00 MPESA_CONSUMER_SECRET=i7dP8GRQJ4G6avPzM4GfUBKvAJ4pdaRUT0SajUPuEfnUhjAhSScGR4YHcIwnwPKW MPESA_PASSKEY=bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919 MPESA_SHORTCODE=174379 MPESA_CALLBACK_URL=https://example.com/callback/ MPESA_INITIATOR_USERNAME=apiuser MPESA_SECURITY_CREDENTIALS=i7dP8GRQJ4G6avPzM4GfUBKvAJ4pdaRUT0SajUPuEfnUhjAhSScGR4YHcIwnwPKW QueueTimeOutURL=https://example.com/timeout.php ResultURL=https://example.com/result.php


Basic Usage


Callback Handling

Configure your callback URL inside your Safaricom Developer Portal. we have a sample of the callback code in the callback/callback.php The callback data can then be processed and stored according to your application's requirements.

Environment

The package supports:

Simply update your configuration to switch environments.


Example

An example implementation is provided in:


Security

Do not commit your production credentials.

Store sensitive information in your .env file and exclude it from version control using .gitignore.


Contributing

Contributions, bug reports, and feature requests are welcome.

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit your changes.
  4. Open a Pull Request.

Author

Vincent Oloo

If you find this package useful, consider giving the repository a ⭐ on GitHub.


All versions of daraja with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-curl Version *
vlucas/phpdotenv Version ^5.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package brotechsploit/daraja contains the following files

Loading the files please wait ...