myfatoorah / symfony-bundle
The official MyFatoorah Payment Gateway for Symfony.
Installs: 2 781
Dependents: 0
Suggesters: 0
Security: 0
Type:symfony-bundle
pkg:composer/myfatoorah/symfony-bundle
Requires
- myfatoorah/library: ~2.2.6
- symfony/framework-bundle: ^5.0 || ^6.0 || ^7.0
This package is not auto-updated.
Last update: 2026-02-19 12:55:10 UTC
README
Description
This bundle is the official MyFatoorah Payment Gateway Symfony bundle. 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 Symfony Bundle 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 Bundle
Install the bundle via myfatoorah/symfony-bundle composer. Open a command console, enter your project directory, and execute the following command to download the latest stable version:
composer require myfatoorah/symfony-bundle
Import Routing Files
Add the route below in the config/routes.yaml file of your project:
myfatoorah_symfony:
resource: '@MyFatoorahSymfonyBundle/config/routing.yaml'
Non Symfony Flex Applications
Only for applications that don't use Symfony flex, you will need to enable the bundle manually by adding it to the list of registered bundles in the config/bundles.php file of your project:
return [
...
MyFatoorah\SymfonyBundle\MyFatoorahSymfonyBundle::class => ['all' => true]
];
Publish Assets
Open the console, and enter the following command to publish the assets files:
php bin/console assets:install --symlink
Add Configuration Data
Edit the vendor/myfatoorah/symfony-bundle/config/services.yaml 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 bin/console cache: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 vendor/myfatoorah/symfony-bundle/src/Controller/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.