LaravelPackages.net
Acme Inc.
Toggle sidebar
asciisd/cashier-tap

Asciisd Cashier provides an expressive, fluent interface to Tap's subscription billing services.

181
1
v4.0.0
About asciisd/cashier-tap

asciisd/cashier-tap is a Laravel package for asciisd cashier provides an expressive, fluent interface to tap's subscription billing services.. It currently has 1 GitHub stars and 181 downloads on Packagist (latest version v4.0.0). Install it with composer require asciisd/cashier-tap. Discover more Laravel packages by asciisd or browse all Laravel packages to compare alternatives.

Last updated

Latest Version on Packagist Software License Total Downloads Total Downloads

Introduction

Laravel Cashier-tap provides an expressive, fluent interface to Tap's company subscription billing services. It handles almost all of the boilerplate subscription billing code you are dreading writing. In addition to basic subscription management, Cashier can handle coupons, swapping subscription, subscription "quantities", cancellation grace periods, and even generate invoice PDFs.

Requirements

  • PHP 8.3+
  • Laravel 11.x, 12.x, or 13.x
  • ext-intl

Installation

1- Run composer required command:

You can install the bindings via Composer. Run the following command:

composer require asciisd/cashier-tap

2- Run install command:

this command will install ServiceProvider, Configs and views

php artisan cashier:install

3- Run publish command:

this command will knet assets

php artisan cashier:publish

4- Run migration command:

table by run the migrations:

php artisan migrate

5- Add .env parameters

TAP_API_KEY=
TAP_WEBHOOK_SECRET= //use this key if you want tap to post the result back to your application

Using this package

not yet finished, you can use this package as following example:-

add Billable trait to the User model

namespace App;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Asciisd\Cashier\Billable;

class User extends Authenticatable {
   use Billable;
}

use pay() method

try{
    //allowed payment methods is ['src_kw.knet', 'src_all', 'src_card']
    $payment_method = 'src_card';
    $payment = $user->charge(10, $payment_method);

    $payment->actionUrl(); // this will return payment link
} catch(\Asciisd\Cashier\Exceptions\PaymentActionRequired $exception) {
    $payment = $exception->payment;
}

return $payment->actionUrl();

After finished the payment you will redirect to /tap/receipt you can change that from config file to make your own handler.

Both tap/receipt and tap/webhook must be excluded from CSRF protection. In Laravel 11 and above this is done in bootstrap/app.php:

->withMiddleware(function (Middleware $middleware) {
    $middleware->validateCsrfTokens(except: [
        'tap/receipt',
        'tap/webhook',
    ]);
})

AI guidelines

This package ships Laravel Boost AI guidelines plus two agent skills:

| Skill | Use for | | --- | --- | | cashier-tap-development | Using this package: billable models, charges, refunds, invoices, receipts, webhooks | | tap-payments-api | The underlying Tap REST API: endpoints, request/response fields, statuses, response codes, webhook hashstring verification, sandbox test data |

If your application uses Boost, run php artisan boost:install (or php artisan boost:update --discover) and they will be picked up automatically.

When working on this repository, the same skills are exposed to Copilot, Claude Code, and Cursor through .github/skills/, .claude/skills/, and .cursor/skills/, which symlink to resources/boost/skills/. Edit the files under resources/boost/skills/ only.

Test cards

| Card Number | Expiry Date | PIN | Status | | ---------------- |:------------| :---- | :------------ | | 5111111111111118 | 01/39 | 100 | CAPTURED | | 8888880000000002 | 05/23 | 100 | NOT CAPTURED |

Contributing

Thank you for considering contributing to Cashier!

License

Laravel Cashier-tap is open-sourced software licensed under the MIT license.

Comments