-
Notifications
You must be signed in to change notification settings - Fork 23
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 ACH related hooks #3662
Conversation
Bundle ReportChanges will increase total bundle size by 6.09MB (100.48%) ⬆️
|
63487b1
to
530b60a
Compare
Bundle ReportChanges will increase total bundle size by 825 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #3662 +/- ##
==========================================
- Coverage 98.93% 98.91% -0.02%
==========================================
Files 815 817 +2
Lines 14686 14720 +34
Branches 4168 4165 -3
==========================================
+ Hits 14529 14561 +32
- Misses 150 152 +2
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #3662 +/- ##
==========================================
- Coverage 98.93% 98.91% -0.02%
==========================================
Files 815 817 +2
Lines 14686 14720 +34
Branches 4160 4173 +13
==========================================
+ Hits 14529 14561 +32
- Misses 150 152 +2
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #3662 +/- ##
==========================================
- Coverage 98.93% 98.91% -0.02%
==========================================
Files 815 817 +2
Lines 14686 14720 +34
Branches 4160 4173 +13
==========================================
+ Hits 14529 14561 +32
- Misses 150 152 +2
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #3662 +/- ##
==========================================
- Coverage 98.93% 98.91% -0.02%
==========================================
Files 815 817 +2
Lines 14686 14720 +34
Branches 4160 4165 +5
==========================================
+ Hits 14529 14561 +32
- Misses 150 152 +2
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
cd705a2
to
71bc658
Compare
71bc658
to
72cd37d
Compare
queryFn: ({ signal }) => | ||
createStripeSetupIntent({ provider, owner, signal }).then((res) => { | ||
const parsedRes = CreateStripeSetupIntentSchema.safeParse(res.data) | ||
if (!parsedRes.success) { |
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.
Do we want to return different stuff if one of the "error" types comes back?
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.
Hm true, I'll have those errors reject as well (seems that is the pattern in other hooks too). I'll do a pass at the error pathways too to make sure these get reacted to correctly as well
reset: () => void | ||
error: null | Error | ||
isLoading: boolean | ||
mutate: (variables: any, data: any) => void |
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.
is variables actually "any" ?
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.
Ah just copied that over from the updateCard implementation, good catch of a lazy moment lol. Updated.
}, | ||
}) | ||
.then((result) => { | ||
if (result.error) return Promise.reject(result.error) |
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.
This error object is a user readable thing right? And not like a stack trace or something
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.
It would take the shape of a stripe error like below. And our current error framework would have that propagate to the user as the generic error page.
I don't think the contents of the error are ever shown to the user. I'll take a pass in the next PRs on the error flows that not missing something in there, good callout.
{
"type": "some_error",
"message": "Some message",
"code": "some_code",
"payment_intent": {
"id": "pi_xyz",
"status": "requires_payment_method"
}
}
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.
lgtm, couple thoughts on things
Add hooks related to project to add ACH payment method.
The below changes are made:
useAccountDetails
[edit existing] - add usBankAccount as a possible return valueuseUpdateBillingEmail
[edit existing] - adds a knob to propagate the updated email to the default payment methoduseCreateStripeSetupIntent
[new] - This will be in order to cut over from the existing Stripe CardElement to their PaymentElement. PaymentElement requires a clientSecret from api which establishes a Stripe SetupIntent (done in api here)updatePaymentMethod
[new] - pretty similar to existing updateCard except uses stripe's "confirmSetup" api instead of "createPayment". We can deprecate updateCard once we cut over to this one. This is needed to hook in with the PaymentElement stripe component (vs. CardElement)Other notes:
Added the
Provider
type instead ofstring
and that needed a bunch of files touched FYICloses codecov/engineering-team#3109