PHPackages                             mabdulmonem/laravel-paytabs - 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. mabdulmonem/laravel-paytabs

ActiveComposer-package[Payment Processing](/categories/payments)

mabdulmonem/laravel-paytabs
===========================

laravel package to implement PayTabs integration with laravel apps

07PHP

Since Jun 20Pushed 3y agoCompare

[ Source](https://github.com/m-abdulmonem/laravel-pay-tabs)[ Packagist](https://packagist.org/packages/mabdulmonem/laravel-paytabs)[ RSS](/packages/mabdulmonem-laravel-paytabs/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel PayTabs PT2

Description
-----------

[](#description)

This Package provides integration with the PayTabs payment gateway.

CONTENTS OF THIS FILE
---------------------

[](#contents-of-this-file)

- Introduction
- Requirements
- Installation
- Configuration
- usage

INTRODUCTION
------------

[](#introduction)

This Package integrates PayTabs online payments into the Laravel Framework starts from version 5.8 - 8.x.

REQUIREMENTS
------------

[](#requirements)

This Package requires no external dependencies.

INSTALLATION
------------

[](#installation)

- composer require mabdulmonem/laravel-paytabs

CONFIGURATION
-------------

[](#configuration)

- composer dump-autoload
- Go to *config/app.php* and in the providers array add

    ```
      Mabdulmonem\LaravelPayTabs\PaypageServiceProvider::class,

    ```
- Create the package config file: (required in laravel &lt;5.5)

    ```
      php artisan vendor:publish --tag=paytabs

    ```
- Go to *config/logging.php* and in the channels array add

    ```
    'PayTabs' => [
    'driver' => 'single',
    'path' => storage_path('logs/paytabs.log'),
    'level' => 'info',
    ],

    ```
- In *config/paytabs.php* add your merchant info.

**Important Hint:**you can pass your merchant info in the environment file with the same key names mentioned in the *config/paytabs.php* file. This value will be returned if no environment variable exists for the given key.

Usage
-----

[](#usage)

- create pay page

    ```
      use Mabdulmonem\LaravelPayTabs\Facades\paypage;

      $pay= paypage::sendPaymentCode('all')
             ->sendTransaction('sale')
              ->sendCart(10,1000,'test')
             ->sendCustomerDetails('Walaa Elsaeed', 'w.elsaeed@paytabs.com', '0101111111', 'test', 'Nasr City', 'Cairo', 'EG', '1234','100.279.20.10')
             ->sendShippingDetails('Walaa Elsaeed', 'w.elsaeed@paytabs.com', '0101111111', 'test', 'Nasr City', 'Cairo', 'EG', '1234','100.279.20.10')
             ->sendURLs('return_url', 'callback_url')
             ->sendLanguage('en')
             ->create_pay_page();
      return $pay;

    ```
- if you want to pass the shipping address as same as billing address you can use

    ```
      >shipping_same_billing()
      and make sure to remove calling
      ->sendShippingDetails.

    ```
- if you want to hide the shipping address you can use

    ```
      ->sendHideShipping(true);

    ```
- if you want to use iframe option instead of redirection you can use

    ```
      ->sendFramed(true);

    ```
- if you want to pass the payment methods you can use

    ```
      ::sendPaymentCode("['creditcard','fawry']")

    ```
- if you want to pass the Tokenization option you can use

    ```
      ->sendTokinse(true)

    ```
- if you want to make a payment via token you can use

    ```
      ->sendTransaction('transaction_type','recurring')
      ->sendToken('token returned from the first payment page created with Tokenization option','transRef returned to you in the same first payment page')

    ```
- if you want to make a payment with user defined you can use

    ```
      ->sendUserDefined(["udf1"=>"UDF1 Test", "udf2"=>"UDF2 Test", "udf3"=>"UDF3 Test"])

    ```
- refund (you can use this function to both refund and partially refund)

    ```
      $refund = Paypage::refund('tran_ref','order_id','amount','refund_reason');
      return $refund;

    ```
- Auth

    ```
      pay= Paypage::sendPaymentCode('all')
             ->sendTransaction('Auth')
              ->sendCart(10,1000,'test')
             ->sendCustomerDetails('Walaa Elsaeed', 'w.elsaeed@paytabs.com', '0101111111', 'test', 'Nasr City', 'Cairo', 'EG', '1234','100.279.20.10')
             ->sendShippingDetails('Walaa Elsaeed', 'w.elsaeed@paytabs.com', '0101111111', 'test', 'Nasr City', 'Cairo', 'EG', '1234','100.279.20.10')
             ->sendURLs('return_url', 'callback_url')
             ->sendLanguage('en')
             ->create_pay_page();
      return $pay;

    ```
- capture (the tran\_ref is the tran\_ref of the Auth transaction you need to capture it.

    you can use this function to both capture and partially capture.)

    ```
       $capture = Paypage::capture('tran_ref','order_id','amount','capture description');
       return $capture;

    ```
- void (the tran\_ref is the tran\_ref of the Auth transaction you need to void it.

    you can use this function to both capture and partially capture)

    ```
      $void = Paypage::void('tran_ref','order_id','amount','void description');
      return $void

    ```
- transaction details

    ```
      $transaction = Paypage::queryTransaction('tran_ref');
      return $transaction;

    ```
- if you face any error you will find it logged in: *storage/logs/paytabs.log*

PAYMENT RESULT NOTIFICATION
---------------------------

[](#payment-result-notification)

PayTabs payment gateway provides means to notify your system with payment result once transaction processing was completed so that your system can update the transaction respective cart.

To get use of this feature do the following:

1- Defining a route (Optional)
------------------------------

[](#1--defining-a-route-optional)

Laravel PayTabs PT2 package comes with a default route for incoming IPN requests. The route URI is */paymentIPN* , if you don't like it this URI just ignore it and define your own. Look at *routes/routes.php* to get a clue.

2- Implementing a means to receive notification
-----------------------------------------------

[](#2--implementing-a-means-to-receive-notification)

To receive notification, do one of the following:

- While creating a pay page, passed this route as a Callback URL to *sendURLs* method, that URL will receive an HTTP Post request with the payment result. For more about callback check: **merchant dashboard** &gt; **Developers** &gt; **Transaction API**.
- Second means is to configure IPN notification from merchant dashboard. For more details about how to configure IPN request and its different formats check: **merchant dashboard** &gt; **Developers** &gt; **Service Types**.

3- Configuring a callback method
--------------------------------

[](#3--configuring-a-callback-method)

Now, you need to configure the plugin with the class\\method that will grab the payment details and perform your custom logic (updating cart in DB, notifying the customer ...etc ).

- In your website *config/paytabs.php* file, add the following:

    ```
      'callback' => env('paytabs_ipn_callback', new namespace\your_class() ),

    ```
- In your class add new method, it must named: **updateCartByIPN**

    ```
      updateCartByIPN( $requestData){
          $cartId= $requestData->getCartId();
          $status= $requestData->getStatus();
          //your logic .. updating cart in DB, notifying the customer ...etc

          //Hold On Reject support
          // if $status = "H" this is mean the transaction is hold on reject.
          // you can't make capture for it from your system.
          // you must make the capture from paytabs dashboard side.
          // make sure to add your ipn value to paytabs dashboard from here:
           "{paytabs portal}/merchant/developers/ipnconfig".
      }

    ```

you can also get transaction reference number. To get the list of available properties check: *Paytabscom\\Laravel\_\_paytabs\\IpnRequest* class.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24464110?v=4)[Mohamed Abdel Al-Monem](/maintainers/mabdulmonem)[@mabdulmonem](https://github.com/mabdulmonem)

---

Top Contributors

[![Walaa-Elsaeed-93](https://avatars.githubusercontent.com/u/79043296?v=4)](https://github.com/Walaa-Elsaeed-93 "Walaa-Elsaeed-93 (18 commits)")[![asabra-paytabs](https://avatars.githubusercontent.com/u/82454211?v=4)](https://github.com/asabra-paytabs "asabra-paytabs (5 commits)")[![mabdulmonem-serv5](https://avatars.githubusercontent.com/u/122724925?v=4)](https://github.com/mabdulmonem-serv5 "mabdulmonem-serv5 (4 commits)")[![mabdulmonem](https://avatars.githubusercontent.com/u/24464110?v=4)](https://github.com/mabdulmonem "mabdulmonem (1 commits)")[![mohamedsabil83](https://avatars.githubusercontent.com/u/10126040?v=4)](https://github.com/mohamedsabil83 "mohamedsabil83 (1 commits)")[![wajihkm](https://avatars.githubusercontent.com/u/18402145?v=4)](https://github.com/wajihkm "wajihkm (1 commits)")

### Embed Badge

![Health badge](/badges/mabdulmonem-laravel-paytabs/health.svg)

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

###  Alternatives

[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)[binkode/laravel-paystack

A description for laravel-paystack.

112.1k](/packages/binkode-laravel-paystack)

PHPackages © 2026

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