PHPackages                             tappay/laravel-tap-payment - 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. tappay/laravel-tap-payment

ActiveLibrary[Payment Processing](/categories/payments)

tappay/laravel-tap-payment
==========================

A modern, fluent Laravel SDK for the Tap Payments v2 API.

v1.3.5(5mo ago)2876↑473.3%[1 PRs](https://github.com/rickeysxhemz/tappay-laravel-tap-payment/pulls)MITPHPPHP ^8.2CI passing

Since Nov 26Pushed 5d agoCompare

[ Source](https://github.com/rickeysxhemz/tappay-laravel-tap-payment)[ Packagist](https://packagist.org/packages/tappay/laravel-tap-payment)[ RSS](/packages/tappay-laravel-tap-payment/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (13)Versions (16)Used By (0)

Laravel Tap Payments
====================

[](#laravel-tap-payments)

A fluent Laravel integration for Tap Payments API

[![Build Status](https://github.com/rickeysxhemz/tappay-laravel-tap-payment/actions/workflows/tests.yml/badge.svg)](https://github.com/rickeysxhemz/tappay-laravel-tap-payment/actions)[![Total Downloads](https://camo.githubusercontent.com/f701234b01f70a163b8a642a26c61427a730025cd6476cdc7889dee4fdf86a28/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7461707061792f6c61726176656c2d7461702d7061796d656e74)](https://packagist.org/packages/tappay/laravel-tap-payment)[![Latest Stable Version](https://camo.githubusercontent.com/fd5400f0178ae2590d4f3b516007fbcd9474980d7d1476f8c0fa63ca2fb204c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7461707061792f6c61726176656c2d7461702d7061796d656e74)](https://packagist.org/packages/tappay/laravel-tap-payment)[![License](https://camo.githubusercontent.com/41af9bcea299495e0084f80257e6b02a9f33126e9d2756d3a2805b1af93b0fc0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7461707061792f6c61726176656c2d7461702d7061796d656e74)](https://packagist.org/packages/tappay/laravel-tap-payment)

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

[](#introduction)

Laravel Tap Payments provides an expressive, fluent interface to [Tap Payments](https://www.tap.company/) billing services. It handles almost all of the boilerplate payment processing code you are dreading writing. In addition to basic charge management, the package can handle saved cards, webhooks, refunds, authorizations, and more.

Official Documentation
----------------------

[](#official-documentation)

Documentation for the package can be found in the [docs](docs/) folder:

- [Installation](docs/1-installation.md)
- [Configuration](docs/2-configuration.md)
- [Charges](docs/3-charges.md)
- [Webhooks](docs/4-webhooks.md)
- [Saved Cards](docs/5-saved-cards.md)
- [Billable Trait](docs/6-billable.md)
- [Testing](docs/7-testing.md)
- [Marketplace](docs/8-marketplace.md)

Quick Start
-----------

[](#quick-start)

Install the package via Composer:

```
composer require tappay/laravel-tap-payment
```

Publish the configuration:

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

Add your credentials to `.env`:

```
TAP_PUBLISHABLE_KEY=pk_test_your_publishable_key
TAP_SECRET_KEY=sk_test_your_secret_key
TAP_CURRENCY=SAR
```

### Basic Usage

[](#basic-usage)

```
use TapPay\Tap\Facades\Tap;

// Create a charge
$charge = Tap::charges()->newBuilder()
    ->amount(100.00)              // Amount in currency units (100.00 SAR)
    ->currency('SAR')
    ->withCard()
    ->customer([
        'first_name' => 'John',
        'email' => 'john@example.com',
    ])
    ->redirectUrl('https://example.com/callback')
    ->create();

// Redirect to payment page
return redirect($charge->transactionUrl());
```

### Billable Model

[](#billable-model)

Add the `Billable` trait to your User model:

```
use TapPay\Tap\Concerns\Billable;
use TapPay\Tap\Contracts\Billable as BillableContract;

class User extends Authenticatable implements BillableContract
{
    use Billable;
}
```

Now charge users directly:

```
$user->charge(10000, 'SAR', [
    'source' => ['id' => 'src_card'],
    'redirect' => ['url' => route('payment.callback')],
]);
```

### Available Services

[](#available-services)

ServiceDescription`Tap::charges()`Create, retrieve, list, and bulk export charges`Tap::customers()`Full CRUD operations for customers`Tap::refunds()`Process, manage, and bulk export refunds`Tap::authorizations()`Authorization, capture, void, and bulk export`Tap::tokens()`Create and manage payment tokens`Tap::cards()`Manage saved cards for customers`Tap::invoices()`Create, finalize, remind, and cancel invoices`Tap::subscriptions()`Handle recurring subscriptions`Tap::merchants()`Marketplace sub-merchant management`Tap::destinations()`Payment split destinations`Tap::payouts()`Track merchant settlements### Supported Payment Methods

[](#supported-payment-methods)

RegionMethodsGlobalCard, All MethodsKuwaitKNET, KFASTSaudi ArabiaMada, STC PayBahrainBenefitOmanOmanNetQatarQPayEgyptFawryBNPLTabby, Deema### Marketplace &amp; Payment Splits

[](#marketplace--payment-splits)

Split payments across multiple merchants:

```
use TapPay\Tap\Facades\Tap;
use TapPay\Tap\ValueObjects\Destination;

// Create a charge with payment splits
$charge = Tap::charges()->newBuilder()
    ->amount(100.00)
    ->withCard()
    ->destinations([
        Destination::make('merchant_123', 70.00),  // 70% to vendor
        Destination::make('merchant_456', 30.00),  // 30% platform fee
    ])
    ->redirectUrl('https://example.com/callback')
    ->create();

// Manage sub-merchants
$merchant = Tap::merchants()->create([
    'name' => 'Vendor Store',
    'email' => 'vendor@example.com',
    'country_code' => 'SA',
]);

// Track payouts
$payouts = Tap::payouts()->listByMerchant('merchant_123');
```

### Authorizations (Two-Step Payments)

[](#authorizations-two-step-payments)

Hold funds without capturing immediately:

```
use TapPay\Tap\Facades\Tap;

// Create authorization with auto-capture after 24 hours
$auth = Tap::authorizations()->newBuilder()
    ->amount(5000)
    ->currency('SAR')
    ->source('src_card')
    ->autoCapture(24)                    // Auto-capture after 24 hours
    ->idempotent($order->id)             // Prevent duplicate authorizations
    ->redirectUrl('https://example.com/callback')
    ->create();

// Or auto-void if not captured
$auth = Tap::authorizations()->newBuilder()
    ->amount(5000)
    ->source('src_card')
    ->autoVoid(48)                       // Auto-void after 48 hours
    ->create();

// Manually void an authorization
Tap::authorizations()->void('auth_xxxxx');

// Bulk export authorizations
Tap::authorizations()->download(['status' => 'AUTHORIZED']);
```

### Invoices

[](#invoices)

Create and manage payment invoices:

```
use TapPay\Tap\Facades\Tap;

// Create an invoice
$invoice = Tap::invoices()->create([
    'amount' => 100.00,
    'currency' => 'SAR',
    'customer' => ['id' => 'cus_xxxxx'],
]);

// Finalize a draft invoice
Tap::invoices()->finalize('inv_xxxxx');

// Send payment reminder
Tap::invoices()->remind('inv_xxxxx');

// Cancel an invoice
Tap::invoices()->cancel('inv_xxxxx');
```

### Idempotency

[](#idempotency)

Prevent duplicate charges with idempotent keys:

```
$charge = Tap::charges()->newBuilder()
    ->amount(10000)
    ->withCard()
    ->idempotent($order->id)             // Same key = same response within 24h
    ->redirectUrl($callbackUrl)
    ->create();
```

Works with charges, authorizations, and refunds. See [Charges documentation](docs/3-charges.md#idempotency-preventing-double-charges) for details.

### Events

[](#events)

The package dispatches events you can listen to:

EventDescription`PaymentSucceeded`Dispatched when a payment is successful`PaymentFailed`Dispatched when a payment fails`PaymentRetrievalFailed`Dispatched when charge retrieval fails (API errors)`WebhookReceived`Dispatched when a valid webhook is received`WebhookValidationFailed`Dispatched when webhook validation fails`WebhookProcessingFailed`Dispatched when webhook processing throws an exceptionExample listener:

```
use TapPay\Tap\Events\PaymentSucceeded;
use TapPay\Tap\Events\PaymentFailed;

// In EventServiceProvider
protected $listen = [
    PaymentSucceeded::class => [
        SendPaymentConfirmation::class,
    ],
    PaymentFailed::class => [
        NotifyPaymentFailure::class,
    ],
];
```

### Webhooks

[](#webhooks)

Configure webhook handling in your `config/tap.php`:

```
'webhook' => [
    'secret' => env('TAP_WEBHOOK_SECRET'),
    'tolerance' => 300, // 5 minutes
    'allowed_resources' => ['charge', 'refund', 'customer'],
],
```

The package automatically:

- Validates webhook signatures using HMAC-SHA256
- Prevents replay attacks with timestamp tolerance
- Dispatches events for each webhook type

> **Note:** Tap signs webhook amounts with full decimal places (e.g., `100.00`), but sends them without trailing zeros (`100.0`). This package handles the conversion automatically.

### Security Features

[](#security-features)

- HMAC-SHA256 webhook signature validation
- Timing-safe signature comparison
- Open redirect protection on callbacks
- Input validation on all builder methods
- Sensitive parameter protection for API keys

Testing
-------

[](#testing)

```
# Run tests
composer test

# Run static analysis
composer analyse

# Run code style checks
composer lint
```

Contributing
------------

[](#contributing)

Thank you for considering contributing to Laravel Tap Payments! The contribution guide can be found in the [CONTRIBUTING.md](docs/CONTRIBUTING.md) file.

Code of Conduct
---------------

[](#code-of-conduct)

In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](docs/CODE_OF_CONDUCT.md).

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](docs/SECURITY.md) on how to report security vulnerabilities.

License
-------

[](#license)

Laravel Tap Payments is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance87

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.9% 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 ~6 days

Total

9

Last Release

171d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/37139614?v=4)[Muhammad Waqas Majeed](/maintainers/rickeysxhemz)[@rickeysxhemz](https://github.com/rickeysxhemz)

---

Top Contributors

[![rickeysxhemz](https://avatars.githubusercontent.com/u/37139614?v=4)](https://github.com/rickeysxhemz "rickeysxhemz (45 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")

---

Tags

knetlaravellaravel-paymentmadamiddle-eastonline-paymentspayment-gatewayphpphp-sdksaudi-arabiatap-paymentslaravelsdkbillingpaymentsgatewaycheckoutpayment gatewaymadatapknetmiddle-eaststcpaytap-paymentsgcc

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tappay-laravel-tap-payment/health.svg)

```
[![Health](https://phpackages.com/badges/tappay-laravel-tap-payment/health.svg)](https://phpackages.com/packages/tappay-laravel-tap-payment)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)

PHPackages © 2026

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