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

Stripe refactorings #8407

Open
wants to merge 18 commits into
base: stripe-api-upgrade
Choose a base branch
from
Open

Stripe refactorings #8407

wants to merge 18 commits into from

Conversation

gbp
Copy link
Member

@gbp gbp commented Oct 10, 2024

What does this do?

Refactor Stripe wrappers classes and minor template updates.

Why was this needed?

Help with future migration to Stripe Prices.


[skip changelog]

@gbp gbp marked this pull request as ready for review October 11, 2024 08:19
gbp added 13 commits October 14, 2024 12:58
Replacing wrapped Stripe objects with new Pro Plan which includes
Taxable.

Pro Plan will be expanded in later commits while refactoring the
checkout process.
Check in object respond to the method before forwarding. This is needed
to fix exceptions such as:
  private method `BigDecimal' called for #<Stripe::Subscription...
Load and cache subscription.plan, automatically wrapping in our Pro
Plan class.
Automatically include Pro SubscriptionWithDiscount so we don't have to
manually wrap the instances in the controller.
This really isn't needed now this module is included in Pro
Subscription.
Use whole integers instead of floats which can cause rounding errors.
Change to `#discounted_amount` to better represent when this method is
returning.
Move Discount module under Pro Subscription namespace.
- Show discount price and name instead of coupon code
- Remove leading space around billing date
- Minor CSS layout changes to ensure subscription sign up and
  subscription show views are consistent.
Improve billing frequency helper method:
1. accept Stripe Plan as and argument
2. take into account plans interval count
3. work with all interval types

Add billing interval helper method to output `per user, per month` or
`per user, every 2 months` depending on how the Stripe Plan has been
configured.
Handle strings correctly irrespective of if they start with the
namespace or not.
Allowing us to simplify the controller actions so we're always dealing
with Plan objects.
Again simplify controllers by moving coupons loading into delegated
classes.
Further simplification of controllers by moving default source handling
into a delegated class.
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.

1 participant