Skip to content
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

Add onLoadError to card and cardNumber elements #488

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ export interface CardElementProps extends ElementProps {
* For more information, refer to the [Stripe.js reference](https://stripe.com/docs/js/element/events/on_networkschange?type=cardElement).
*/
onNetworksChange?: (event: {elementType: 'card'}) => any;

/**
* Triggered when the Element fails to load.
*/
onLoadError?: (event: {elementType: 'card'; error: StripeError}) => any;
}

export type CardElementComponent = FunctionComponent<CardElementProps>;
Expand Down Expand Up @@ -112,6 +117,11 @@ export interface CardNumberElementProps extends ElementProps {
* For more information, refer to the [Stripe.js reference](https://stripe.com/docs/js/element/events/on_networkschange?type=cardNumberElement).
*/
onNetworksChange?: (event: {elementType: 'cardNumber'}) => any;

/**
* Triggered when the Element fails to load.
*/
onLoadError?: (event: {elementType: 'cardNumber'; error: StripeError}) => any;
}

export type CardNumberElementComponent = FunctionComponent<
Expand Down
Loading