Skip to content

[7.x] Document Cashier Pending updates #6090

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,20 @@ By default, Stripe prorates charges when swapping between plans. The `noProrate`

For more information on subscription proration, consult the [Stripe documentation](https://stripe.com/docs/billing/subscriptions/prorations).

#### Pending Updates

When working with subscriptions you also have the ability to make Stripe wait with applying any changes if the payment was unsuccessful, either due to an invalid card or extra action required (like 3D Secure). You can apply this behavior using the `pendingIfPaymentFails` method:

$user->subscription('default')->pendingIfPaymentFails()->swap('provider-plan-id');

This will hold off any plan changes until the customer has successfully made the payment. After they've done so their subscription will be updated with the `customer.subscription.updated` webhook.

Alternatively, you can also choose to hard stop any change to a subscription by using the `errorIfPaymentFails` method:

$user->subscription('default')->errorIfPaymentFails()->swap('provider-plan-id');

This was the behavior before the [2019-03-14](https://stripe.com/docs/upgrades#2019-03-14) API update from Stripe. Applying this behavior will force the Stripe SDK to throw an error when a payment fails for a subscription.

<a name="subscription-quantity"></a>
### Subscription Quantity

Expand Down