-
Notifications
You must be signed in to change notification settings - Fork 729
Closed
Labels
Description
Cashier Stripe Version
16.0.2
Laravel Version
12.34.0
PHP Version
8.4
Database Driver & Version
MySQL 8
Description
After upgrading to Cashier v16, attempting to apply a coupon to my user's subscription is throwing an error. This worked in v15.
The error is thrown:
Call to undefined method Laravel\\Cashier\\SubscriptionBuilder::applyCoupon()
Steps To Reproduce
Attempt to use applyCoupon method on subscription:
$subscriptionOptions = [
'success_url' => "$frontendURL".$request->input('success_url', 'account/billing/checkout/success/'),
'cancel_url' => "$frontendURL".$request->input('cancel_url', 'account/billing/plans/'),
];
$user = User::find(Auth::id());
$subscription = $user->newSubscription('default', $plan->stripe_id);
if (Str::of($request->input('plan', ''))->contains(['monthly-75', 'yearly-75'])) {
if (config('domain-monitor.new_customers_discount')) {
$subscription = $subscription->applyCoupon(config('domain-monitor.new_customers_discount'));
}
}
$subscription = $subscription->checkout($subscriptionOptions);Reactions are currently unavailable