cashier-stripe
cashier-stripe copied to clipboard
[14.x] Improve guest Checkout flow
These changes are a followup to the guest checkout PR here: https://github.com/laravel/cashier-stripe/pull/1438. These allow for a more richer Checkout experience and a more fluent one. You can now use any method from the AllowsCoupons
and HandlesTaxes
traits:
$checkout = Checkout::guest()
->withCoupon('coupon_id')
->withTaxAddress('US', '72201', 'Arkansas')
->create();
Furthermore, I've managed to bring all of resolving of the Checkout Session options into the new CheckoutBuilder
class which will help in the future when adding new features to the Cashier Stripe Checkout experience.
One thing I needed to change are the property visibilities on the AllowsCoupons
and HandlesTaxes
traits so I could more easily copy them over.
A future change I'd like to make is to move the contents of Checkout::create
over to CheckoutBuilder::create
but we can do that maybe in the next major release.