myfatoorah / library
MyFatoorah PHP Library
2.2.11
2026-11-23 12:39 UTC
Requires
- php: >=7
- ext-curl: *
- ext-json: *
Requires (Dev)
- phan/phan: ^6.0
- phpcompatibility/php-compatibility: ^10.0@alpha
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^13.0
- squizlabs/php_codesniffer: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
MyFatoorah - Library
MyFatoorah Payment Gateway PHP library. It is a PHP library to integrate MyFatoorah APIs with your website.
Install
Via Composer
composer require myfatoorah/library
Usage
Payment Operations
$config = [
apiKey => '',
countryCode => 'KWT',
isTest => false,
];
$mfObj = new MyFatoorahPayment($config);
$postFields = [
'NotificationOption' => 'Lnk',
'InvoiceValue' => '50',
'CustomerName' => 'fname lname',
];
$data = $mfObj->getInvoiceURL($postFields);
$invoiceId = $data->InvoiceId;
$paymentLink = $data->InvoiceURL;
echo "Click on <a href='$paymentLink' target='_blank'>$paymentLink</a> to pay with invoiceID $invoiceId.";
Shipping Operations
$config = [
apiKey => '',
countryCode => 'KWT',
isTest => false,
];
$mfObj = new MyFatoorahShipping($config);
$data = $mfObj->getShippingCountries();
echo 'Country code: ' . $data[0]->CountryCode;
echo 'Country name: ' . $data[0]->CountryName;
General Operations
$phone = MyFatoorah::getPhone('+2 01234567890');
echo 'Phone code: ' . $phone[0];
echo 'Phone number: ' . $phone[1];
Testing
phpunit
Credits
License
The MIT License. Take the library, change it, ship it
inside your own product - just keep the MyFatoorah copyright notice, and it stays clear that
this is the official MyFatoorah PHP library and who wrote it. The notice is at the top of
autoload.php and on the main MyFatoorah class; keeping either one is enough.

