PHPackages                             shabayek/laravel-payment - 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. shabayek/laravel-payment

ActiveLibrary[Payment Processing](/categories/payments)

shabayek/laravel-payment
========================

Laravel Package For Payment Methods

v0.8.0(4y ago)314[1 issues](https://github.com/shabayekdes/laravel-payment/issues)MITPHPPHP ^7.3|^7.4|^8.0

Since Dec 4Pushed 3y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (16)Used By (0)

Laravel Payment Methods
=======================

[](#laravel-payment-methods)

[![Github Status](https://github.com/shabayekdes/laravel-payment/actions/workflows/tests.yml/badge.svg)](https://github.com/shabayekdes/laravel-payment/actions) [![Styleci Status](https://camo.githubusercontent.com/0d0ba8abc173881d8f7441418828fb9de1781fde1c8c8defaa670ba72f908bb0/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3432313936363333312f736869656c643f7374796c653d666c6174266272616e63683d646576656c6f70)](https://github.styleci.io/repos/421966331) [![Packagist version](https://camo.githubusercontent.com/6c7de98ff99350459f597a0c8220a02996170697d5a2ac6765effbec8e479209/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736861626179656b2f6c61726176656c2d7061796d656e74)](https://packagist.org/packages/shabayek/laravel-payment) [![mit](https://camo.githubusercontent.com/fdb5a8a2ffcb18ba0787854b5e285d83aac9df56d6a6f590b4da22f75afc0ff9/68747470733a2f2f696d672e736869656c64732e696f2f61706d2f6c2f6c61726176656c)](https://packagist.org/packages/shabayek/laravel-payment) [![Packagist PHP Version Support](https://camo.githubusercontent.com/c8c7c6c4590aa129fbad57b53893842a5e3a8ee5f707665362c01b419f142d09/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736861626179656b2f6c61726176656c2d7061796d656e74)](https://camo.githubusercontent.com/c8c7c6c4590aa129fbad57b53893842a5e3a8ee5f707665362c01b419f142d09/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736861626179656b2f6c61726176656c2d7061796d656e74) [![Packagist Downloads](https://camo.githubusercontent.com/97cca3f22e70f3e3e0745df0253b089c75d6424b81afacd91cddfabdb68837d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736861626179656b2f6c61726176656c2d7061796d656e74)](https://camo.githubusercontent.com/97cca3f22e70f3e3e0745df0253b089c75d6424b81afacd91cddfabdb68837d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736861626179656b2f6c61726176656c2d7061796d656e74)

This is a Laravel Package for Payment Gateway Integration. It has a clear and consistent API, is fully unit tested, and even comes with an example application to get you started.

> Note this package under development Don't use it in production.

### Usage

[](#usage)

- Install laravel payment package with composer

```
composer require shabayek/laravel-payment
```

- Publish the config file with following command

```
php artisan vendor:publish --provider="Shabayek\Payment\PaymentServiceProvider" --tag=config
```

- Initiate a payment with the following code:

```
$method_id = 1; // payment method id from the config file
$payment = Payment::via($method_id);
```

- Implement customer details contracts on user model by adding **Billable** trait

```
use Shabayek\Payment\Concerns\Billable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Billable, Notifiable;

}
```

- Following columns is default for billable user
    - **first\_name**
    - **last\_name**
    - **email**
    - **phone**

if you want to change the column name you can do add public methods on your model with convention name CamelCase like **firstName** + **Column**FirstNameColumn

```
    /**
     * Get the first name.
     *
     * @return string|null
     */
    public function firstNameColumn()
    {
        return $this->name; // OR $this->first_name;
    }
```

- Implement address details with relation to address model > The default relation is **address** if you want change the relation name you can do add public methods on your user model

```
    /**
     * Get the billable billing relations.
     *
     * @return Model
     */
    public function billingRelation()
    {
        return $this->address_relation; // OR $this->address;
    }
```

- Pass the user model to payment gateway

```
$payment->customer($user);
```

- Add items with loop array of data items

```
    $items = [
        [
            "name" => "item1",
            "price" => 100,
            "quantity" => 2,
            "description" => "item1 description",
        ],
        [
            "name" => "item2",
            "price" => 200,
            "quantity" => 1,
            "description" => "item2 description",
        ],
    ];
    $payment->items($items);
    // OR By One
    $name = "item1";
    $price = 100;
    $quantity = 2; // Default 1
    $description = "item1 description"; // Default null

    $payment->addItem($name, $price, $quantity, $description);
```

- Set transaction id will send to gateway

```
$payment->transaction($transaction_id);
```

- Check the payment is online to get pay url

```
if ($payment->isOnline()) {
    $url = $payment->purchase();
}
```

- The MasterCard method adds a new way to get the checkout form

> pass the transaction model will update successIndicator and return view with checkout form

```
$payment->checkoutForm(Transaction $transaction);
```

- Print the errors messages

```
$payment->getErrors();
$payment->isSuccess();
```

- When callback from payment gateway, you can use the following code to verify the payment

```
$payment = $payment->pay($request);

// function array with payment status and message
// return [
//     'success' => $isSuccess,
//     'message' => $message,
//     'data' => []
// ];
```

- Check the payment status

```
$method_id = 1; // payment method id from the config file
$payment_order_id = 111; // payment order id
$payment_status = Payment::via($method_id)->verify($payment_order_id);
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](https://github.com/shabayekdes/laravel-payment/blob/main/CHANGELOG.md) for more information on what has been changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/shabayekdes/laravel-payment/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you've found a bug regarding security please mail  instead of using the issue tracker.

License
-------

[](#license)

The Laravel payment methods package is open-sourced software licensed under the [MIT license](https://github.com/shabayekdes/laravel-payment/blob/main/LICENSE).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.1% 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 ~13 days

Recently: every ~24 days

Total

11

Last Release

1491d ago

PHP version history (2 changes)v0.1PHP ^7.4|^8.0

v0.5.1PHP ^7.3|^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c28cd4d84ed69dab18acb269c8a02d9c7dff89d787d1587d3b8ee6afd934dfa?d=identicon)[shabayekdes](/maintainers/shabayekdes)

---

Top Contributors

[![shabayekdes](https://avatars.githubusercontent.com/u/24995965?v=4)](https://github.com/shabayekdes "shabayekdes (164 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (18 commits)")

---

Tags

laravelpaymentpaymentslaravelpaymentgatewaymethodpaymobcod

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shabayek-laravel-payment/health.svg)

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

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[evryn/laravel-toman

A simple stable Laravel package to handle popular payment gateways in Iran including ZarinPal and IDPay.

1079.9k](/packages/evryn-laravel-toman)[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)[baklysystems/laravel-paymob

Laravel PayMob online payment gateway package

282.4k](/packages/baklysystems-laravel-paymob)

PHPackages © 2026

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