-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: Add Update Billing Address service function #611
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #611 +/- ##
=======================================
Coverage 91.49% 91.50%
=======================================
Files 615 615
Lines 16379 16401 +22
=======================================
+ Hits 14986 15007 +21
- Misses 1393 1394 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found @@ Coverage Diff @@
## main #611 +/- ##
=======================================
Coverage 91.49% 91.50%
=======================================
Files 615 615
Lines 16379 16401 +22
=======================================
+ Hits 14986 15007 +21
- Misses 1393 1394 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #611 +/- ##
===========================================
Coverage 95.93000 95.93000
===========================================
Files 793 793
Lines 17697 17719 +22
===========================================
+ Hits 16977 16998 +21
- Misses 720 721 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
if not billing_address: | ||
raise ValidationError(detail="No billing_address sent") | ||
owner = self.get_object() | ||
billing = BillingService(requesting_user=request.current_owner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will request.current_owner and self.get_object() ever be different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so after some investigation, current_owner is an actual "owner" or "user," while the "owner" that is being updated in this case is actually an "organization" or "account" tied to the actual stripe subscription lol.
If you're confused, me too :) But this is something we'll probably be revisiting once the "Account" model is created
Purpose/Motivation
Part of the Q2 billing epic, particularly around updates for edit billing details, this PR aims to add a new service function around updating a user's billing address.
This function is very similar to the email address function, the main difference being the data payload being pulled from the API request and the payload being passed into the stripe customer modify function.
Links to relevant tickets
Closes codecov/engineering-team#1863
Notes to Reviewer
For now, this endpoint isn't being used anywhere, but it will be used in the useUpdateBillingAddress gazebo hook added in this PR: codecov/gazebo#2940. That hook is currently hard coded to use sentry's company address.
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.