jessepollak / jessepollak/card
Update card image after receiving data dynamically
- Dominant language
- SCSS
- Stars
- 11.7k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
Hello guys.
First, congratulations on the plugin, extraordinary!
I use it in an application, where most of the time, the user informs the data of the card directly on the screen. But, for example, when the user uses the visa checkout, which returns the data from the card, then the user does not need to fill in, upon receiving the data the visa checkout already fill in the fields, but, the card image is not fully updated, I used the technique below to update the expiration date, name and CVN:
` $("#accountNumber").val('4716331625353350');
$("#card_name").val('Aguinaldo Aranda');
$('#card_expiry').val('12/2020');
$("#card_cvc").val('987');
var evt = document.createEvent('HTMLEvents');
evt.initEvent('change', false, true);
document.getElementById('card_name').dispatchEvent(evt);
document.getElementById('accountNumber').dispatchEvent(evt);
document.getElementById('card_expiry').dispatchEvent(evt);
document.getElementById('card_cvc').dispatchEvent(evt);`
But the card number does not update , as does the card flag (image)

Does anyone know how to proceed to update the card image and card number?
Thank you very much.
NOTE: Sorry for the translator's English.
Contributor guide
Assessment
This issue has not been assessed yet.