KR.onBrandChanged()
Description
The callback defined in KR.onBrandChanged() is called every time a card brand is detected.
The cardInfo object contains the brand property which can take the following values:
- Amex
cb - mastercard
- maestro
visa_electron - Visa
It also contains the bin of the card entered.
To view the complete list, see the reference documentation of the effectiveBrand parameter here: Payment.
Example of integration
https://github.com/lyra/rest-php-examples/blob/master/www/js_examples/jquery/minimalEmbeddedForm.onBrandChanged.php#L70-L78
<script type="text/javascript"> $(document).ready(function() { KR.onBrandChanged( function({KR, cardInfo}) { var myMessage = "Selected brand: " + cardInfo.brand + ", and bin: " + cardInfo.bin; $("#custommessage").html(myMessage); }); }); </script>