PHPackages                             aiarmada/cashier - 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. aiarmada/cashier

ActiveLibrary[Payment Processing](/categories/payments)

aiarmada/cashier
================

Unified multi-gateway billing integration for Laravel supporting Stripe and CHIP

v1.0.0(1mo ago)001MITPHP

Since Mar 20Pushed 1mo agoCompare

[ Source](https://github.com/AIArmada/cashier)[ Packagist](https://packagist.org/packages/aiarmada/cashier)[ Docs](https://github.com/aiarmada/commerce)[ RSS](/packages/aiarmada-cashier/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (1)

AIArmada Cashier
================

[](#aiarmada-cashier)

A unified multi-gateway billing integration for Laravel supporting Stripe and CHIP.

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

[](#introduction)

AIArmada Cashier provides a unified interface for working with multiple payment gateways in Laravel. Instead of learning different APIs for Stripe and CHIP, you can use a single, consistent API that works across all supported gateways.

### Key Features

[](#key-features)

- **Unified API**: One interface for multiple gateways
- **Multi-Gateway Support**: Users can have subscriptions on different gateways simultaneously
- **Gateway Manager**: Factory pattern for resolving gateways dynamically
- **Contract-First Design**: All components implement well-defined interfaces
- **No Data Duplication**: Subscriptions stored in respective gateway tables

### Architecture

[](#architecture)

This package is a **wrapper/adapter layer** that delegates to underlying gateway packages:

- `laravel/cashier` → Stripe subscriptions stored in `subscriptions` table
- `aiarmada/cashier-chip` → CHIP subscriptions stored in `chip_subscriptions` table

**No additional tables are created.** This package provides a unified interface only.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 12.0+
- At least one gateway package installed:
    - `laravel/cashier` for Stripe
    - `aiarmada/cashier-chip` for CHIP

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

[](#installation)

```
composer require aiarmada/cashier
```

Install gateway packages as needed:

```
# For Stripe
composer require laravel/cashier

# For CHIP
composer require aiarmada/cashier-chip
```

Publish the configuration:

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

Configuration
-------------

[](#configuration)

### Environment Variables

[](#environment-variables)

```
# Default gateway
CASHIER_GATEWAY=stripe

# Stripe Configuration (if using laravel/cashier)
STRIPE_KEY=pk_live_xxx
STRIPE_SECRET=sk_live_xxx
STRIPE_WEBHOOK_SECRET=whsec_xxx

# CHIP Configuration (if using cashier-chip)
CHIP_BRAND_ID=your_brand_id
CHIP_API_KEY=your_api_key
CHIP_WEBHOOK_KEY=your_webhook_key

# Currency Settings
CASHIER_CURRENCY=USD
CASHIER_CURRENCY_LOCALE=en_US
```

Usage
-----

[](#usage)

### Setting Up the Billable Model

[](#setting-up-the-billable-model)

Add **all** billable traits to your User model:

```
use AIArmada\Cashier\Billable as CashierBillable;
use Laravel\Cashier\Billable as StripeBillable;
use AIArmada\CashierChip\Billable as ChipBillable;

class User extends Authenticatable
{
    use StripeBillable, ChipBillable, CashierBillable;
}
```

### Gateway Selection

[](#gateway-selection)

```
use AIArmada\Cashier\Cashier;

// Get the default gateway
$gateway = Cashier::gateway();

// Get a specific gateway
$stripeGateway = Cashier::gateway('stripe');
$chipGateway = Cashier::gateway('chip');

// From a billable model
$user->gateway();        // Default gateway
$user->gateway('chip');  // Specific gateway
```

### Creating Subscriptions

[](#creating-subscriptions)

```
// Via default gateway
$user->newGatewaySubscription('default', 'price_xxx')->create();

// Via specific gateway
$user->newGatewaySubscription('default', 'price_xxx', 'chip')->create();

// Or use the gateway directly
$user->gateway('stripe')->subscription($user, 'default', 'price_xxx')->create();
```

### Querying Subscriptions

[](#querying-subscriptions)

```
// Get all subscriptions across all gateways
$allSubscriptions = $user->allSubscriptions();

// Find a subscription by type from any gateway
$subscription = $user->findSubscription('default');

// Get subscriptions for a specific gateway
$stripeSubscriptions = $user->gatewaySubscriptions('stripe');
$chipSubscriptions = $user->gatewaySubscriptions('chip');

// Check if subscribed on any gateway
if ($user->subscribedOnAny('premium')) {
    // Has premium subscription on Stripe OR CHIP
}

// Check if subscribed on specific gateway
if ($user->subscribedViaGateway('premium', null, 'stripe')) {
    // Has premium subscription on Stripe
}
```

### One-Time Charges

[](#one-time-charges)

```
// Charge via default gateway
$payment = $user->chargeWithGateway(1000, 'pm_xxx');

// Charge via specific gateway
$payment = $user->chargeWithGateway(5000, 'pm_xxx', 'chip');
```

### Payment Methods

[](#payment-methods)

```
// Get payment methods from all gateways
$allMethods = $user->allGatewayPaymentMethods();

// Get payment methods from specific gateway
$stripeMethods = $user->gatewayPaymentMethods('stripe');

// Get default payment method for a gateway
$default = $user->defaultGatewayPaymentMethod('chip');
```

### Invoices

[](#invoices)

```
// Get invoices from all gateways
$allInvoices = $user->allGatewayInvoices();

// Get invoices from specific gateway
$stripeInvoices = $user->gatewayInvoices('stripe');
```

Extending with Custom Gateways
------------------------------

[](#extending-with-custom-gateways)

```
use AIArmada\Cashier\Gateways\AbstractGateway;

class PayPalGateway extends AbstractGateway
{
    public function name(): string
    {
        return 'paypal';
    }

    // Implement required methods...
}

// Register in a service provider
Cashier::manager()->extend('paypal', function ($app) {
    return new PayPalGateway(config('cashier.gateways.paypal'));
});
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance96

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

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

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/726da4efcb731bc0ebcdd0b7ce64759e1f8dd63f6f771eab335458f6a2f2d3af?d=identicon)[sairiz](/maintainers/sairiz)

---

Tags

laravelstripebillingpaymentssubscriptionscashiermulti-gatewaychip

### Embed Badge

![Health badge](/badges/aiarmada-cashier/health.svg)

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

###  Alternatives

[mmanos/laravel-billing

A billing package for Laravel 4.

451.3k](/packages/mmanos-laravel-billing)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[threesquared/laravel-paymill

Laravel wrapper for the Paymill API

121.3k](/packages/threesquared-laravel-paymill)

PHPackages © 2026

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