Download the PHP package atendwa/mpesa-artisan without Composer

On this page you can find all versions of the php package atendwa/mpesa-artisan. 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 mpesa-artisan

Integrate M-Pesa Effortlessly with Mpesa Artisan

Latest Stable Version Total Downloads PHP Version License Quality Score Code Style Status

This Laravel package seamlessly integrates M-Pesa payment services, allowing you to effortlessly handle M-Pesa transactions within your Laravel applications. It's the perfect solution for businesses and individuals seeking a reliable mobile money integration.


Shipped with a little magic 🥳🤯

This package has a lot to offer, but I think you'll love these features the most:


Installation via Composer

  1. Run the following command in your terminal to install the package:

  2. Publish the Configuration File

    After installing the package, publish the configuration file using the following Artisan command:

    Published Configuration File

    The configuration file config/mpesa.php should look like this:

  3. Configure your .env File

    Update your .env file with the necessary M-Pesa credentials:


Usage

Before diving into the array of available API endpoints, let's cover how you can easily call any of the service classes.:


Here are a few pointers to keep in mind:


1. Dynamic QR

Use this API to generate a Dynamic QR code, enabling Safaricom M-PESA customers with the My Safaricom App or M-PESA app to scan the QR code. They can then capture the till number and amount and authorize payment for goods and services at select LIPA NA M-PESA (LNM) merchant outlets.

https://developer.safaricom.co.ke/APIs/DynamicQRCode


2. M-Pesa Express Simulate (STK Push)

The Lipa na M-PESA online API, also known as M-PESA Express (STK Push/NI push), facilitates Merchant/Business-initiated C2B (Customer to Business) payments.

https://developer.safaricom.co.ke/APIs/MpesaExpressSimulate


3. M-Pesa Express Query (STK Query)

Use this API to check the status of a Lipa Na M-Pesa Online Payment.

https://developer.safaricom.co.ke/APIs/MpesaExpressQuery


4. Customer To Business Register URL

The Register URL API complements the Customer to Business (C2B) APIs by enabling the receipt of payment notifications to your paybill. This API allows you to register callback URLs through which you will receive notifications for payments made to your pay bill/till number.

https://developer.safaricom.co.ke/APIs/CustomerToBusinessRegisterURL


5. Business To Customer (B2C)

The B2C API allows businesses to make payments directly to customers, such as salary payments, cashback, promotional payments, winnings, withdrawals, and loan disbursements.

https://developer.safaricom.co.ke/APIs/BusinessToCustomer


6. Transaction Status

Check the status of a transaction.

https://developer.safaricom.co.ke/APIs/TransactionStatus


7. Account Balance

The Account Balance API is used to request the balance of a short code, applicable to B2C, buy goods, and pay bill accounts.

https://developer.safaricom.co.ke/APIs/AccountBalance


8. Reversals

https://developer.safaricom.co.ke/APIs/Reversal


9. Tax Remittance

https://developer.safaricom.co.ke/APIs/TaxRemittance


10. Business Pay Bill

https://developer.safaricom.co.ke/APIs/BusinessPayBill


11. Business Buy Goods

https://developer.safaricom.co.ke/APIs/BusinessBuyGoods


12. B2B Express CheckOut

https://developer.safaricom.co.ke/APIs/B2BExpressCheckout


Helpers

Check out some of the handy helper classes included in the package:

Mpesa Callback Request (MpesaCallbackRequest::class)

This class extends Laravel's Http Request class with additional features for parsing M-Pesa callback results and checking transaction success status.


Sanitise Phone Number (SanitisePhoneNumber::class)

This class sanitizes phone numbers, transforming them to the desired format. It has a single method, index, which accepts a phone number and returns the sanitized version.


Parse Response (ParseResponse::class)

This class parses API responses from Safaricom. It has a single method, index, which accepts a response and returns a parsed version. The parsed response will have camel case keys, successfulResponse and successfulResult indicators for success, and a hasErrors key for errors. This class is used internally to ensure consistent response parsing.


All versions of mpesa-artisan with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-openssl Version *
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 atendwa/mpesa-artisan contains the following files

Loading the files please wait ....