PHPackages                             badinansoft/fib-php-sdk - 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. badinansoft/fib-php-sdk

ActiveLibrary[Payment Processing](/categories/payments)

badinansoft/fib-php-sdk
=======================

FIB Online payments service PHP SDK

1.0.1(2y ago)2995↓32.1%MITPHPPHP ^7.4|^8.0

Since May 1Pushed 2y ago2 watchersCompare

[ Source](https://github.com/badinansoft/fib-php-sdk)[ Packagist](https://packagist.org/packages/badinansoft/fib-php-sdk)[ Docs](https://github.com/badinansoft/fib-php-sdk)[ RSS](/packages/badinansoft-fib-php-sdk/feed)WikiDiscussions master Synced 1mo ago

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

FIB (First Iraqi Bank)'s PHP payment SDK
========================================

[](#fib-first-iraqi-banks-php-payment-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c061d7498cd4036040cad8fd9a2ec83988791ce1f9020a6b85d22086f6a1ec61/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626164696e616e736f66742f6669622d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/badinansoft/fib-php-sdk)[![Total Downloads](https://camo.githubusercontent.com/9ae7f4ba260d0e9b9ef37876d075ca91d65b805a3478c93e2ea73a33240ec67a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626164696e616e736f66742f6669622d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/badinansoft/fib-php-sdk)[![GitHub Actions](https://github.com/badinansoft/fib-php-sdk/actions/workflows/main.yml/badge.svg)](https://github.com/badinansoft/fib-php-sdk/actions/workflows/main.yml/badge.svg)

The PHP SDK for First Iraqi Bank's online payment is a library that allows you to integrate First Iraqi Bank's online payment system into your PHP application. The SDK provides a simple and easy-to-use API that allows you to create, status check, and cancel payments.

Features
--------

[](#features)

- User Authentication: Verifying the user's identity and credentials and generating an access token for future requests.
- Payment Creation: Generating QR codes and dynamic links to direct the user to the payment screen when creating a payment.
- Payment Status Check: Checking the current status of a payment.
- Payment Cancellation: Canceling an active payment that has not yet been paid.

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

[](#installation)

You can install the package via composer:

```
composer require badinansoft/fib-php-sdk
```

Usage
-----

[](#usage)

```
// create object instance of class

$fib = new \Badinansoft\FIB\FIB(client_id: '', client_secret:'');
```

ParameterDescription**Client\_id**Client id provided by FIB**client\_secret**Client Secret provided by FIB```
//create a payment
$payment = $fib->payments()
    ->createPayment(amount: 20,
				    currency: 'IQD',
				    description: 'Host Invoice #2832',
				    statusCallbackUrl: 'https://.....')

```

ParameterDescription**amount**the amount of the payment**currency**the currency of the payment; currently only IQD is supported**description**(Optional) Description of the payment to help your customer to identify it in the FIB app, with the maximum length of 50 characters.**statusCallbackUrl**should be able to handle POST requests with request body that contains two properties: - **id:** this will be the payment id
 - **status:** this will be the status of the payment, for more information, go to Check Status endpoint section of this```
	//return all data as stdClass Object
	$payment->getData();
```

##### Expected Response

[](#expected-response)

PropertyDescription**paymentId**A unique identifier of the payment, used later to check the status.**qrCode**A base64-encoded data URL of the QR code image that the user can scan with the FIB mobile app.**readableCode**A payment code that the user can enter manually in case he cannot scan the QR code.**personalAppLink**A link that the user can tap on his mobile phone to go to the corresponding payment screen in the FIB Personal app.**businessAppLink**A link that the user can tap on his mobile phone to go to the corresponding payment screen in the FIB Business app**corporateAppLink**A link that the user can tap on his mobile phone to go to the corresponding payment screen in the FIB Corporate app**validUntil**An ISO-8601-formatted date-time string, representing a moment in time when the payment expires```
//Check payment status
$fib->payments()
    ->paymentStatus(paymentId: '9dfa724f-4784-4487-811b-63057b540503')
	->getData();
```

##### Expected Response

[](#expected-response-1)

PropertyDescription**paymentId**a unique identifier of the payment.**status**Expected values are PAID**validUntil**an ISO-8601-formatted date-time string, representing a moment in time when the payment expires**paidAt**an ISO-8601-formatted date-time string, representing a moment in time when the payment is done.**amount**a JSON object, containing two key-value pairs; the *amount* and *currency* of the payment.**decliningReason**Expected Values are:
-SERVER\_FAILURE: Payment failure due to some internal error.
-PAYMENT\_EXPIRATION: Payment has expired.
-PAYMENT\_CANCELLATION: Payment canceled by the user.```
//Cancel Payment
$fib->payments()
    ->cancelPayment(paymentId: '9dfa724f-4784-4487-811b-63057b540503');
```

### Testing

[](#testing)

```
composer tests
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Shahab Zebari](https://github.com/badinansoft)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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 ~56 days

Total

2

Last Release

1057d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66379072?v=4)[BadinanSoft](/maintainers/badinansoft)[@badinansoft](https://github.com/badinansoft)

![](https://avatars.githubusercontent.com/u/6207967?v=4)[shahab zebari](/maintainers/shahabzebare)[@shahabzebare](https://github.com/shahabzebare)

---

Top Contributors

[![shahabzebare](https://avatars.githubusercontent.com/u/6207967?v=4)](https://github.com/shahabzebare "shahabzebare (7 commits)")[![badinansoft](https://avatars.githubusercontent.com/u/66379072?v=4)](https://github.com/badinansoft "badinansoft (1 commits)")

---

Tags

BadinanSoftfib-php-sdk

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/badinansoft-fib-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/badinansoft-fib-php-sdk/health.svg)](https://phpackages.com/packages/badinansoft-fib-php-sdk)
```

###  Alternatives

[chargebee/chargebee-php

ChargeBee API client implementation for PHP

768.0M9](/packages/chargebee-chargebee-php)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[bitpay/sdk

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

42337.5k4](/packages/bitpay-sdk)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)[karson/mpesa-php-sdk

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

PHPackages © 2026

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