PHPackages                             mustafataj/tabby-php - 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. mustafataj/tabby-php

ActiveLibrary[Payment Processing](/categories/payments)

mustafataj/tabby-php
====================

PHP and Laravel SDK for Tabby Pay in 4 Custom API

v1.3.2(1mo ago)06↓50%MITPHPPHP ^8.1CI passing

Since Jun 12Pushed 1mo agoCompare

[ Source](https://github.com/TajSoft-Plugins/tabby-php)[ Packagist](https://packagist.org/packages/mustafataj/tabby-php)[ Docs](https://github.com/TajSoft-Plugins/tabby-php)[ RSS](/packages/mustafataj-tabby-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (7)Used By (0)

Tabby PHP SDK
=============

[](#tabby-php-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fcaae608ad9cb76662131f7d96d8b58d24abe6e3ffde53f4b5c25ab692d9e172/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d75737461666174616a2f74616262792d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mustafataj/tabby-php)[![Total Downloads](https://camo.githubusercontent.com/0b8d0fe655ee4dffdb5db192aeb34ac81ced16dca903cb87a2f73690324ac3e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d75737461666174616a2f74616262792d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mustafataj/tabby-php)[![License](https://camo.githubusercontent.com/b89b3a65019dd7c319bf651b0f95077d2ffb622a3b586ff93986030b219fad67/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d75737461666174616a2f74616262792d7068702e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Production-ready PHP SDK for [Tabby Pay in 4 Custom API](https://docs.tabby.ai/pay-in-4-custom-integration/quick-start). Works in plain PHP and Laravel 10+ out of the box.

Introduction
------------

[](#introduction)

This package provides a framework-agnostic core with first-class Laravel integration for:

- Creating checkout sessions
- Retrieving and updating payments
- Capturing and refunding payments
- Listing payments
- Managing webhooks

The SDK uses Guzzle by default and supports injecting a custom HTTP client through `HttpClientInterface`.

### API keys

[](#api-keys)

Tabby uses two credentials:

KeyUsed for**Public key** (`pk_test_...` / `pk_...`)Checkout session creation**Secret key** (`sk_test_...` / `sk_...`)Payments and webhooksThe SDK selects the correct key automatically per endpoint. Use sandbox keys while testing and live keys in production.

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

[](#installation)

```
composer require mustafataj/tabby-php
```

Laravel Setup
-------------

[](#laravel-setup)

The package auto-registers via Laravel package discovery:

- Service provider: `MustafaTaj\Tabby\Laravel\TabbyServiceProvider`
- Facade alias: `Tabby`

No manual registration is required for Laravel 10, 11, or 12.

Publishing Config
-----------------

[](#publishing-config)

```
php artisan vendor:publish --tag=tabby-config
```

This publishes `config/tabby.php` to your application.

Environment Variables
---------------------

[](#environment-variables)

Add the following to your `.env`:

```
IS_TABBY_SANDBOX=true

TABBY_LIVE_SECRET_KEY=sk_xxx
TABBY_LIVE_PUBLIC_KEY=pk_xxx
TABBY_SANDBOX_SECRET_KEY=sk_test_xxx
TABBY_SANDBOX_PUBLIC_KEY=pk_test_xxx

TABBY_MERCHANT_CODE=your_merchant_code
TABBY_REGION=ksa
TABBY_BASE_URL=
TABBY_TIMEOUT=30
TABBY_CONNECT_TIMEOUT=10
TABBY_HTTP_DEBUG=false
```

When `IS_TABBY_SANDBOX=true`, the SDK uses `TABBY_SANDBOX_*` keys. When `false`, it uses `TABBY_LIVE_*` keys.

Optional legacy overrides (used only if the active environment keys are empty):

```
TABBY_SECRET_KEY=
TABBY_PUBLIC_KEY=
```

Plain PHP Setup
---------------

[](#plain-php-setup)

```
