Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.x] Improve guest Checkout flow #1439

Merged
merged 3 commits into from
Sep 23, 2022
Merged

Conversation

driesvints
Copy link
Member

@driesvints driesvints commented Sep 20, 2022

These changes are a followup to the guest checkout PR here: #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.

@driesvints driesvints changed the title Improve guest Checkout flow [14.x] Improve guest Checkout flow Sep 20, 2022
@driesvints driesvints marked this pull request as ready for review September 22, 2022 14:42
@taylorotwell taylorotwell merged commit 5ff74af into 14.x Sep 23, 2022
@taylorotwell taylorotwell deleted the improve-guest-checkout branch September 23, 2022 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants