PHPackages                             thejano/laravel-qicard-payment - 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. thejano/laravel-qicard-payment

ActiveLibrary[Payment Processing](/categories/payments)

thejano/laravel-qicard-payment
==============================

A Laravel package for QiCard payment gateway integration.

1.0.0(3mo ago)862MITPHPPHP &gt;=8.2CI passing

Since Feb 2Pushed 3mo agoCompare

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

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

QiCard Payment Laravel Package
==============================

[](#qicard-payment-laravel-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b645a6d2551523f87bd24133493091581685eb9538e0476f9ad0b390184cf640/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7468656a616e6f2f6c61726176656c2d7169636172642d7061796d656e742e737667)](https://packagist.org/packages/thejano/laravel-qicard-payment)[![Total Downloads](https://camo.githubusercontent.com/6aba360a095a4f6a2b57a73811956168d83e42dd7af3e89d07365c6b06e2699c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7468656a616e6f2f6c61726176656c2d7169636172642d7061796d656e742e737667)](https://packagist.org/packages/thejano/laravel-qicard-payment)[![Tests](https://github.com/thejano/laravel-qicard-payment/actions/workflows/tests.yml/badge.svg)](https://github.com/thejano/laravel-qicard-payment/actions/workflows/tests.yml)[![PHP Version](https://camo.githubusercontent.com/d840cef9807c8f76051ad687841d67f4d830c84e0d83236968e53124ef6742d5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d3838393242462e737667)](https://php.net/)[![Laravel Version](https://camo.githubusercontent.com/7e86827dc5fe586b871a5879979f29c0110c70c90bd7d97e776d6d1feb5ff927/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31302e7825323025374325323031312e7825323025374325323031322e782d4646324432302e737667)](https://laravel.com)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

A Laravel package for integrating with QiCard Payment Gateway.

Payment Flow
------------

[](#payment-flow)

1. Initiate the payment with the appropriate API call.
2. Upon success, the Gateway responds with a result containing the `formUrl`.
3. Redirect the user to the `formUrl` to complete the payment.
4. The Gateway sends an asynchronous notification to the URL provided in the initial API call.
5. The user will be redirected to the `finishPaymentUrl` with payment status parameters.

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

[](#installation)

Install the package via Composer:

```
composer require thejano/laravel-qicard-payment
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="TheJano\QiCardPayment\Providers\QiCardPaymentServiceProvider"
```

This will create a `config/qicard.php` file.

Set your environment variables in `.env`:

```
QICARD_USERNAME=your_username
QICARD_PASSWORD=your_password
QICARD_TERMINAL_ID=your_terminal_id
QICARD_BASE_URL=https://uat-sandbox-3ds-api.qi.iq/api/v1
QICARD_CURRENCY=IQD
QICARD_LOCALE=en_US
QICARD_FINISH_URL=https://yourapp.com/payment/finish
QICARD_NOTIFICATION_URL=https://yourapp.com/payment/notification
```

Usage
-----

[](#usage)

### Creating a Payment

[](#creating-a-payment)

```
use TheJano\QiCardPayment\Services\QiCardPayment;
use TheJano\QiCardPayment\Helpers\TransactionHelper;

$requestId = TransactionHelper::generateRequestId();
$paymentData = QiCardPayment::make()->createPayment($requestId, 50000);

if ($paymentData->isSuccessful()) {
    return redirect($paymentData->getPaymentUrl());
}
```

### Using the Facade

[](#using-the-facade)

```
use TheJano\QiCardPayment\Facades\QiCardPayment;
use TheJano\QiCardPayment\Helpers\TransactionHelper;

$requestId = TransactionHelper::generateRequestId();
$paymentData = QiCardPayment::createPayment($requestId, 50000);

return redirect($paymentData->getPaymentUrl());
```

### With Customer Info

[](#with-customer-info)

```
use TheJano\QiCardPayment\Services\QiCardPayment;
use TheJano\QiCardPayment\Data\CustomerInfo;
use TheJano\QiCardPayment\Helpers\TransactionHelper;

$customerInfo = new CustomerInfo([
    'firstName' => 'John',
    'lastName' => 'Doe',
    'phone' => '009647xxxxxxxxx',
    'email' => 'john.doe@example.com',
]);

$requestId = TransactionHelper::generateRequestId();
$paymentData = QiCardPayment::make()->createPayment(
    $requestId,
    50000,
    'IQD',
    $customerInfo
);
```

### Checking Payment Status

[](#checking-payment-status)

```
use TheJano\QiCardPayment\Facades\QiCardPayment;

$response = QiCardPayment::getPaymentStatus('payment-id-here');
```

### Canceling a Payment

[](#canceling-a-payment)

```
use TheJano\QiCardPayment\Facades\QiCardPayment;
use TheJano\QiCardPayment\Helpers\TransactionHelper;

$requestId = TransactionHelper::generateRequestId();
$response = QiCardPayment::cancelPayment('payment-id', $requestId, 50000);

if ($response->canceled) {
    // Payment canceled successfully
}
```

### Processing a Refund

[](#processing-a-refund)

```
use TheJano\QiCardPayment\Facades\QiCardPayment;
use TheJano\QiCardPayment\Helpers\TransactionHelper;

$requestId = TransactionHelper::generateRequestId();
$refundResponse = QiCardPayment::refundPayment('payment-id', $requestId, 25000);

if ($refundResponse->isSuccessful()) {
    // Refund processed successfully
}
```

Response Data Properties
------------------------

[](#response-data-properties)

### QiCardPaymentResponse

[](#qicardpaymentresponse)

PropertyTypeDescription`success`boolIndicates if the API request was successful`requestId`string|nullUnique request identifier`paymentId`string|nullPayment identifier`amount`float|nullPayment amount`confirmedAmount`float|nullConfirmed amount (after payment)`currency`string|nullCurrency code`status`string|nullPayment status (see Payment Statuses)`paymentType`string|nullPayment type (e.g., CARD)`formUrl`string|nullURL to redirect user for payment`canceled`boolWhether payment was canceled`withoutAuthenticate`boolWhether 3DS authentication was bypassed`details`array|nullPayment details (card info, auth info)`cancels`array|nullList of cancel operations`errorCode`int|nullError code if failed`errorMessage`string|nullError message if failed#### Helper Methods

[](#helper-methods)

```
$response->isSuccessful();        // API request was successful
$response->isPaid();              // Status is SUCCESS
$response->isCreated();           // Status is CREATED
$response->isFormShowed();        // Status is FORM_SHOWED
$response->isFailed();            // Status is FAILED
$response->isAuthenticationFailed(); // Status is AUTHENTICATION_FAILED
$response->isCanceled();          // Payment was canceled
$response->getMaskedPan();        // Get masked card number
$response->getPaymentSystem();    // Get card network (VISA, MASTER_CARD)
$response->getAuthId();           // Get authorization ID
$response->getRrn();              // Get retrieval reference number
```

### QiCardRefundResponse

[](#qicardrefundresponse)

PropertyTypeDescription`success`boolIndicates if refund was successful`requestId`string|nullUnique request identifier`refundId`string|nullRefund identifier`paymentId`string|nullOriginal payment identifier`amount`float|nullRefund amount`currency`string|nullCurrency code`status`string|nullRefund status`message`string|nullRefund message`details`array|nullRefund transaction detailsPayment Statuses
----------------

[](#payment-statuses)

StatusDescription`CREATED`Payment has been created, awaiting user action`FORM_SHOWED`Payment form has been displayed to user`SUCCESS`Payment completed successfully`FAILED`Payment failed`AUTHENTICATION_FAILED`3DS authentication failedHTTP Response Codes
-------------------

[](#http-response-codes)

CodeStatusDescription`200`OKRequest processed successfully`400`Bad RequestInvalid request parameters or payment state`401`UnauthorizedInvalid credentials or missing authentication`500`Internal Server ErrorServer-side error occurredError Codes
-----------

[](#error-codes)

When a request fails, the response contains an `error` object:

```
{
  "error": {
    "code": 18,
    "message": "INCORRECT_TRANSFER_STATE"
  }
}
```

CodeMessageDescription`18``INCORRECT_TRANSFER_STATE`Payment is not in the correct state for the requested operationAuthor
------

[](#author)

**Dr. Pshtiwan Mahmood**

- GitHub: [@drpshtiwan](https://github.com/drpshtiwan)
- Website: [thejano.com](https://thejano.com)

License
-------

[](#license)

This package is open-source and licensed under the [MIT License](LICENSE).

API Documentation
-----------------

[](#api-documentation)

For more details, visit the official API documentation:

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance81

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

99d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3bae4eda28dfbd2e4a288a22c49c4a93c504c7b483e8d8353d7fea1eabcd921?d=identicon)[drpshtiwan](/maintainers/drpshtiwan)

---

Top Contributors

[![drpshtiwan](https://avatars.githubusercontent.com/u/6718949?v=4)](https://github.com/drpshtiwan "drpshtiwan (3 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/thejano-laravel-qicard-payment/health.svg)

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

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)

PHPackages © 2026

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