cloudcreativity/laravel-stripe

Laravel integration for Stripe, including Stripe Connect.

v0.7.0 2023-03-19 18:06 UTC

This package is auto-updated.

Last update: 2024-04-19 20:40:03 UTC


README

Build Status

Laravel Stripe

Overview

A Laravel integration for Stripe's official PHP package.

This package allows you to fluently query the Stripe API via repositories. Repositories can be for either your application's Stripe account, or connected Stripe accounts.

Example

// For your application's account:
/** @var \Stripe\PaymentIntent $intent */
$intent = Stripe::account()
    ->paymentIntents()
    ->create('gbp', 1500);

// For a Stripe Connect account model:
$account->stripe()->paymentIntents()->create('gbp', 999);

What About Cashier?

This package is meant to be used in addition to Laravel Cashier, not instead of it.

Our primary use-case is Stripe Connect. We needed a package that provided really easy access to data from connected Stripe accounts. We wanted to make interacting with the entire Stripe API fluent, easily testable and highly debuggable.

In contrast, Cashier does not provide full Stripe API coverage, and provides no support for Stripe Connect. So if you need to do more than just Cashier's billing functionality, install this package as well.

Installation

Installation is via Composer. Refer to the Installation Guide for instructions.

Documentation

  1. Installation
  2. Accessing the Stripe API
  3. Receiving Webhooks
  4. Stripe Connect
  5. Artisan Commands
  6. Testing

Version Compatibility

The following table shows which version to install. We have provided the Stripe API version that we developed against as guide. You may find the package works with older versions of the API.

Laravel Stripe PHP Stripe API Laravel-Stripe Cashier
10.x ^7.52 >=2020-03-02 0.7.x ^14.8
9.x ^7.52 >=2020-03-02 0.6.x ^12.3
8.x ^7.52 >=2020-03-02 0.5.x|0.6.x ^12.3
7.x ^7.0 >=2020-03-02 0.4.x ^12.0
6.x ^6.40 >=2019-05-16 0.2.x ^9.0|^10.0|^11.0|^12.0

Contributing

We have only implemented the repositories for the Stripe resources we are using in our application. Repositories are very easy to implement - for example, the payment intent repository - because they are predominantly composed of traits. Then they just need to be added to the connector class.

If you find this package is missing a resource you need in your application, an ideal way to contribute is to submit a pull request to add the missing repository.