PHPackages                             thebrightlabs/laravel-qicard-gateway - 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. thebrightlabs/laravel-qicard-gateway

ActiveLibrary[Payment Processing](/categories/payments)

thebrightlabs/laravel-qicard-gateway
====================================

Laravel package for Qi Card payment gateway integration

v2.0.6(4mo ago)692MITPHPPHP ^8.2

Since Aug 26Pushed 4mo agoCompare

[ Source](https://github.com/TheBrightLabs/laravel-qicard-gateway)[ Packagist](https://packagist.org/packages/thebrightlabs/laravel-qicard-gateway)[ Docs](https://github.com/TheBrightLabs/laravel-qicard-gateway)[ RSS](/packages/thebrightlabs-laravel-qicard-gateway/feed)WikiDiscussions 1.x Synced today

READMEChangelog (10)Dependencies (2)Versions (13)Used By (0)

[![Logo](https://camo.githubusercontent.com/a4008be0c8afb6f62e2c7dec79b341c61cf7e7e99657d8b2b9446684eff3f7d2/68747470733a2f2f692e706f7374696d672e63632f485746484372576d2f7169636172642e6a7067)](https://camo.githubusercontent.com/a4008be0c8afb6f62e2c7dec79b341c61cf7e7e99657d8b2b9446684eff3f7d2/68747470733a2f2f692e706f7374696d672e63632f485746484372576d2f7169636172642e6a7067)

Laravel QiCard Gateway
======================

[](#laravel-qicard-gateway)

A simple, secure Laravel package for integrating the Qi Card payment gateway in your application.
This package handles all payment, subscription, and webhook logic for you—just plug it into your project and start accepting Qi Card payments in Iraq.

---

Features
--------

[](#features)

- Easy Qi Card payment integration for Laravel
- Ready-to-use plans and subscriptions tables and migrations
- Secure payment status checks (never trust webhook status alone)
- Webhook support with built-in replay and protection (different verification than the one QiCard proivdes)
- All configuration through environment variables—no code changes needed
- Includes a default seeder for demo plans

---

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

[](#installation)

```
composer require thebrightlabs/laravel-qicard-gateway
```

---

Setup
-----

[](#setup)

1. **Publish config and migrations:**

    ```
    php artisan vendor:publish --provider="Thebrightlabs\QiCard\QiCardServiceProvider"
    ```

    This publishes the config file and database migrations for `plans` and `subscriptions`.
2. **Run migrations:**

    ```
    php artisan migrate
    ```
3. **(Optional) Seed demo plans:**

    ```
    php artisan db:seed --class="Thebrightlabs\QiCard\Seeders\PlansTableSeeder"
    ```

    You can edit, add, or remove plans later using CRUD.

---

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

[](#configuration)

- All settings are in your `.env` file.
- **Sandbox mode** (for testing) is enabled by default; production keys are only needed when you go live.

**Example `.env`:**

```
QI_CARD_MODE=sandbox

# For production, set these:
QI_CARD_API_HOST=your_production_api_url
QI_CARD_USERNAME=your_production_username
QI_CARD_PASSWORD=your_production_password
QI_CARD_TERMINAL_ID=your_production_terminal_id

QI_FINISH_PAYMENT_URL=https://your-app.com/payment/finish
QI_NOTIFICATION_URL=https://your-app.com/qi-card/webhook (we recommend you to keep this as the package route, because we already have handled the secuirty things.)

```

---

Usage
-----

[](#usage)

### 1. Show Plans and Handle Subscriptions

[](#1-show-plans-and-handle-subscriptions)

Display your plans using the `plans` table.
When a user clicks "Subscribe," send a GET request to your payment route with the plan ID.

**Example Blade/Volt:**

```
@foreach($plans as $plan)

        {{ $plan->name }}
        {{ $plan->description }}
        @if($plan->price > 0)
            Subscribe
        @endif

@endforeach
```

**Example Route:**

```
Route::get('/payment/plan/{id}', function ($planId) {
    $plan = Plan::find($planId);
    $user = auth()->user();
    $qiCardGateway = app(QiCardGateway::class);
    $data = [
        'amount' => $plan->price,
        'locale' => app()->getLocale(),
        'description' => $plan->description,
        'currency' => 'IQD',
        'customerInfo' => [
            'customer_name' => $user->name,
            'customer_email' => $user->email,
        ],
        'request_id' => (string)Str::uuid(),
        'additionalInfo' => [
            "user_id" => $user->id,
            "planType" => $plan->type,
            "planUnitCount" => $plan->unit_count,
        ],
    ];
    return $qiCardGateway->makeSubscription($data, $plan);
})->name('submit');
```

### 2. Payment Flow

[](#2-payment-flow)

- User is redirected to Qi Card to complete payment.
- After payment, Qi Card redirects back to your `finishPaymentUrl` and/or calls your `notificationUrl` (webhook).

---

Webhook &amp; Status Checks
---------------------------

[](#webhook--status-checks)

- **Never trust the webhook status directly.**
- When a webhook is received, the package checks the payment status with Qi Card’s official API before updating your subscription.
- Only if the status matches, the subscription is marked as `paid` or `cancelled`.
- If the webhook is suspicious or doesn’t match, it is ignored.

[![Logo](https://camo.githubusercontent.com/d5116427e9ecf617d24655dcc89651cbc3b4cf16b41bee80db358222afa7cb23/68747470733a2f2f692e706f7374696d672e63632f6d6743676e51374b2f53637265656e73686f742d323032352d30382d32352d61742d352d35342d32392d504d2e706e67)](https://camo.githubusercontent.com/d5116427e9ecf617d24655dcc89651cbc3b4cf16b41bee80db358222afa7cb23/68747470733a2f2f692e706f7374696d672e63632f6d6743676e51374b2f53637265656e73686f742d323032352d30382d32352d61742d352d35342d32392d504d2e706e67)

---

Automatic Pending Subscription Cleanup
--------------------------------------

[](#automatic-pending-subscription-cleanup)

- Some users may never finish payment.
- The package provides a console command to check all pending subscriptions and update their status automatically.

**Add to your scheduler (in `routes/console.php`):**

```
Schedule::exec('qiCard:status-check')
    ->everyTenMinutes();
```

- This command checks all pending subscriptions and updates them to `cancelled` if not completed.

---

Plan &amp; Subscription Statuses
--------------------------------

[](#plan--subscription-statuses)

- **pending**: User started payment but hasn’t finished yet.
- **paid**: Payment succeeded and subscription is active.
- **cancelled**: Payment was cancelled or failed.

---

Customization
-------------

[](#customization)

- All config is via `.env`—no code changes needed for production or sandbox.
- Default URL for webhook is recommended for best security and compatibility.

---

Security
--------

[](#security)

- Webhook requests are always verified against Qi Card’s API, not trusted directly.
- You can safely use this package in production.

---

License
-------

[](#license)

MIT

---

Credits
-------

[](#credits)

Developed by TheBrightLabs

---

Let us know if you have questions or suggestions!

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance77

Regular maintenance activity

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Every ~15 days

Recently: every ~8 days

Total

13

Last Release

124d ago

Major Versions

v1.0.3 → v2.0.02026-01-13

1.x-dev → v2.0.12026-01-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ba5d21558cbd93492389d46389d361eac9f86cada96b05be5f4cb3e86ba47b6?d=identicon)[00bx](/maintainers/00bx)

---

Top Contributors

[![00bx](https://avatars.githubusercontent.com/u/32588484?v=4)](https://github.com/00bx "00bx (50 commits)")

---

Tags

iraq-paymentlaravelpayment-gateway-in-phppayment-gateway-integrationqicardlaravelpaymentgatewayiraqqicard

### Embed Badge

![Health badge](/badges/thebrightlabs-laravel-qicard-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/thebrightlabs-laravel-qicard-gateway/health.svg)](https://phpackages.com/packages/thebrightlabs-laravel-qicard-gateway)
```

###  Alternatives

[shetabit/multipay

PHP Payment Gateway Integration Package

293361.0k4](/packages/shetabit-multipay)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4851.0k](/packages/sebdesign-laravel-viva-payments)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42361.9k4](/packages/bitpay-sdk)[evryn/laravel-toman

A simple stable Laravel package to handle popular payment gateways in Iran including ZarinPal and IDPay.

10710.5k](/packages/evryn-laravel-toman)

PHPackages © 2026

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