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

[15.x] Fix anchorBillingCycle for subscription checkout #1659

Merged

Conversation

ybert
Copy link
Contributor

@ybert ybert commented Feb 27, 2024

At the moment it is impossible to use newSubsciption builder , add an anchorBillingCycle and create a checkout.

This PR fix this to make this code work :

$checkoutBuilder = $user
            ->newSubscription('default', ['price_yearly'])
            ->anchorBillingCycleOn(Carbon::tomorrow())
            ->noProrate()
            ->checkout();

Before, this code did a checkout but does not add anchorBillingCycle date and proration_behavior to the POST data to stripe as expected here : https://docs.stripe.com/payments/checkout/billing-cycle?ui=stripe-hosted#create-session

It resolves #1658

@driesvints driesvints changed the title Fix anchorBillingCycle for subscription checkout [15.x] Fix anchorBillingCycle for subscription checkout Feb 27, 2024
Copy link
Member

@driesvints driesvints left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Thanks

@taylorotwell taylorotwell merged commit 06f01fa into laravel:15.x Feb 28, 2024
7 checks passed
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.

Use of anchorBillingCycleOn() for subscription checkout
3 participants