PHPackages                             almesery/laravel-geidea - 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. almesery/laravel-geidea

ActiveLibrary[Payment Processing](/categories/payments)

almesery/laravel-geidea
=======================

Geidea Payment Gateway integration for Laravel

1.0.1(3mo ago)03MITPHPPHP ^8.1|^8.2|^8.3|^8.4|^8.5

Since Jan 14Pushed 3mo agoCompare

[ Source](https://github.com/almesery/laravel-geidea-payment)[ Packagist](https://packagist.org/packages/almesery/laravel-geidea)[ RSS](/packages/almesery-laravel-geidea/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Laravel Geidea Payment Gateway
==============================

[](#laravel-geidea-payment-gateway)

A Laravel package for integrating Geidea payment gateway with support for Egypt, Saudi Arabia, and UAE.

Features
--------

[](#features)

- Multi-environment support (Egypt, KSA, UAE)
- Multi-currency support (EGP, SAR, AED)
- Multi-language support (Arabic, English)
- Session-based payment flow with HPP (Hosted Payment Page)
- Comprehensive logging
- Easy configuration
- Facade support
- Helper functions

Requirements
------------

[](#requirements)

- PHP ^8.1|^8.2|^8.3|^8.4|^8.5
- Laravel ^10.0 or ^11.0

**Note**: PHP 8.5 is currently in pre-release. While this package declares support for it, some dependencies in your project may not yet be compatible. For production use, we recommend PHP 8.2, 8.3, or 8.4 (stable versions).

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

[](#installation)

```
composer require almesery/laravel-geidea
```

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --tag=geidea-config
```

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

[](#configuration)

Add to your `.env` file:

```
GEIDEA_MERCHANT_PUBLIC_KEY=your_key
GEIDEA_API_PASSWORD=your_password
GEIDEA_ENVIRONMENT=ksa
GEIDEA_CURRENCY=SAR
GEIDEA_LANGUAGE=ar
```

Usage
-----

[](#usage)

### Using Facade

[](#using-facade)

```
use Almesery\LaravelGeidea\Facades\Geidea;

// Create payment session
$result = Geidea::createSession([
    'amount' => 100.00,
    'currency' => 'SAR',
    'merchant_reference_id' => 'INV123',
    'callback_url' => route('payment.callback'),
    'return_url' => route('payment.return'),
    'customer' => [
        'email' => 'customer@example.com',
        'name' => 'John Doe',
        'phone_number' => '+966501234567',
    ],
]);

if ($result['success']) {
    $sessionId = $result['session_id'];
    $orderId = $result['order_id'];
    // Redirect to checkout page with sessionId
} else {
    // Handle error
    $errorMessage = $result['message'];
}

// Get order details
$orderResult = Geidea::getOrder($orderId);

if ($orderResult['success']) {
    $order = $orderResult['order'];
    $status = $order['status']; // Success, Failed, etc.
}

// Get HPP script URL
$scriptUrl = Geidea::getHppScriptUrl();

// Get merchant public key
$merchantKey = Geidea::getMerchantPublicKey();
```

### Using Helper Functions

[](#using-helper-functions)

```
// Get service instance
$geidea = geidea();

// Get service with custom config
$geidea = geidea([
    'merchant_public_key' => 'custom_key',
    'api_password' => 'custom_password',
    'environment' => 'egypt',
    'currency' => 'EGP',
    'language' => 'en',
]);

// Generate merchant reference
$ref = geidea_merchant_reference('INV', 123); // Returns: INV123
```

Controller Example
------------------

[](#controller-example)

Create a controller to handle payment flow:

```
