PHPackages                             granada-pride/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. granada-pride/paytabs

ActiveLibrary[Payment Processing](/categories/payments)

granada-pride/paytabs
=====================

This provide integration with the PayTabs payment gateway

v2.5.5(7mo ago)3967↑575%MITPHP

Since Aug 10Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/granada-pride-co/paytabs-laravel)[ Packagist](https://packagist.org/packages/granada-pride/paytabs)[ RSS](/packages/granada-pride-paytabs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (19)Used By (0)

![Github All Releases](https://camo.githubusercontent.com/735ac4140299aeebd347483452c04c582cc786ae2759f50efbcdd86cc2ea97c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6772616e6164612d70726964652f70617974616273)

PayTabs Payment Gateway Integration for Laravel
===============================================

[](#paytabs-payment-gateway-integration-for-laravel)

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

[](#table-of-contents)

1. [Description](#description)
2. [Installation](#installation)
3. [Configuration](#configuration)
4. [Usage](#usage)
    - [Creating a PayPage](#create-paypage)
    - [Querying Transactions](#query-transaction)
5. [Troubleshooting](#troubleshooting)
6. [Testing](#testing)
7. [Contribution](#contribution)
8. [License](#license)

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

[](#description)

PayTabs Payment Gateway Integration with Laravel Framework

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

[](#installation)

You can install the package via composer:

```
composer require granada-pride/paytabs
```

> **Note:** This package is compatible with Laravel 9 and higher. Ensure your application meets this requirement before installing.

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

[](#configuration)

After installation, publish the configuration file using the following command:

```
php artisan vendor:publish --provider="GranadaPride\Paytabs\PaytabsServiceProvider"
```

The configuration file paytabs.php will be added to your config directory. Here is a sample configuration:

```
return [
    'profile_id' => env('PAYTABS_PROFILE_ID'),
    'server_key' => env('PAYTABS_SERVER_KEY'),
    'currency' => env('PAYTABS_CURRENCY'),
    'region' => env('PAYTABS_REGION'),
    'iframe_message_target' => env('PAYTABS_IFRAME_MESSAGE_TARGET'),
];
```

Configuration Options
---------------------

[](#configuration-options)

- **profile\_id:** Your PayTabs profile ID, required for API requests.
- **server\_key:** Your PayTabs server key, used for authentication.
- **currency:** The currency code in which payments will be processed (e.g., USD).
- **region:** The region for your PayTabs account (e.g., ARE, SAU).

Usage
-----

[](#usage)

### Create PayPage

[](#create-paypage)

Here’s how to create a payment page using this package:

```
use GranadaPride\Paytabs\Paytabs;
use GranadaPride\Paytabs\DTO\CustomerDetails;

$paytabs = Paytabs::make();

// Set Cart Information
$paytabs->setCart('CART123', 150.00, 'Sample Cart Description');

// Set Customer Information using the CustomerDetails DTO
$customerDetails = new CustomerDetails(
    name: 'John Doe',
    phone: '+123456789',
    email: 'johndoe@example.com',
    street: '123 Main St',
    city: 'Cityville',
    state: 'Stateland',
    country: 'US',
    zipCode: '12345'
);

$paytabs->setCustomer($customerDetails);

// Option 1: Use Customer Information for Shipping if it's the same
$paytabs->useCustomerForShipping();

// Option 2: Set Shipping Information separately if it's different
$shippingDetails = new CustomerDetails(
    name: 'Jane Doe',
    phone: '+987654321',
    email: 'janedoe@example.com',
    street: '456 Market St',
    city: 'Townsville',
    state: 'Regionland',
    country: 'US',
    zipCode: '54321'
);

$paytabs->setShipping($shippingDetails);

// Set URLs and Language
$paytabs->setCallbackUrl('https://yourdomain.com/callback')
        ->setReturnUrl('https://yourdomain.com/return')
        ->setPaypageLang('en');

// To display IFrame
$paytabs->displayIFrame();

// and you sholud update your .env with PAYTABS_IFRAME_MESSAGE_TARGET this A valid HTTPS website URL of your domain (the recipient) that will receive the event. In order for the event to be dispatched, this domain must match exactly (including scheme, hostname, and port).

// Generate Payment Page
$response = $paytabs->paypage();

// Handle the response
dd($response);
```

### Query Transaction

[](#query-transaction)

You can also query a transaction using its reference:

```
use GranadaPride\Paytabs\Paytabs;

$response = Paytabs::make()
    ->queryTransaction('TST2422201903602');

dd($response);
```

Troubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

- **Invalid Credentials:** Ensure that your profile\_id and server\_key in the configuration file are correct.
- **Unsupported Region:** Double-check that the region in your configuration file is valid and supported by PayTabs.
- **Transaction Failure:** Verify the transaction data (e.g., cart amount, customer details) to ensure it meets PayTabs' requirements.

If you encounter other issues, refer to the PayTabs API Documentation for more details.

Testing
-------

[](#testing)

Soon...

Contribution
------------

[](#contribution)

Contributions are welcome! If you’d like to contribute to this package, please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bugfix.
3. Write your code and ensure it is well-documented.
4. Submit a pull request with a clear description of your changes.

License
-------

[](#license)

This package is open-sourced software licensed under the MIT license.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance64

Regular maintenance activity

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.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 ~26 days

Recently: every ~6 days

Total

17

Last Release

220d ago

Major Versions

v1.0.0 → v2.0.02024-08-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/09be670590cd3bf1e47a2a37c816ed67d0dab19b683f740b3df531649e35e330?d=identicon)[husseingaber](/maintainers/husseingaber)

---

Top Contributors

[![blue-elephant-tech](https://avatars.githubusercontent.com/u/148823784?v=4)](https://github.com/blue-elephant-tech "blue-elephant-tech (16 commits)")[![owis-s](https://avatars.githubusercontent.com/u/115589814?v=4)](https://github.com/owis-s "owis-s (11 commits)")[![granada-pride-co](https://avatars.githubusercontent.com/u/171011341?v=4)](https://github.com/granada-pride-co "granada-pride-co (1 commits)")

### Embed Badge

![Health badge](/badges/granada-pride-paytabs/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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