-
Notifications
You must be signed in to change notification settings - Fork 3
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
DON-1112: Add user-friendly validation for amount errors on regular g… #1821
Conversation
) { | ||
this.submitting = false; | ||
this.stripeError = this.getStripeFriendlyError(error, context); | ||
this.stripeError = getStripeFriendlyError(error, context); | ||
this.toast.showError(this.stripeError); | ||
this.stripeResponseErrorCode = error?.code; | ||
|
||
this.jumpToStep('Payment details'); | ||
this.goToFirstVisibleError(); | ||
} | ||
|
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.
function below moved to stripe.service.ts to allow sharing with new component. Not sure if that's the best place to move it to - not sure if its idiomatic or not to put extra stuff in the file alongside the service class in Angular.
984c9ed
to
910ce74
Compare
Instead of just displyaing the form as a toast we now add it to the page, and also change the spinner back to a button to allow the donor to stop watching it and perhaps try again.
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.
Slightly guessed about which bits are moved as running out of time today but all LGTM. Stepper interception approach is interesting, might be worth considering mirroring in the main form if we find it works well in practice.
|
||
export function getStripeFriendlyError( | ||
error: StripeError | {message: string, code: string, decline_code?: string, description?: string} | undefined, | ||
context: 'method_setup'| 'card_change'| 'confirm', |
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.
Liking this narrower type; assuming rest of this is moved only
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.
Yes it is just moved.
…iving form