PHPackages                             maree/myfatoorah - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. maree/myfatoorah

ActiveLibrary

maree/myfatoorah
================

package to pay with myfatoorah payment services

1161PHP

Since Mar 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mohamedmaree/myfatoorah)[ Packagist](https://packagist.org/packages/maree/myfatoorah)[ RSS](/packages/maree-myfatoorah/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

myfatoorah
==========

[](#myfatoorah)

Installation
------------

[](#installation)

You can install the package via [Composer](https://getcomposer.org).

```
composer require maree/myfatoorah
```

Publish your myfatoorah config file with

```
php artisan vendor:publish --provider="maree\myfatoorah\MyfatoorahServiceProvider" --tag="myfatoorah"
```

then change your myfatoorah config from config/myfatoorah.php file

```
    "token"  => "" ,//To generate one follow instruction here https://myfatoorah.readme.io/docs/live-token.
    "mode"   => "test", //test|live
```

Usage
-----

[](#usage)

creat routes for checkout,callback and error pages

```
Route::get('checkout', [\App\Http\Controllers\MyFatoorahController::class, 'checkout']);
Route::get('payment/callback', [\App\Http\Controllers\MyFatoorahController::class, 'callback']);
Route::get('payment/error', [\App\Http\Controllers\MyFatoorahController::class, 'error']);
```

At the controller
-----------------

[](#at-the-controller)

```
use maree\myfatoorah\MyfatoorahPay;
    public function checkout(){
        $pay      = new MyfatoorahPay();
        $postFields = [
            'NotificationOption' => 'Lnk',     //'SMS', 'EML', or 'ALL'
            'InvoiceValue'       => 1,   //the price the customer will pay
            'CustomerName'       => 'maree',
            'DisplayCurrencyIso' => 'SAR',
            'MobileCountryCode'  => '+966',
            'CustomerMobile'     => '123456789',
            'CallBackUrl'        => route('callback'),    //the route that will be redirected to in the success
            'ErrorUrl'           => route('error'), //the route that will be redirected to in the fail
            'Language'           => 'ar',
            'CustomerReference'  => auth()->id(),//user id    // the refrence to the customer and wil be returned in the respone of the success
            'UserDefinedField'   => 'user',//user,product,...  //(optional) extra key and wil be returned in the respone of the succes
        ];
        $data = $pay->getInvoiceURL($postFields);
        return redirect($data['invoiceURL']);
    }
```

Get callback to check payment status
------------------------------------

[](#get-callback-to-check-payment-status)

```
use maree\myfatoorah\MyfatoorahPay;

    public function callback(){
        $pay          = new MyfatoorahPay();
        $responseData = $pay->getPaymentStatus(request('paymentId'), 'PaymentId');
        $responseDataArr = json_decode(json_encode($responseData), true);
        if ($responseDataArr['focusTransaction']['TransactionStatus'] == 'Succss') { //check if the transaction is the success
            $user_id = $responseDataArr['CustomerReference'];    //get the cutomer refrence
            if ($responseDataArr['UserDefinedField'] == 'user') { //get the extra key
                // code
            } elseif ($responseDataArr['UserDefinedField'] == 'product') {
                //code
            }
            return response()->json(['status' => 'success','msg' => 'payment success']);
        }else{
            return response()->json(['status' => 'fail','msg' => 'payment fail']);
        }
    }
```

Error page
----------

[](#error-page)

```
use maree\myfatoorah\MyfatoorahPay;

    public function error(Request $request) {
   	    return response()->json(['status' => 'fail','msg' => 'payment fail']);
    }
```

You can get test cards from

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e88e6da55b1e4b359544c3e94fab80c6f73b3ce7ac82afd1d872a41aeb349fa?d=identicon)[mohamedmaree](/maintainers/mohamedmaree)

---

Top Contributors

[![mohamedmaree](https://avatars.githubusercontent.com/u/12659069?v=4)](https://github.com/mohamedmaree "mohamedmaree (8 commits)")

### Embed Badge

![Health badge](/badges/maree-myfatoorah/health.svg)

```
[![Health](https://phpackages.com/badges/maree-myfatoorah/health.svg)](https://phpackages.com/packages/maree-myfatoorah)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
