PHPackages                             thejano/fib-payouts-laravel - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. thejano/fib-payouts-laravel

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

thejano/fib-payouts-laravel
===========================

A Laravel package for FIB payouts using OAuth2 authentication.

1.1.0(1y ago)019MITPHPPHP &gt;=8.1

Since Mar 9Pushed 1y ago1 watchersCompare

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

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

Fib Payouts Laravel Package
===========================

[](#fib-payouts-laravel-package)

Introduction
------------

[](#introduction)

`thejano/fib-payouts-laravel` is a Laravel package that provides an easy way to interact with the **FIB Payout API** using OAuth2 authentication. It supports:

- Retrieving an **OAuth2 access token**
- **Creating payouts**
- **Authorizing payouts**
- **Fetching payout details**

This package supports **Laravel 9 and above** and simplifies integration with the FIB API.

---

Requests
--------

[](#requests)

All requests need to be authenticated with an **Access Token** acquired via the **OAuth2 Client Credentials Grant Flow** using the `client_id` and `client_secret` provided by FIB.

### API Flow

[](#api-flow)

- **Authentication**: Authenticates the user and provided credentials, returning a token for future requests.
- **Payout Creation**: Creates a payout transaction.
- **Payout Authorization**: Authorizes a payout after its creation, ensuring validation before processing. This step secures the transaction before transferring funds to the recipient's account.
- **Getting Payout Details**: Retrieves all relevant details of a payout transaction.

---

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

[](#installation)

### 1. Install the Package

[](#1-install-the-package)

Run the following command:

```
composer require thejano/fib-payouts-laravel
```

### 2. Publish the Configuration File

[](#2-publish-the-configuration-file)

```
php artisan vendor:publish --provider="TheJano\FibPayouts\Providers\FibPayoutsServiceProvider"
```

This will create the config file `config/fib-payout.php`.

### 3. Configure Environment Variables

[](#3-configure-environment-variables)

Add the following to your `.env` file:

```
FIB_PAYOUT_ENV=staging # Change to 'production' for live API
FIB_PAYOUT_CLIENT_ID=your_client_id
FIB_PAYOUT_CLIENT_SECRET=your_client_secret
```

### 4. Clear Config Cache

[](#4-clear-config-cache)

Run:

```
php artisan config:clear
```

---

Usage
-----

[](#usage)

This package provides a **Facade** for easy usage:

```
use TheJano\FibPayouts\Facades\FibPayout;
```

### 1. Get OAuth2 Token

[](#1-get-oauth2-token)

This function retrieves an OAuth2 access token, which is required for making API requests.

```
$token = FibPayout::getToken();
```

#### **Response:**

[](#response)

```
"your_access_token"
```

### 2. Create a Payout

[](#2-create-a-payout)

This function initiates a payout transaction by providing the necessary details.

```
$payout = FibPayout::createPayout(
    amount: 1000,
    targetAccountIban: 'IQ23FIQB004085190510001',
    description: 'Payment for services'
);
```

#### **Response:**

[](#response-1)

```
{
    "payoutId": "12345-abcde-67890"
}
```

### 3. Authorize a Payout

[](#3-authorize-a-payout)

After creating a payout, it must be authorized to complete the transaction.

```
$response = FibPayout::authorizePayout('12345-abcde-67890');
```

#### **Response:**

[](#response-2)

If the payout is successfully authorized, the response will be empty. If there is an error, it will return an error.

### 4. Get Payout Details

[](#4-get-payout-details)

This function retrieves details of a specific payout transaction.

```
$details = FibPayout::getPayoutDetails('12345-abcde-67890');
```

#### **Expected Response:**

[](#expected-response)

```
{
    "payoutId": "12345-abcde-67890",
    "status": "AUTHORIZED",
    "targetAccountIban": "IQ23FIQB004085190510001",
    "description": "Payment for services",
    "amount": {
        "amount": 1000,
        "currency": "IQD"
    },
    "authorizedAt": "2025-03-09T08:45:52.516174Z",
    "failedAt": null
}
```

#### **Response Fields:**

[](#response-fields)

- `payoutId`: The unique identifier of the payout.
- `status`: The current status of the payout, which can be one of the following: `CREATED`, `AUTHORIZED`, `FAILED`.
- `targetAccountIban`: The IBAN of the recipient's account.
- `description`: A string describing the transaction.
- `amount`: The payout amount to be transferred.
- `authorizedAt`: An integer representing the time of the transaction authorization (e.g., `1720599438`). This field can be `null` if the transaction wasn't authorized.
- `failedAt`: An integer representing the time of the transaction failure (e.g., `1720599438`). This field can be `null` if the transaction was successful.

---

Running Tests
-------------

[](#running-tests)

### Run Pest Tests

[](#run-pest-tests)

```
./vendor/bin/pest
```

If using Laravel:

```
php artisan test
```

---

License
-------

[](#license)

This package is released under the **MIT License**.

---

Support
-------

[](#support)

If you encounter any issues, feel free to open an issue on GitHub or contact `TheJano`.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance45

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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 ~0 days

Total

2

Last Release

431d 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 (6 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/thejano-fib-payouts-laravel/health.svg)

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

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[stechstudio/laravel-jwt

Helper package that makes it easy to generate, consume, and protect routes with JWT tokens in Laravel

126117.6k](/packages/stechstudio-laravel-jwt)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

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