PHPackages                             thejano/zaincash-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. thejano/zaincash-laravel

ActiveLibrary[Payment Processing](/categories/payments)

thejano/zaincash-laravel
========================

A Laravel SDK for integrating with ZainCash payment gateway

1.0.0(1y ago)114PHPPHP &gt;=8.1

Since Feb 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/thejano/zaincash-laravel)[ Packagist](https://packagist.org/packages/thejano/zaincash-laravel)[ RSS](/packages/thejano-zaincash-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

ZainCash Laravel SDK
====================

[](#zaincash-laravel-sdk)

Introduction
------------

[](#introduction)

ZainCash Laravel is a PHP SDK designed to integrate the ZainCash payment gateway with Laravel applications seamlessly. This package provides an easy-to-use interface for initiating and verifying payments.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require thejano/zaincash-laravel
```

Configuration
-------------

[](#configuration)

After installing the package, publish the configuration file using:

```
php artisan vendor:publish --provider="TheJano\ZainCash\Providers\ZainCashPaymentServiceProvider"
```

This will create a `config/zaincash.php` file where you can set your credentials.

Add your credentials in your `.env` file:

```
ZAINCASH_SECRET=your_secret_key
ZAINCASH_MERCHANT_ID=your_merchant_id
ZAINCASH_MSISDN=your_phone_number
ZAINCASH_ENV=staging
ZAINCASH_REDIRECT_URL=https://yourdomain.com/payment/callback
ZAINCASH_PREFIX_ORDER_ID=ORD_
```

Usage
-----

[](#usage)

### Initiate a Payment

[](#initiate-a-payment)

You can initiate a payment using the `ZainCashPayment` facade:

```
use TheJano\ZainCash\Facades\ZainCashPayment;

$response = ZainCashPayment::initiatePayment(
    orderId: '12345',
    amount: 1000.00,
    serviceType: 'purchase',
    redirectUrl: 'https://yourdomain.com/payment/success'
);

$transactionId = $response['id'];
$paymentUrl = ZainCashPayment::getPaymentUrl($transactionId);

return redirect($paymentUrl);
```

### Verify a Payment

[](#verify-a-payment)

```
use TheJano\ZainCash\Facades\ZainCashPayment;

$token = request('token');
$paymentData = ZainCashPayment::verifyPayment($token);

if ($paymentData) {
    // Payment is successful
} else {
    // Payment failed
}
```

### Check Transaction Status

[](#check-transaction-status)

```
use TheJano\ZainCash\Facades\ZainCashPayment;

$transactionId = 'some_transaction_id';
$transactionStatus = ZainCashPayment::checkTransaction($transactionId);
```

Service Provider &amp; Facade
-----------------------------

[](#service-provider--facade)

The package registers `ZainCashPaymentServiceProvider` automatically. It also provides a facade `ZainCashPayment` for convenient usage.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

API Documentation
-----------------

[](#api-documentation)

For more details, visit the official API documentation:

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance43

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

456d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3bae4eda28dfbd2e4a288a22c49c4a93c504c7b483e8d8353d7fea1eabcd921?d=identicon)[drpshtiwan](/maintainers/drpshtiwan)

---

Top Contributors

[![drpshtiwan](https://avatars.githubusercontent.com/u/6718949?v=4)](https://github.com/drpshtiwan "drpshtiwan (4 commits)")

### Embed Badge

![Health badge](/badges/thejano-zaincash-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/thejano-zaincash-laravel/health.svg)](https://phpackages.com/packages/thejano-zaincash-laravel)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
