PHPackages                             yacoubalhaidari/laravel-clickpay - 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. yacoubalhaidari/laravel-clickpay

ActiveLibrary[Payment Processing](/categories/payments)

yacoubalhaidari/laravel-clickpay
================================

Laravel package for ClickPay Transaction API

v1.0.0(1y ago)01MITPHPPHP ^7.4|^8.0|^8.1|^8.2|^8.3|^8.4

Since Jul 1Pushed 1y agoCompare

[ Source](https://github.com/YacoubAl-hardari/laravel-clickpay)[ Packagist](https://packagist.org/packages/yacoubalhaidari/laravel-clickpay)[ RSS](/packages/yacoubalhaidari-laravel-clickpay/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (2)Used By (0)

Laravel ClickPay Package
========================

[](#laravel-clickpay-package)

A simple, all-in-one Laravel package for integrating with the ClickPay Transaction API (hosted, managed, own-form), 3D‑Secure redirect handling, follow‑up transactions (refund/void), transaction &amp; token queries, and PayPage options (`framed`, `hide_shipping`).

---

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

[](#table-of-contents)

1. [Requirements](#requirements)
2. [Installation](#installation)
3. [Configuration](#configuration)
4. [Usage](#usage)

    - [Basic Hosted Payment](#basic-hosted-payment)
    - [Managed‑Form / Token Payment](#managed-form--token-payment)
    - [Own‑Form / Card‑Details Payment](#own-form--card-details-payment)
    - [Including Customer Details](#including-customer-details)
    - [3D‑Secure Redirect Handling](#3d-secure-redirect-handling)
    - [Query Transaction](#query-transaction)
    - [Follow‑Up (Refund / Void)](#follow-up-refund--void)
    - [Token Operations](#token-operations)
5. [Error Handling](#error-handling)
6. [PayPage Options](#paypage-options)
7. [PCI DSS Note](#pci-dss-note)

---

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

[](#requirements)

- PHP 8.0+
- Laravel 8.x or newer
- A ClickPay **Profile ID** &amp; **Server Key**
- Guzzle HTTP (automatically installed via Composer)

---

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

[](#installation)

1. **Require the package** via Composer:

    ```
    composer require yacoubalhaidari/laravel-clickpay
    ```
2. **Publish the config** file:

    ```
     php artisan vendor:publish --provider="ClickPay\Providers\ClickPayServiceProvider" --tag=config
    ```
3. (Optional) **Add the Facade** in `config/app.php`:

    ```
    'aliases' => [
        // ...
        'ClickPay' => ClickPay\Facades\ClickPay::class,
    ],
    ```

---

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

[](#configuration)

Edit `config/clickpay.php`:

```
return [
    'profile_id'   => env('CLICKPAY_PROFILE_ID', 0),
    'server_key'   => env('CLICKPAY_SERVER_KEY', ''),
    'base_url'     => env('CLICKPAY_BASE_URL', 'https://secure.clickpay.com.sa'),
    'return_url'   => env('CLICKPAY_RETURN_URL', null),
    'callback_url' => env('CLICKPAY_CALLBACK_URL', null),

    // المجموعات المسموحة
    'classes'           => ['ecom','moto','cont'],
    'follow_up_types'   => ['refund','void'],
    'page_options'      => ['framed','hide_shipping'],
];
```

Add to your `.env`:

```
CLICKPAY_PROFILE_ID=00000
CLICKPAY_SERVER_KEY=your_server_key_here
CLICKPAY_RETURN_URL=https://yourdomain.com/payment/return
CLICKPAY_CALLBACK_URL=https://yourdomain.com/payment/callback
```

---

Usage
-----

[](#usage)

Inject `ClickPay\ClickPayService` into your controller, or use the `ClickPay` facade.

### Basic Hosted Payment

[](#basic-hosted-payment)

```
use ClickPay\Facades\ClickPay;

$result = ClickPay::transaction([
    'tran_type'        => 'sale',
    'tran_class'       => 'ecom',
    'cart_id'          => (string) Str::uuid(),
    'cart_description' => 'Order #1234',
    'cart_currency'    => 'AED',
    'cart_amount'      => 100.00,
], [
    'framed'        => true,
    'hide_shipping' => true,
]);
```

### Managed‑Form / Token Payment

[](#managedform--token-payment)

```
$result = ClickPay::transaction([
    'tran_type'        => 'sale',
    'tran_class'       => 'ecom',
    'cart_id'          => 'ORDER-789',
    'cart_description' => 'Monthly Subscription',
    'cart_currency'    => 'AED',
    'cart_amount'      => 50.00,
    'payment_token'    => $jsToken,
]);
```

### Own‑Form / Card‑Details Payment

[](#ownform--carddetails-payment)

```
$result = ClickPay::transaction([
    'tran_type'        => 'sale',
    'tran_class'       => 'ecom',
    'cart_id'          => 'EVENT-001',
    'cart_description' => 'Concert Ticket',
    'cart_currency'    => 'AED',
    'cart_amount'      => 75.50,
    'card_details'     => [
        'pan'          => '4111111111111111',
        'expiry_month' => 12,
        'expiry_year'  => 25,
        'cvv'          => '123',
    ],
]);
```

### Including Customer Details

[](#including-customer-details)

You can include `customer_details` in two ways:

1. **Auto‑build defaults** by setting:

    ```
    'include_customer_details' => true,
    ```
2. **Provide specific fields**:

    ```
    'name'    => 'John Smith',
    'email'   => 'jsmith@example.com',
    'phone'   => '971111111111',
    'street1' => '404, 11th St',
    'city'    => 'Dubai',
    'state'   => 'DU',
    'country' => 'AE',
    'zip'     => '00000',
    'ip'      => request()->ip(),
    ```

The package will automatically collect these into a `customer_details` object, filling any missing values with defaults.

### 3D‑Secure Redirect Handling

[](#3dsecure-redirect-handling)

```
public function paymentReturn(Request $req)
{
    try {
        $data = ClickPay::handleReturn($req->all());
        // contains: tranRef, respStatus, respCode, token, customerEmail, etc.
    } catch (Exception $e) {
        // handle invalid/missing signature
    }
}
```

### Query Transaction

[](#query-transaction)

```
$status = ClickPay::query($tranRef);
```

### Follow‑Up (Refund / Void)

[](#followup-refund--void)

```
$refund = ClickPay::followUp('refund', $tranRef, 25.00);
```

### Token Operations

[](#token-operations)

```
$info   = ClickPay::tokenQuery($token);
$delete = ClickPay::deleteToken($token);
```

---

Error Handling
--------------

[](#error-handling)

Throws `ClickPay\Exceptions\ClickPayException` with Arabic messages:

- الحقل "X" مطلوب
- نوع الصف "X" غير صالح
- خيار الصفحة "X" غير مدعوم
- توقيع إعادة التوجيه غير صالح

---

PayPage Options
---------------

[](#paypage-options)

- `framed` → عرض الصفحة داخل iFrame
- `hide_shipping` → إخفاء تفاصيل الشحن من PayPage

---

Enjoy seamless ClickPay integration in your Laravel app! Feel free to open issues or contribute.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance49

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

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

368d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fb3960cf6e949bc5401902a09bf597da5bf4aeaf53c382bb55b1843769c0347?d=identicon)[Yacoub\_Al-haidari](/maintainers/Yacoub_Al-haidari)

---

Top Contributors

[![YacoubAl-hardari](https://avatars.githubusercontent.com/u/94101869?v=4)](https://github.com/YacoubAl-hardari "YacoubAl-hardari (5 commits)")

---

Tags

laravelpaymentClickPay

### Embed Badge

![Health badge](/badges/yacoubalhaidari-laravel-clickpay/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4851.0k](/packages/sebdesign-laravel-viva-payments)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3720.4k](/packages/linkxtr-laravel-qrcode)

PHPackages © 2026

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