fix: remove code duplication in billing controller and use proper struct access method#3281
Open
nelsonmestevao wants to merge 2 commits intoLogflare:mainfrom
Open
fix: remove code duplication in billing controller and use proper struct access method#3281nelsonmestevao wants to merge 2 commits intoLogflare:mainfrom
nelsonmestevao wants to merge 2 commits intoLogflare:mainfrom
Conversation
nelsonmestevao
commented
Mar 12, 2026
| %{"plan" => plan_id, "type" => "metered"} | ||
| ) do | ||
| %{"plan" => plan_id, "type" => type} | ||
| ) when billing_plan_type in ["standard", "metered"] and type in ["standard", "metered"] do |
Contributor
Author
There was a problem hiding this comment.
This is just 4 combinations of "standard" and "metered" billing types.
nelsonmestevao
commented
Mar 12, 2026
623cf8c to
8738499
Compare
Ziinc
reviewed
Mar 16, 2026
8738499 to
9550eea
Compare
Ziinc
requested changes
Mar 19, 2026
Contributor
Ziinc
left a comment
There was a problem hiding this comment.
billing controller needs tests before we can do this.
Contributor
Author
|
Hi @Ziinc. I will add those. I didn't before because there's some mocking of stripe calls involved. |
8e740a4 to
b7ea70e
Compare
b7ea70e to
1ed95de
Compare
1ed95de to
46686ab
Compare
8f75759 to
647fcbf
Compare
nelsonmestevao
commented
Apr 13, 2026
| Logger.error("Billing error: #{inspect(err)}", %{billing: %{error_string: inspect(err)}}) | ||
|
|
||
| {:ok, _response} = Stripe.delete_customer(customer["id"]) | ||
| {:ok, _response} = Stripe.delete_customer(customer.id) |
Contributor
Author
There was a problem hiding this comment.
This was actually a bug. Stripe API calls change these to structs.
647fcbf to
96678d2
Compare
3269b54 to
39b4423
Compare
2a59308 to
cf34889
Compare
cf34889 to
29a12dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.