Download the PHP package nguoingulanh/cashier-connect without Composer

On this page you can find all versions of the php package nguoingulanh/cashier-connect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cashier-connect

Cashier Connect

Tests Latest Version Total Downloads

Stripe Connect for Laravel Cashier (Stripe).

Cashier bills your customers. Cashier Connect pays your sellers: onboarding, connected account status, destination / direct charges, transfers, payouts, refunds and Connect webhooks, without touching Cashier itself.

Requirements

Package PHP Laravel Cashier
0.x, 1.x 8.2+ 11*, 12, 13 15, 16

* Laravel 11 no longer receives security fixes. It is still tested for existing applications, but upgrading is recommended.

Installation

Add the printed secret to .env:

That's it. The package reuses Cashier's STRIPE_KEY / STRIPE_SECRET, registers its routes, migrations and commands automatically, and needs no change to your users table. Run php artisan cashier-connect:doctor at any time to check the setup.

Connected accounts

Any Eloquent model can own a connected account: a User, a Shop, a Vendor... Use the facade, or add the optional ConnectBillable trait for shorter calls:

Accounts are Express by default. Pass any Stripe account parameter to change that:

When creating Express or Custom accounts, the package requests the card_payments and transfers capabilities, pre-fills the owner's email and stores the owner in the account metadata. By default a model owns a single account. Set multiple_accounts to true in the config to allow more than one.

Onboarding

Redirect the seller to Stripe-hosted onboarding. The connected account is created first if it does not exist yet:

When the seller comes back, the package syncs the account status and redirects to the URL you passed, or to onboarding.return_url if you passed none. If the Stripe link expired, a new one is issued automatically. The return and refresh URLs are signed, so they work without a session.

Taking payments

Destination charges

The customer pays the platform, and the funds are transferred to the seller. Build the options with destination() and pass them to Cashier:

Other builder methods: ->onBehalfOf() (the seller becomes the merchant of record), ->transferAmount(9000), ->transferGroup('ORDER_1') and ->with([...]) to add any raw parameter.

Direct charges

The payment is created on the connected account itself. onBehalfOf() returns a Stripe client that sends every request on that account:

Transfers, balance and payouts

For separate charges and transfers:

All money-moving methods accept Stripe request options, e.g. ['idempotency_key' => "order-{$order->id}"].

Refunds

Webhooks

Stripe sends connected account events to a dedicated Connect endpoint. php artisan cashier-connect:webhook creates it at /stripe/connect/webhook with these events:

account.updated, account.application.deauthorized, capability.updated, person.updated, payout.paid, payout.failed, payout.canceled

How the endpoint handles events:

To process events in the background, set a queue:

Add or override handlers in a service provider:

Platform events. Transfers and application fees happen on your account, so Stripe sends them to Cashier's regular webhook. If you enable transfer.created, transfer.reversed and application_fee.refunded on that endpoint, the package turns them into Connect events as well.

Events

Event When
ConnectAccountCreated An account was created
ConnectAccountUpdated Synced attributes changed ($event->changes)
ConnectAccountReady Charges and payouts became enabled. Fired once per transition
ConnectAccountRestricted Stripe disabled the account or information is past due
ConnectAccountDeauthorized The seller disconnected your platform
ConnectAccountDeleted The account was deleted
ConnectCapabilityUpdated A capability changed status
ConnectPayoutPaid / Failed / Canceled Payout status on the connected account
ConnectTransferCreated / Reversed Platform transfer events
ConnectApplicationFeeRefunded An application fee was refunded
ConnectWebhookReceived / Handled Every Connect webhook

All events live in Nguoingulanh\CashierConnect\Events and carry the local ConnectedAccount ($event->account->connectable is your model).

Middleware

Artisan commands

Command Description
cashier-connect:install Optional guided setup
cashier-connect:webhook Create the Connect webhook endpoint and print its secret
cashier-connect:doctor Check keys, secret, tables, routes and Stripe connectivity
cashier-connect:sync {account?} {--all} Pull account status from Stripe
cashier-connect:replay {event?} {--failed} {--force} Run stored webhook events again
cashier-connect:prune {--days=} Delete old processed webhook events (scheduled daily)

Testing your application

CashierConnect::fake() swaps Stripe for an in-memory gateway, so your tests make no HTTP calls:

Other helpers: restrict(), setAccount(), failNext('createTransfer'), assertCalled(), assertNotCalled() and calls().

Configuration

Everything works with the defaults. To customise, publish the config:

Key / env Default
default_type / CASHIER_CONNECT_TYPE express Account type when none is given
default_country / CASHIER_CONNECT_COUNTRY null Default account country
capabilities card_payments, transfers Requested for Express / Custom
multiple_accounts false Allow several accounts per model
webhook.secret / STRIPE_CONNECT_WEBHOOK_SECRET Comma-separate for rotation
webhook.queue / CASHIER_CONNECT_QUEUE null (sync) Queue for webhook processing
onboarding.return_url / CASHIER_CONNECT_RETURN_URL / Default page after onboarding
onboarding.link_ttl 1440 Minutes the signed return / refresh URLs stay valid
routes true Set false to register routes yourself
models.*, tables.* Swap the models or table names

License

The MIT License (MIT). See LICENSE.


All versions of cashier-connect with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/queue Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
laravel/cashier Version ^15.0|^16.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nguoingulanh/cashier-connect contains the following files

Loading the files please wait ...