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

[11.x] Multiplan subscriptions #900

Merged
merged 7 commits into from Apr 3, 2020
Merged

Conversation

driesvints
Copy link
Member

@driesvints driesvints commented Mar 26, 2020

This PR implements multiplan subscription support into Cashier.

Some examples:

// Add a new plan to a subscription...
$subscription->addPlan($plan);

// Add a new plan to a subscription and invoice immediately...
$subscription->addPlanAndInvoice($plan);

// Add a new plan with a specific quantity...
$subscription->addPlan($plan, $quantity);

// Remove a plan from a subscription...
$subscription->removePlan($plan);

// Update quantities for plans...
$subscription->updateQuantity($quantity, $plan);

Stripe docs: https://stripe.com/docs/billing/subscriptions/multiplan
Stripe API: https://stripe.com/docs/api/subscription_items

Closes #397

Todo

  • Update swap and resume methods on Subscription model
  • Update onTrial, subscribed, subscribedTo and onPlan methods on ManagesSubscriptions trait
  • Maybe introduce easy way of applying tax rates to individual subscription items?
  • Add new methods on Subscription model
  • Write tests

@driesvints driesvints changed the title [11.x] Work on multi-plan subscriptions [11.x] Work on multiplan subscriptions Mar 28, 2020
@driesvints driesvints changed the title [11.x] Work on multiplan subscriptions [11.x] Multiplan subscriptions Mar 28, 2020
@driesvints driesvints force-pushed the multiplan-subscriptions branch 2 times, most recently from 2978b63 to 172c557 Compare March 31, 2020 13:51
@driesvints driesvints marked this pull request as ready for review March 31, 2020 13:55
@taylorotwell taylorotwell merged commit 61f049e into master Apr 3, 2020
@driesvints driesvints deleted the multiplan-subscriptions branch April 3, 2020 17:34
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.

None yet

3 participants