PHPackages                             baselrabia/paymob - 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. baselrabia/paymob

ActiveLibrary[Payment Processing](/categories/payments)

baselrabia/paymob
=================

A Package to help with Paymob integration

1.0.0(4y ago)023MITPHP

Since Aug 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/baselrabia/paymob)[ Packagist](https://packagist.org/packages/baselrabia/paymob)[ Docs](https://github.com/baselrabia/paymob)[ RSS](/packages/baselrabia-paymob/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

 Laravel PayMob
 [![Latest Stable Version](https://camo.githubusercontent.com/09389f4ebd6cc356feca26b1bc18581a6077281c37dc7b1314faa7b8cf81897a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626173656c72616269612f7061796d6f622e737667)](https://packagist.org/packages/baselrabia/paymob) [![Total Downloads](https://camo.githubusercontent.com/b1eb4ad1b893f378ebdb260e46e74e18190eaf857f9f84efea2e3316b0dd4d0e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626173656c72616269612f7061796d6f622e737667)](https://packagist.org/packages/baselrabia/paymob)
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#----laravel-paymob---------)

[Paymob](https://paymob.com/en) integration for laravel.

> Currently Supported
>
> - [Card Payments](https://acceptdocs.paymobsolutions.com/docs/card-payments)
> - [Mobile Wallets](https://acceptdocs.paymobsolutions.com/docs/mobile-wallets)

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

[](#installation)

- install the package

    ```
    composer require baselrabia/paymob
    ```
- publish the package assets with

    ```
    php artisan vendor:publish --provider="Basel\PayMob\PayMobServiceProvider"
    ```

Config
------

[](#config)

- [**config/paymob.php**](./src/config/paymob.php)

- Update your `.env` file

```
ACCEPT_API_KEY=
ACCEPT_MERCHANT_ID=
ACCEPT_CARD_IFRAME_ID=
ACCEPT_CARD_INTEGRATION_ID=
ACCEPT_MW_INTEGRATION_ID=
```

Setup
-----

[](#setup)

- add the package routes to your `routes/web.php` ex.

    ```
    Route::group([
        'prefix'     => 'orders',
        'as'         => 'order.',
        'middleware' => 'auth',
    ], function () {
        Basel\PayMob\PayMobRoutes::routes();
    });

    // OR You Can Use your Own routes like this
    // I used the package in Apis to provide Payment with the mobile APP
        Route::group([
          'prefix'     => 'payment',
          'as'         => 'order.',
          // 'middleware' => ,
      ],
          function () {
              // ctf0\PayMob\PayMobRoutes::routes();

              $controller = config('paymob.controller', '\Basel\PayMob\Controllers\DummyController');

              // Route::get('checkout', [
              //     'as'   => 'checkout',
              //     'uses' => "$controller@checkOut",
              // ]);

              Route::post('process', [
                  'as'   => 'process',
                  'uses' => "$controller@process",
              ])->middleware(['auth:student', 'scopes:student']);

              Route::get('complete', [
                  'as'   => 'complete',
                  'uses' => "$controller@complete",
              ]);

              Route::get('failed', [
                  'as'   => 'failed',
                  'uses' => "$controller@failed",
              ]);
          }
      );
    ```
- add `Billable` to the model you will be billing.
- next add `getBillingData()` which should return all the required fields for the order creation, check [paymob requirements](https://acceptdocs.paymobsolutions.com/docs/accept-standard-redirect) for more info.

    - all the **optional** fields has already been taken care of.

    ```
    use Basel\PayMob\Integrations\Contracts\Billable;

    class Client implements Billable
    {
        // ...

        public function getBillingData(): array
        {
            return [
                'email'        => $this->email,
                'first_name'   => $this->first_name,
                'last_name'    => $this->last_name,
                'street'       => $this->address ?? "NA",
                'phone_number' => $this->phone_number,
            ];
        }
    }
    ```

Usage
-----

[](#usage)

### \# Normal

[](#-normal)

- update [`controller`](./src/config/paymob.php) with your own controller, which should have 3 methods

    > you can check [`DummyController`](./src/Controllers/DummyController.php) Or [`ApiDummyController`](./src/Controllers/ApiDummyController.php) for a more detailed overview.

    type@methodreturnGET`checkOut`returns the view where the user will press the checkout btnPOST`process`get the selected payment type &amp; make a request to paymob serverGET`complete`check for the transaction hmac &amp; save it to your server, for more info [check](https://acceptdocs.paymobsolutions.com/docs/transaction-callbacks#transaction-response-callback).
- test Card

    > MasterCard

    KeyValueCard Number2223000000000007Cardholder NameTest AccountExpiry Month01Expiry Year39CVV100
-

### \# Refund

[](#-refund)

- all you need to is to call `PayMob::refund` and pass to it the `transaction_id` &amp; `amount_in_pounds` that will be refunded, ex.

    > for more info [check](https://acceptdocs.paymobsolutions.com/docs/refund-transaction)

    ```
    PayMob::refund(655, 10);
    ```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

1732d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/27627958?v=4)[Basel Rabia](/maintainers/baselrabia)[@baselrabia](https://github.com/baselrabia)

---

Top Contributors

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

---

Tags

phplaravelpaymentgatewayonlinepaymobweaccept

### Embed Badge

![Health badge](/badges/baselrabia-paymob/health.svg)

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

###  Alternatives

[baklysystems/laravel-paymob

Laravel PayMob online payment gateway package

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

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

491.1k](/packages/omalizadeh-laravel-multi-payment)[dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

312.4k1](/packages/dena-a-iran-payment)

PHPackages © 2026

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