PHPackages                             asciisd/kashier - 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. asciisd/kashier

ActiveLibrary[Payment Processing](/categories/payments)

asciisd/kashier
===============

A Laravel package for Kashier payment gateway integration

v1.0.5(1y ago)0288MITPHPPHP ^8.2

Since Jan 22Pushed 1y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (6)Versions (6)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7bab2ce9fb25416a7c574dc39eea9e1eba3bcf867fa85de596e1c8d2686ad203/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617363696973642f6b6173686965722e7376673f7374796c653d666c6174)](https://packagist.org/packages/asciisd/kashier)[![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/14db15d1cf516e6549ec3473c85a0d3cf8fe203a6ea3b471d35ccf940e9a7291/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617363696973642f6b6173686965722e7376673f7374796c653d666c6174)](https://packagist.org/packages/asciisd/kashier)

Kashier Payment Gateway for Laravel
===================================

[](#kashier-payment-gateway-for-laravel)

A Laravel package for integrating with the [Kashier](https://kashier.io) payment gateway in your Laravel applications.

Overview
--------

[](#overview)

This package provides a simple and elegant way to integrate Kashier payment processing into your Laravel applications. It handles payment requests, callbacks, and webhooks with minimal configuration.

Features
--------

[](#features)

- Easy integration with Kashier payment gateway
- Support for multiple payment methods (cards, wallets, bank installments)
- Secure payment processing with hash verification
- Webhook handling for payment notifications
- Response handling for payment callbacks
- Event-driven architecture for custom payment processing logic

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

[](#installation)

You can install the package via composer:

```
composer require asciisd/kashier
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="Asciisd\\Kashier\\Providers\\KashierServiceProvider" --tag="config"
```

Then, set your Kashier credentials in your `.env` file:

```
KASHIER_MID=your-merchant-id
KASHIER_API_KEY=your-api-key
KASHIER_SECRET_KEY=your-secret-key
KASHIER_MODE=test # or live
KASHIER_CURRENCY=EGP # or any other supported currency
KASHIER_CALLBACK_URL=https://your-website.com/payment-complete # optional custom redirect URL

```

Usage
-----

[](#usage)

### Basic Payment Processing

[](#basic-payment-processing)

```
use Asciisd\Kashier\Facades\Kashier;

// Generate a payment URL
$paymentUrl = Kashier::buildPaymentUrl(
    amount: 100, // Amount in the smallest currency unit (e.g., piasters for EGP)
    orderId: 'order-123', // Your unique order ID
    attributes: [
        'customerName' => 'John Doe',
        'customerEmail' => 'john@example.com',
        'customerMobile' => '01234567890',
        // Additional attributes as needed
    ]
);

// Redirect the user to the payment URL
return redirect()->away($paymentUrl);
```

### Customizing Payment Methods

[](#customizing-payment-methods)

```
use Asciisd\Kashier\Facades\Kashier;

// Allow only specific payment methods
$paymentUrl = Kashier::setAllowedMethods('card,wallet')
    ->buildPaymentUrl(100, 'order-123');
```

### Handling Payment Responses

[](#handling-payment-responses)

The package automatically handles payment responses at the `/kashier/response` endpoint. You can listen for the `KashierResponseHandled` event to process successful payments:

```
use Asciisd\Kashier\Events\KashierResponseHandled;
use Illuminate\Support\Facades\Event;

Event::listen(function (KashierResponseHandled $event) {
    $paymentData = $event->payload;

    // Process the payment data
    // $paymentData['paymentStatus'] contains the payment status
    // $paymentData['merchantOrderId'] contains your order ID
    // ...
});
```

#### Custom Redirect After Payment

[](#custom-redirect-after-payment)

By default, users are shown a receipt page after completing payment. If you prefer to redirect users to your own custom page, you can set the `KASHIER_CALLBACK_URL` in your `.env` file:

```
KASHIER_CALLBACK_URL=https://your-website.com/payment-complete

```

When this is configured, users will be redirected to your custom URL after payment processing, with all payment data included as query parameters. This allows you to create a completely custom post-payment experience.

### Handling Webhooks

[](#handling-webhooks)

Kashier will send webhook notifications to the `/kashier/webhook` endpoint. You can listen for the `KashierWebhookHandled` event to process these notifications:

```
use Asciisd\Kashier\Events\KashierWebhookHandled;
use Illuminate\Support\Facades\Event;

Event::listen(function (KashierWebhookHandled $event) {
    $webhookData = $event->payload;

    // Process the webhook data
    // Update order status, send notifications, etc.
});
```

### Retrieving Transaction Details

[](#retrieving-transaction-details)

```
use Asciisd\Kashier\Facades\Kashier;

try {
    $transactionDetails = Kashier::getTransactionDetails('order-123');

    // Process transaction details
    // $transactionDetails['paymentStatus'] contains the payment status
    // ...
} catch (Exception $e) {
    // Handle error
}
```

Security
--------

[](#security)

The package automatically verifies the signature of incoming webhook and response requests to ensure they are legitimate and have not been tampered with.

Events
------

[](#events)

- `KashierResponseHandled`: Dispatched when a payment response is received
- `KashierWebhookHandled`: Dispatched when a webhook notification is received

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance48

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~23 days

Total

5

Last Release

387d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77636067?v=4)[ASCII SD](/maintainers/asciisd)[@asciisd](https://github.com/asciisd)

---

Top Contributors

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

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/asciisd-kashier/health.svg)

```
[![Health](https://phpackages.com/badges/asciisd-kashier/health.svg)](https://phpackages.com/packages/asciisd-kashier)
```

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[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)

PHPackages © 2026

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