Download the PHP package thejano/fib-payouts-laravel without Composer
On this page you can find all versions of the php package thejano/fib-payouts-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thejano/fib-payouts-laravel
More information about thejano/fib-payouts-laravel
Files in thejano/fib-payouts-laravel
Package fib-payouts-laravel
Short Description A Laravel package for FIB payouts using OAuth2 authentication.
License MIT
Informations about the package fib-payouts-laravel
Fib Payouts Laravel Package
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
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
- 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
1. Install the Package
Run the following command:
2. Publish the Configuration File
This will create the config file config/fib-payout.php
.
3. Configure Environment Variables
Add the following to your .env
file:
4. Clear Config Cache
Run:
Usage
This package provides a Facade for easy usage:
1. Get OAuth2 Token
This function retrieves an OAuth2 access token, which is required for making API requests.
Response:
2. Create a Payout
This function initiates a payout transaction by providing the necessary details.
Response:
3. Authorize a Payout
After creating a payout, it must be authorized to complete the transaction.
Response:
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
This function retrieves details of a specific payout transaction.
Expected Response:
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 benull
if the transaction wasn't authorized.failedAt
: An integer representing the time of the transaction failure (e.g.,1720599438
). This field can benull
if the transaction was successful.
Running Tests
Run Pest Tests
If using Laravel:
License
This package is released under the MIT License.
Support
If you encounter any issues, feel free to open an issue on GitHub or contact TheJano
.