Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

4.0.0

Compare
Choose a tag to compare
@rennokki rennokki released this 16 May 19:22
· 59 commits to master since this release
8a6e994

Bumping renoki-co/cashier-register to ^5.0. Please see the latest release notes. Breaking changes will also be included in this release note.

Before upgrading

This update requires a new field in the subscription_usages table called used_total:

Schema::create('subscription_usages', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('subscription_id');
            $table->string('feature_id');
            $table->unsignedSmallInteger('used');
+           $table->unsignedSmallInteger('used_total');
            $table->timestamps();
});

Stripe ^12.13

This version recommends Cashier for Stripe ^12.13 or newer (8db080b).

Reinstall

You should re-run the install command to publish the actions needed for the subscription logic as well as the new design. The command now also copies app/Providers/BillingPortalServiceProvider.php and app/Providers/CashierRegisterServiceProvider.php which will be auto-imported during the installation.

$ php artisan billing-portal:install inertia stripe

New design

The billing dashboard was revamped with some new design that's easier to use and implement. You may simply just redirect your users for it using billing-portal.dashboard route for the new experience.

Running the install command will do the job. 🐱

Proration between swaps (cea7925)

Proration between swaps is enabled by default, but you can overwrite it in app/Providers/BillingPortalServiceProvider.php:

BillingPortal::dontProrateOnSwap();

Renames (c9bab51, deeb4f6, 7fd3f28, 5b712ec, a536fd9, 1c3e8ab, 928c5bf, 002ea80, 1794790)

For consistency, the following methods were renamed:

  • Replaced getBillableFromRequest with getBillable
  • Replaced setBillableOnRequest with resolveBillable
  • Replaced setStripeCheckoutOptions with resolveStripeCheckoutOptions
  • Replaced getOptionsForStripeCheckout with getStripeCheckoutOptions
  • Replaced onCheckout with resolveStripeCheckout
  • Replaced onSyncingQuotas with resolveQuotasSync