jessepollak / jessepollak/card

Update card image after receiving data dynamically

Open
#355 19 comments 0 reactions 0 assignees View on GitHub
workaround
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)

![image](https://cloud.githubusercontent.com/assets/11523074/26418436/930bb112-4092-11e7-92ac-6d5d7b5a7d79.png)

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.