stripe / react-stripe-js

React components for Stripe.js and Stripe Elements
https://stripe.com/docs/stripe-js/react
MIT License
1.75k stars 267 forks source link

Add onLoadError to card and cardNumber elements #488

Closed martinalong-stripe closed 6 months ago

martinalong-stripe commented 6 months ago

Summary & motivation

Users will now be able to use onLoadError on the card and cardNumber elements:

cardElement.onLoadError((e) => console.log(e));

cardNumberElement.onLoadError((e) => console.log(e));

API review

https://docs.google.com/document/d/1ZoI--5Uuiy9j_FfEJauL9i_X5vf7miEsHIOp-2JS0eY/edit

Testing & documentation

I wrote unit tests

Will update the documentation when we release the feature