myfatoorah / laravel-package
The official MyFatoorah Payment Gateway for Laravel.
Requires
- myfatoorah/library: ~2.2.6
README
Description
This package is the official MyFatoorah Payment Gateway Laravel package. It uses myfatoorah/library composer package.
Main Features
- Example of creating MyFatoorah invoices.
- Example of displaying the MyFatoorah payment status.
- Example of displaying the enabled gateways at your MyFatoorah account to be displayed on the checkout page.
- Example of how to use webhook.
Important Note!
The MyFatoorah Laravel package provides examples of how to use the MyFatoorah Library and the MyFatoorah API endpoints. However, you must implement validations or security measures to ensure a seamless payment experience. For more information, contact MyFatoorah Technical Team.
Installation steps
Install the Package
Install the package via myfatoorah/laravel-package composer. Open a command console, enter your project directory, and execute the following command to download the latest stable version:
composer require myfatoorah/laravel-package
Publish the MyFatoorah provider
Open the console, and enter the following command:
php artisan vendor:publish --provider="MyFatoorah\LaravelPackage\MyFatoorahServiceProvider" --tag="myfatoorah"
Add Configuration Data
Edit the config/myfatoorah.php file with your correct vendor data.
Demo configuration
- Use the test API token key mentioned here.
- Set the test mode to true.
- Use one of the test cards.
Live Configuration
- Use the live API token key mentioned here.
- Set the test mode to false.
- Set the country ISO code as mentioned in this link.
Clear Cache
Open the console, and enter the following command:
php artisan optimize:clear
Test the Payment Cycle
To test the payment cycle, type the URL below onto your browser. Replace only the {example.com} with your site domain:
https://{example.com}/myfatoorah
List the Payment Gateways
To test the display of available gateways on the checkout page, please enter the following URL into your browser. Replace only the {example.com} with your site domain:
https://{example.com}/myfatoorah/checkout?oid=22&customerId=32
Code Customization
Understand the MyFatooah library functions in the app/Http/Controllers/MyFatoorahController.php file. Then, use them in your project per your store needs. For security reasons, remove any unused MyFatoorah routes as a final step.