PHPackages                             azima/tamara - 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. [Payment Processing](/categories/payments)
4. /
5. azima/tamara

ActiveLibrary[Payment Processing](/categories/payments)

azima/tamara
============

The package acts as a Laravel integration for the Tamara API, allowing developers to easily create sessions, handle payments, and manage webhooks in their applications.

1.0.0(5mo ago)05MITPHP

Since Dec 12Pushed 5mo agoCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

tamara
------

[](#tamara)

 [![Image 2](assets/images/image.png)](assets/images/image.png)

`tamara` is a Laravel package designed to simplify the integration of the tamara API into your Laravel applications. It provides an easy-to-use interface for creating checkout sessions, handling payments, managing webhooks, and more.

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

[](#installation)

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

```
composer require azima/tamara
```

Publish your tamara config file with

```
php artisan vendor:publish --provider="Azima\Tamara\TamaraServiceProvider" --tag="tamara"
```

In your `.env` file, add the following configurations:

```
    TAMARA_TOKEN=
    TAMARA_MODE=
    TAMARA_COUNTRY_CODE=
    TAMARA_CURRENCY=
```

Usage
-----

[](#usage)

Check payment available options
-------------------------------

[](#check-payment-available-options)

```
use Azima\Tamara\Tamara;

        $order = ['phone' => '00966511111', 'total' => 600];
        $response = (new Tamara())->checkPaymentOptionsAvailability($order);
```

Create checkout order
---------------------

[](#create-checkout-order)

```
use Azima\Tamara\Tamara;

        $order       = ['order_num' => '123', 'total' => 500,'notes' => 'notes ', 'discount_name' => 'discount coupon','discount_amount' => 50,'vat_amount' => 50,'shipping_amount' => 20];
        $products[0] = ['id' => '123','type' => 'mobiles' ,'name' => 'iphone','sku' => 'SA-12436','image_url' => 'https://example.com/image.png','quantity' => 1,'unit_price'=>50,'discount_amount' => 5,'tax_amount'=>10,'total' => 70];
        $products[1] = ['id' => '345','type' => 'labtops' ,'name' => 'macbook air','sku' => 'SA-789','image_url' => 'https://example.com/image.png','quantity' => 1,'unit_price'=>200,'discount_amount' => 50,'tax_amount'=>100,'total' => 300];
        $consumer    = ['first_name' => 'mahmoud','last_name' => 'abd alziem' ,'phone' => '00966511111','email' => 'mbdalzym376@gmail.com'];
        $billing_address  = ['first_name' => 'mahmoud','last_name' => 'abd alziem','line1' => 'mohamed alziem' ,'city' => 'mohamed alziem','phone' => '00966511111'];
        $shipping_address = ['first_name' => 'mahmoud','last_name' => 'abd alziem','line1' => 'mohamed alziem' ,'city' => 'mohamed alziem','phone' => '00966511111'];
        $urls = ['success' => 'http://yoursite/success','failure' => 'http://yoursite/failure','cancel' => 'http://yoursite/cancel','notification' => 'http://yoursite/notification'];
        $response = (new Tamara())->createCheckoutSession($order,$products,$consumer,$billing_address,$shipping_address,$urls);
        return redirect()->to($response['checkout_url']);
```

- urls array contain the callback urls for each status \['success' ,'failure','cancel','notification'\] so that create route for each status
- if you passed route('tamara.result') in urls array success key then reponse will return in 'PaymentController@tamaraResult' function
- in routes.php put

```
    Route::get('tamara-response', 'PaymentController@tamaraResult')->name('tamara.result');
```

- in controllers/PaymentController create callback function to check response

```
    public function tamaraResult(Request $request)
    {
        if ($request->paymentStatus == 'approved') {
        	//update order payment status
            return view('success_payment');
        } else {
            return view('fail_payment');
        }
    }
```

Get order details
-----------------

[](#get-order-details)

```
use Azima\Tamara\Tamara;

        //use id that you used in createCheckoutSession function $order['order_num']
        $response = (new Tamara())->getOrderDetails($orderId = '123');
```

Cancel order
------------

[](#cancel-order)

```
use Azima\Tamara\Tamara;

        //get id from createCheckoutSession function response
        $order = ['id' => '9d7546e6-59e5-46ab-884c-9dbf95e2877c' ,'amount' => 100];
        $response = (new Tamara())->cancelOrder($order);
```

documentaion
------------

[](#documentaion)

-

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance72

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

158d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e41d36182bd95fcb9228bd8676e83e30a941c1dc54ce9322d88806dd66c43a7?d=identicon)[azima](/maintainers/azima)

---

Top Contributors

[![Mahmoudalziem](https://avatars.githubusercontent.com/u/34794206?v=4)](https://github.com/Mahmoudalziem "Mahmoudalziem (2 commits)")

### Embed Badge

![Health badge](/badges/azima-tamara/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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