PHPackages                             maree/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. [API Development](/categories/api)
4. /
5. maree/tamara

ActiveLibrary[API Development](/categories/api)

maree/tamara
============

package to integrate tamara with your php laravel project

9945↓16.7%1PHP

Since Feb 27Pushed 3y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

tamara
======

[](#tamara)

Tamara is a pay-later service with zero interest and no additional fees. Shop for the items you're interested in from our partners and split the amount into 3 or 4 easy monthly payments, the first of which is upon purchase.

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

[](#installation)

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

```
composer require maree/tamara
```

Publish your tamara config file with

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

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

```
    "token"        => "" , //from your tamara account
    "mode"         => "test", //test or live
    'country_code' => "SA",
    'currency'     => "SAR",
```

Usage
-----

[](#usage)

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

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

```
use Maree\Tamara\Tamara;

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

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

[](#create-checkout-order)

```
use Maree\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' => 'mohamed','last_name' => 'maree' ,'phone' => '01234567890','email' => 'm7mdmaree26@gmail.com'];
        $billing_address  = ['first_name' => 'mohamed','last_name' => 'maree','line1' => 'mehalla' ,'city' => 'mehalla','phone' => '01234567890'];
        $shipping_address = ['first_name' => 'mohamed','last_name' => 'maree','line1' => 'mehalla' ,'city' => 'mehalla','phone' => '01234567890'];
        $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 Maree\Tamara\Tamara;

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

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

[](#cancel-order)

```
use Maree\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

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity23

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 (6 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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