Skip to content

Commit

Permalink
Add onLoadError to card and cardNumber elements (#488)
Browse files Browse the repository at this point in the history
* Add onLoadError to card and cardNumber elements

* Run lint
  • Loading branch information
martinalong-stripe committed Apr 4, 2024
1 parent 53bcc21 commit fb65a58
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit fb65a58

Please sign in to comment.