PHPackages                             tygapay/tygabank - 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. tygapay/tygabank

ActiveLibrary[Payment Processing](/categories/payments)

tygapay/tygabank
================

TygaBank (TygaPay) PHP SDK with Laravel 12 integration

v1.0.2(5mo ago)0174MITPHPPHP ^8.3

Since Nov 27Pushed 5mo agoCompare

[ Source](https://github.com/quato/tygabank)[ Packagist](https://packagist.org/packages/tygapay/tygabank)[ RSS](/packages/tygapay-tygabank/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

TygaBank PHP SDK (Laravel 12 Ready)
===================================

[](#tygabank-php-sdk-laravel-12-ready)

Framework-agnostic PHP SDK and Laravel integration for TygaBank (TygaPay) APIs.

- Package: `tygapay/tygabank`
- Namespace: `TygaPay\TygaBank`
- PHP: ^8.3

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

[](#installation)

```
composer require tygapay/tygabank
```

Configuration (Laravel)
-----------------------

[](#configuration-laravel)

Publish config:

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

Set environment variables in `.env`:

```
TYGABANK_API_KEY=your_key
TYGABANK_API_SECRET=your_secret
TYGABANK_APP_URL=https://app.tygabank.com

# Optional: Override base URLs
TYGABANK_BASE_URL_AUTH=https://api-auth-it7ww2bo7q-uc.a.run.app
TYGABANK_BASE_URL_USERS=https://api-users-it7ww2bo7q-uc.a.run.app
TYGABANK_BASE_URL_ORDERS=https://api-orders-it7ww2bo7q-uc.a.run.app
TYGABANK_BASE_URL_TRANSACTIONS=https://api-transactions-it7ww2bo7q-uc.a.run.app
```

Usage
-----

[](#usage)

### Create Payment Order

[](#create-payment-order)

```
use TygaPay\TygaBank\Core\DTO\Orders\OrderCreateRequest;

$order_request = new OrderCreateRequest(
    type: 'payment',
    order_number: '123',
    amount: 9.99,
    webhook_url: 'https://example.com/ipn',
    return_url: 'https://example.com/ok',
    customer_email: 'user@example.com',
);

$result = tygabank()->orders()->create($order_request);
```

### Create User

[](#create-user)

```
use TygaPay\TygaBank\Core\DTO\Users\UserCreateRequest;

$user_request = new UserCreateRequest(
    email: 'user@example.com',
    created_by: 'system',
    external_user_id: '123',
    first_name: 'John',
    last_name: 'Doe',
    phone_number: '+1234567890',
    date_of_birth: '1990-01-01',
    customer_address: ['country' => 'US']
);

$result = tygabank()->users()->create($user_request);
```

### Get User Balances

[](#get-user-balances)

```
$balances = tygabank()->users()->balances('userId');
```

### Create Payout

[](#create-payout)

```
use TygaPay\TygaBank\Core\DTO\Transactions\PayoutRequest;

$payout_request = new PayoutRequest(
    user_id: 'tygabank-user-id',
    amount: 50.00,
    external_transaction_id: 'ext_123',
    created_by: 'system',
    email: 'user@example.com',
    currency: 'USD',
    webhook_url: 'https://example.com/webhook'
);

$result = tygabank()->transactions()->createPayout($payout_request);
```

### Generate SSO Token

[](#generate-sso-token)

```
$sso = tygabank()->auth()->clientToken(
    timestamp_ms: null,
    user_id: 'tygabank-user-id',
    external_user_id: '123'
);

// Redirect to: $sso['loginUrl']
```

Available Endpoints
-------------------

[](#available-endpoints)

```
// Auth
$token = tygabank()->auth()->clientToken();

// Users
$user = tygabank()->users()->getByEmail('user@example.com');
$user = tygabank()->users()->getById('userId');
$balances = tygabank()->users()->balances('userId');

// Transactions
$payout = tygabank()->transactions()->createPayout($request);
$status = tygabank()->transactions()->payoutStatus('payoutId', time() * 1000);
$transactions = tygabank()->transactions()->listByUser('userId');

// Orders
$order = tygabank()->orders()->create($request);

// Reporting
$tenant = tygabank()->reporting()->tenantTransactions(
    '2025-03-01',
    '2025-04-01',
    'commission_payout',
    time() * 1000
);
```

Webhooks
--------

[](#webhooks)

The SDK includes webhook signature verification:

```
use TygaPay\TygaBank\Core\Webhooks\WebhookVerifier;

$verifier = app(WebhookVerifier::class);
$is_valid = $verifier->verify(
    $signature,
    $api_path,
    $payload
);
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance72

Regular maintenance activity

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

Every ~2 days

Total

3

Last Release

159d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9926606d93d320876ec1498c55e076f8e4a02901714e633c5f55f390216c218?d=identicon)[Quato](/maintainers/Quato)

---

Top Contributors

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

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tygapay-tygabank/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M650](/packages/sylius-sylius)[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M9](/packages/aporat-store-receipt-validator)[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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