Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #1106 +/- ##
==========================================
- Coverage 96.09% 95.56% -0.54%
==========================================
Files 832 835 +3
Lines 19507 19687 +180
==========================================
+ Hits 18746 18813 +67
- Misses 761 874 +113
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
❌ 47 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
❌ 47 Tests Failed:
View the top 3 failed tests by shortest run time
📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
❌ 47 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
❌ 47 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| "invoice.payment_failed", | ||
| "invoice.payment_succeeded", | ||
| "payment_intent.succeeded", | ||
| "setup_intent.succeeded", |
There was a problem hiding this comment.
TODO - these need to be turned on in Stripe dashboard
27940a4 to
d163c61
Compare
|
|
||
| def _cleanup_incomplete_subscription(self, subscription, owner): | ||
| latest_invoice = subscription.latest_invoice | ||
| if not latest_invoice or not latest_invoice.payment_intent: |
There was a problem hiding this comment.
may need to do a safe access here incase the attribute doesn't exist
| if owner.stripe_subscription_id is not None: | ||
| # if the existing subscription is incomplete, clean it up and create a new checkout session | ||
| subscription = self.payment_service.get_subscription(owner) | ||
| if subscription and subscription.status == "incomplete": |
There was a problem hiding this comment.
same here for safe access
| pass | ||
|
|
||
| def get_unverified_payment_methods(self, owner): | ||
| return [] |
There was a problem hiding this comment.
should this be a pass?
| payment_intents = stripe.PaymentIntent.list( | ||
| customer=owner.stripe_customer_id, limit=100 | ||
| ) | ||
| for intent in payment_intents.data: |
There was a problem hiding this comment.
will this and the below data object always exist?
| ) | ||
| for intent in payment_intents.data: | ||
| if ( | ||
| hasattr(intent, "next_action") |
There was a problem hiding this comment.
could maybe do a .get() here instead
| ) | ||
| for intent in setup_intents.data: | ||
| if ( | ||
| hasattr(intent, "next_action") |
|
|
||
| def _get_unverified_payment_methods(self, owner): | ||
| log.info( | ||
| "Getting unverified payment methods", extra=dict(owner_id=owner.ownerid) |
There was a problem hiding this comment.
should we add the customerid to this log too?
| unverified_payment_methods = [] | ||
|
|
||
| # Check payment intents | ||
| payment_intents = stripe.PaymentIntent.list( |
There was a problem hiding this comment.
I'm a little surprised stripe doesn't have a shared API for these two considering the properties being pulled off of each are the same
There was a problem hiding this comment.
Yeah, unfortunately these are separate in their api. Also surprising is that these don't show up in the listPaymentMethods stripe api. When I looked into Stripe's UI where these are represented on the same page, it looks like they are calling a separate internal api (vs. listPaymentMethods) to show the unverified ACH payment method.
Handles ACH microdeposits delayed payment verification flow.
This PR handles the below new logical flows:
unverified_payment_methodslist toGET /account-detailspayment_intent.succeededsetup_intent.succeededOther things of note:
Tested end-to-end flows:
codecov/engineering-team#2622