Added handler for bad email error while stripe user creation#7956
Open
FilinBrChaos wants to merge 3 commits into
Open
Added handler for bad email error while stripe user creation#7956FilinBrChaos wants to merge 3 commits into
FilinBrChaos wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves Stripe customer handling in zambdas to prevent failures when a patient/guarantor email address is rejected by Stripe, and to ensure a Stripe customer exists before sending an invoice.
Changes:
- When creating a Stripe customer, catch invalid email errors and retry customer creation without an email address.
- When updating a Stripe customer, catch invalid email errors and retry the update without the email field.
- In the invoice-sending task, create a Stripe customer ID on-demand when it’s missing from the Account.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/zambdas/src/subscriptions/task/sub-send-invoice-to-patient/index.ts | Creates a Stripe customer ID on-demand instead of hard-failing when missing. |
| packages/zambdas/src/shared/stripeIntegration.ts | Adds retry logic for Stripe customer creation when Stripe rejects the email field. |
| packages/zambdas/src/ehr/shared/harvest/index.ts | Adds retry logic for Stripe customer updates when Stripe rejects the email field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…atient-payment-via-stripe-bad-email
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.
https://linear.app/zapehr/issue/OTR-2419/rcm-ehr-when-taking-patient-payment-via-stripe-bad-email-address-fails