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

ActiveLibrary[Payment Processing](/categories/payments)

engalirock/laravel-paymob
=========================

Laravel v10 PayMob online payment gateway package

5.2(4w ago)024MITPHPPHP &gt;=8.2

Since Jan 29Pushed 4w ago1 watchersCompare

[ Source](https://github.com/engalirock/laravel-paymob)[ Packagist](https://packagist.org/packages/engalirock/laravel-paymob)[ Docs](https://github.com/engalirock/laravel-paymob)[ RSS](/packages/engalirock-laravel-paymob/feed)WikiDiscussions main Synced yesterday

READMEChangelog (8)Dependencies (2)Versions (11)Used By (0)

Laravel PayMob
==============

[](#laravel-paymob)

[![Latest Stable Version](https://camo.githubusercontent.com/15663ddeeb79915fb84b0b44f678b618f3da69a3da4f2a93d60a68a4e43efc78/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e67616c69726f636b2f6c61726176656c2d7061796d6f622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/engalirock/laravel-paymob)[![Total Downloads](https://camo.githubusercontent.com/abb9cef656698cf08aa614471bea8e7b69bb756b68635e51c7b15445eea9921c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e67616c69726f636b2f6c61726176656c2d7061796d6f622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/engalirock/laravel-paymob)[![License](https://camo.githubusercontent.com/13bcffde2aa5b7d9a1ae438fe91b2f051a1c7e20563ff00663eb3a509bf80c84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e67616c69726f636b2f6c61726176656c2d7061796d6f622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/engalirock/laravel-paymob)

A modern, lightweight Laravel package for integrating **PayMob (Accept) Payment Gateway** in Egypt and other supported regions. Fully compatible with Laravel 10+ and PHP 8.2+.

---

Key Features
------------

[](#key-features)

- **Laravel Auto-Discovery** supported out of the box.
- Supports both **Legacy API** (Order &amp; Payment Keys) and the new **Intentions API** (for unified checkout, wallets, cards, etc.).
- Integrated transaction inquiry and void/refund operations.
- Clean error debugging with HTTP status codes and curl error logs.
- Pre-built `PayMobController` template for callbacks.

---

Table of Contents
-----------------

[](#table-of-contents)

1. [SEO &amp; Description](#laravel-paymob)
2. [Installation](#installation)
3. [Configuration](#configuration)
4. [Modern Integration (Intentions API - Recommended)](#modern-integration-intentions-api-recommended)
5. [Legacy Integration (Steps to make a transaction)](#legacy-integration-steps-to-make-a-transaction-on-paymob-servers)
6. [Debugging &amp; Error Handling](#debugging--error-handling)
7. [PayMobController &amp; Callbacks](#paymobcontroller)
8. [Other Methods](#other-paymob-methods)
9. [License](#license)

---

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

[](#installation)

You can install the package via Composer:

```
composer require engalirock/laravel-paymob
```

Note

**Laravel 10+** supports package auto-discovery, so you do not need to add the ServiceProvider or Facade manually to your `config/app.php`.

If you are running an older setup or want to register it manually:

### Manual Registration (Optional)

[](#manual-registration-optional)

In `config/app.php`:

```
'providers' => [
    ...
    engalirock\PayMob\PayMobServiceProvider::class,
    ...
];

'aliases' => [
    ...
    'PayMob' => engalirock\PayMob\Facades\PayMob::class,
    ...
];
```

---

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

[](#configuration)

Publish the config file using:

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

This will create a `config/paymob.php` file. Fill in your credentials:

```
return [
    'username'       => env('PAYMOB_USERNAME', ''),
    'password'       => env('PAYMOB_PASSWORD', ''),
    'api_key'        => env('PAYMOB_API_KEY', ''),
    'integration_id' => env('PAYMOB_INTEGRATION_ID', ''),
    'iframe_id'      => env('PAYMOB_IFRAME_ID', ''),

    // IP resolution setting to bypass SSL Handshake Issues (Default: force IPv4)
    'ip_resolve'     => defined('CURL_IPRESOLVE_V4') ? CURL_IPRESOLVE_V4 : 1,
];
```

Make sure to set up your **Processed Callback** and **Response Callback** URLs in your PayMob dashboard pointing to your application routes.

---

Modern Integration (Intentions API - Recommended)
-------------------------------------------------

[](#modern-integration-intentions-api---recommended)

PayMob's new **Intentions API** simplifies payment flow integration by reducing multiple backend steps into a single intention.

### 1. Request Auth Token

[](#1-request-auth-token)

```
use engalirock\PayMob\Facades\PayMob;

$auth = PayMob::authPaymob();
$token = $auth->token;
```

### 2. Create Payment Intention

[](#2-create-payment-intention)

Use the `intention` method to build the payment request payload:

```
$data = [
    'amount'          => 15000, // Amount in cents/piasters (e.g. 150.00 EGP)
    'currency'        => 'EGP',
    'payment_methods' => [12345, 67890], // Array of integration IDs (Card, Wallet, etc.)
    'billing' => [
        'email'        => 'user@example.com',
        'first_name'   => 'John',
        'last_name'    => 'Doe',
        'phone_number' => '+201000000000',
        'city'         => 'Cairo',
        'country'      => 'EG',
    ],
    'customer' => [
        'first_name' => 'John',
        'last_name'  => 'Doe',
        'email'      => 'user@example.com',
    ]
];

$intention = PayMob::intention($token, $data);
```

### 3. Unified Checkout URL

[](#3-unified-checkout-url)

Generate the client checkout URL to redirect the user to the unified checkout page:

```
$checkoutUrl = PayMob::unifiedcheckout($publicKey, $intention->client_secret);
return redirect()->away($checkoutUrl);
```

---

Legacy Integration (Steps to make a transaction on PayMob servers)
------------------------------------------------------------------

[](#legacy-integration-steps-to-make-a-transaction-on-paymob-servers)

### 1. API Authentication Request

[](#1-api-authentication-request)

```
$auth = PayMob::authPaymob();
```

### 2. Order Registration Request

[](#2-order-registration-request)

```
$paymobOrder = PayMob::makeOrderPaymob(
    $auth->token,
    $auth->profile->id,
    $order->totalCost * 100, // Total amount in cents
    $order->id // Your order ID
);
```

### 3. Payment Key Generation Request

[](#3-payment-key-generation-request)

```
$paymentKey = PayMob::getPaymentKeyPaymob(
    $integrationId, // Card integration ID
    $auth->token,
    $order->totalCost * 100,
    $paymobOrder->id,
    $user->email,
    $user->firstname,
    $user->lastname,
    $user->phone,
    $city->name,
    $country->name
);
```

### 4. Load Iframe

[](#4-load-iframe)

Use the token from the payment key payload inside the iframe:

```

```

---

Debugging &amp; Error Handling
------------------------------

[](#debugging--error-handling)

If a request fails, you can inspect the response status code, curl errors, and response headers:

```
use engalirock\PayMob\Facades\PayMob;

$response = PayMob::authPaymob();

if (!$response || isset($response->detail)) {
    Log::error('PayMob Auth Failed', [
        'http_code'  => PayMob::last_http_code,
        'curl_error' => PayMob::last_curl_error,
        'headers'    => PayMob::last_response_headers,
    ]);
}
```

---

PayMobController
----------------

[](#paymobcontroller)

A pre-built controller template `PayMobController.php` is published inside your app directory to handle response callbacks. Update the `processedCallback` and `invoice` routes on your PayMob dashboard integration page.

---

Other PayMob Methods
--------------------

[](#other-paymob-methods)

### 1. Transaction Inquiry

[](#1-transaction-inquiry)

Verify payment details using a PayMob order ID:

```
$inquiry = PayMob::transaction_inquiry($token, $orderId);
```

### 2. Get All Orders

[](#2-get-all-orders)

```
$orders = PayMob::getOrders($token, $page = 1);
```

### 3. Get Specific Order

[](#3-get-specific-order)

```
$order = PayMob::getOrder($token, $orderId);
```

### 4. Get All Transactions

[](#4-get-all-transactions)

```
$transactions = PayMob::getTransactions($token, $page = 1);
```

### 5. Get Specific Transaction

[](#5-get-specific-transaction)

```
$transaction = PayMob::getTransaction($token, $transactionId);
```

### 6. Capture Authorized Transaction

[](#6-capture-authorized-transaction)

```
$capture = PayMob::capture($token, $transactionId, $amountCents);
```

---

License
-------

[](#license)

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

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance94

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~95 days

Recently: every ~125 days

Total

10

Last Release

28d ago

Major Versions

1.0 → 2.02024-01-29

2.0 → 3.02024-01-29

3.2 → 4.02025-01-22

4.2 → 5.12025-04-11

PHP version history (2 changes)1.0PHP &gt;=8.1

5.1PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7727fe37b66f539ef1c24e8ef2e95369d21a1698279e9afc6d869076c40337c4?d=identicon)[engalirock](/maintainers/engalirock)

---

Top Contributors

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

---

Tags

phplaravelpaymentgatewayonlinepaymob

### Embed Badge

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

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

###  Alternatives

[baklysystems/laravel-paymob

Laravel PayMob online payment gateway package

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

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

491.2k](/packages/omalizadeh-laravel-multi-payment)

PHPackages © 2026

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