rawahamid/laravel-fib-integration is a Laravel package for laravel fib integration.
It currently has 15 GitHub stars and 215 downloads on Packagist (latest version v1.0.3).
Install it with composer require rawahamid/laravel-fib-integration.
Discover more Laravel packages by rawahamid
or browse all Laravel packages to compare alternatives.
Last updated
Laravel integration for first iraqi bank payment
You can install the package through Composer
composer require rawahamid/laravel-fib-integration
Then publish the config file of the package using the vendor publish command
php artisan vendor:publish --tag="fib"
All that is left to do is to define four env configuration variables inside .env file
FIB_ENVIRONMENT="stage"
FIB_CALLBACK_URL="https://localhost:8000/fib-callback-url"
FIB_CLIENT_ID="client-id"
FIB_CLIENT_SECRET="client-secret"
FIB_ENVIRONMENT This value is the environment that you want to choose for FIB integration to your applicationFIB_CALLBACK_URL The callback url that FIB will send a POST request to when status of the created payment changesFIB_CLIENT_ID The account client id you use to authenticate the request determines whether the request is live mode or test modeFIB_CLIENT_SECRET The account client secret you use to authenticate the request determines whether the request is live mode or test modeuse Rawahamid\FibIntegration\Payments\FibPayment;
$response = FibPayment::create(100);
Response structure
{
"paymentId": "string",
"readableCode": "string",
"qrCode": "base64 string",
"validUntil": "datetime",
"personalAppLink": "link",
"businessAppLink": "link",
"corporateAppLink": "link"
}
paymentId A unique identifier of the payment, used later to check the status.readableCode A payment code that the user can enter manually in case he cannot scan the QR code.qrCode A base64-encoded data URL of the QR code image that the user can scan with the FIB mobile app.validUntil an ISO-8601-formatted date-time string, representing a moment in time when the payment expirespersonalAppLink A link that the user can tap on his mobile phone to go to the corresponding payment screen in the FIB Personal appbusinessAppLink A link that the user can tap on his mobile phone to go to the corresponding payment screen in the FIB Business appcorporateAppLink A link that the user can tap on his mobile phone to go to the corresponding payment screen in the FIB Corporate appuse Rawahamid\FibIntegration\Payments\FibPayment;
$response = FibPayment::status('payment-uuid');
Response structure will be:
{
"paymentId": "string",
"status": "string",
"validUntil": "string",
"amount": {
"amount": "number",
"currency": "string"
},
"decliningReason": "string",
"declinedAt": "string",
"paidBy": {
"name": "string",
"iban": "string"
}
}
paymentId A unique identifier of the payment, used later to check the status.status one of these values: PAID | UNPAID | DECLINEDvalidUntil an ISO-8601-formatted date-time string, representing a moment in time when the payment expiresamount contains payment amount and its currencydecliningReason can be nullable or one of these values SERVER_FAILURE | PAYMENT_EXPIRATION | PAYMENT_CANCELLATIONdeclinedAt datetime that represents the time of payment declinepaidBy is nullable object if the payment is still not paid but if paid will contain the name and iban of the useruse Rawahamid\FibIntegration\Payments\FibPayment;
$response = FibPayment::cancel('payment-uuid');
response will be empty if success
In every request of these if the response is 500 mean the creation, status or cancellation request something wrong happened
The FIB Integration package is open source software licensed under the License MIT
Contributions are always welcome!
If you face any problem feel free to contact me :) rawahamid