Download the PHP package first-iraqi-bank/fib-laravel-payment-sdk without Composer
On this page you can find all versions of the php package first-iraqi-bank/fib-laravel-payment-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download first-iraqi-bank/fib-laravel-payment-sdk
More information about first-iraqi-bank/fib-laravel-payment-sdk
Files in first-iraqi-bank/fib-laravel-payment-sdk
Package fib-laravel-payment-sdk
Short Description Laravel SDK for integrating with the FIB payment system, enabling user authentication and payment transactions.
License MIT
Informations about the package fib-laravel-payment-sdk
FIB Laravel Payment SDK
The FIB Laravel Payment SDK provides a seamless integration with the FIB payment system for Laravel applications, enabling secure and efficient payment transactions and refund handling.
Table of Contents
- Features
- Installation
- Composer Installation
- Alternative Installation (Without Composer)
- Registering the Service Provider and Running Migrations
- Usage
- Creating a Payment
- Checking Payment Status
- Refunding a Payment
- Cancelling a Payment
- Handling Payment Callbacks
- FIB Payment Documentation
- Testing
- Contributing
- License
- Support
- Acknowledgments
- Versioning
- FAQ
Features
- Payment Transactions: Facilitate secure payments through the FIB payment system directly in your Laravel application.
- Refund Processing: Manage refunds through the FIB payment system with ease.
- Payment Status Checking: Retrieve the status of payments to ensure proper transaction tracking.
- Payment Cancellation: Cancel payments as needed through the FIB payment system.
Installation
To integrate the SDK into your Laravel project, install it via Composer:
Alternative Installation (Without Composer)
If you prefer not to use Composer, follow these steps:
-
Clone the Repository: Clone the FIB Payment SDK repository:
-
Include in Your Project: Move or copy the cloned
fib-laravel-payment-sdk
directory into your Laravel project. -
Autoloading: Ensure that the
src
directory of the SDK is included in yourcomposer.json
autoloader configuration if not using Composer: - Usage: After including the SDK, use its classes and functionality in your Laravel application.
Registering the Service Provider and Running Migrations
Step 1: Register the Service Provider
Before using the SDK, ensure that you register the FIBPaymentServiceProvider
. This service provider binds the SDK's services into the Laravel service container and loads necessary resources like routes, migrations, and configurations.
For Laravel 10 and Lower:
In your config/app.php file, add the following to the providers array:
For Laravel 11 and Higher:
In Laravel 11, service providers are registered in the bootstrap/providers.php file. To register the FIBPaymentServiceProvider, add it to the returned array in the bootstrap/providers.php file like this:
Step 2: Publish the Configuration
To customize the SDK's configuration, you need to publish the configuration file. Run the following Artisan command:
This will publish the SDK configuration file to your application's config/fib.php
file, where you can modify the SDK's behavior according to your needs.
Step 3: Running Migrations
The SDK comes with migration files that create the necessary database tables. To run these migrations, use the following Artisan command:
This command will execute the migration files located in the SDK's database/migrations
directory and create the required database tables.
Add the following environment variables to your .env
file:
FIB_API_KEY
: Your FIB payment API key.FIB_API_SECRET
: Your FIB payment API secret.FIB_BASE_URL
: The base URL for the FIB payment API (default: https://api.fibpayment.com).FIB_GRANT_TYPE
: The grant type for authentication (default: client_credentials).FIB_REFUNDABLE_FOR
: The period for which transactions can be refunded (default: P7D).FIB_CURRENCY
: The currency used for transactions (default: IQD).FIB_CALLBACK_URL
: The callback URL for payment notifications.FIB_ACCOUNT
: The FIB payment account identifier.
Usage of the SDK
Ensure Dependencies are Installed:
Install required dependencies using Composer:
Set Up Environment Variables:
Create a .env
file in the root directory of your Laravel project and set the necessary environment variables.
Creating a Payment
Here's an example of how to create a payment:
Checking the Payment Status
To check the status of a payment:
Refunding a Payment
To process a refund:
Cancelling a Payment
To cancel a payment:
Handling Payment Callbacks
To handle payment callbacks, create a route and controller method:
FIB Payment Documentation
For detailed documentation on FIB Online Payment, refer to the full documentation.
Testing
Run tests using PHPUnit:
Contributing
Contributions are welcome! Please read CONTRIBUTING.md
for details on our code of conduct and the process for submitting pull requests.
License
This project is licensed under the MIT License. See the LICENSE.md file for details.
Support
For support, please contact [email protected] or visit our website.
Acknowledgments
Thanks to the FIB Payment development team for their contributions. This SDK uses the cURL library for API requests.
Versioning
We use semantic versioning (SemVer) principles. For available versions, see the tags on this repository.
FAQ
Q: How do I get an API key for the FIB Payment system?
A: Contact our support team at [email protected] to request an API key.
Q: Can I use this SDK in a production environment?
A: Yes, the SDK is designed for production, but ensure it is configured correctly and you have the necessary credentials.
All versions of fib-laravel-payment-sdk with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.0
illuminate/contracts Version ^8.0 || ^9.0 || ^10.0 || ^11.0
illuminate/http Version ^8.0 || ^9.0 || ^10.0 || ^11.0
illuminate/support Version ^8.0 || ^9.0 || ^10.0 || ^11.0