Skip to content

Instantly share code, notes, and snippets.

@tesshsu
Created January 10, 2017 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tesshsu/9268d4ae4d9eb8403a5f900d7a9950f3 to your computer and use it in GitHub Desktop.
Save tesshsu/9268d4ae4d9eb8403a5f900d7a9950f3 to your computer and use it in GitHub Desktop.
Function which detecting if country support/not support Credit Cart Amex payment, if support show the Amex credit card logo, if not hide.
function isAmexNotSupported(type) {
var selectedCountryCode = $('#selected-country').parents('.dr_inputBox').find('li.active').data('country-code');
var notAllowedCountries = ['AFG', 'ARG', 'BRA', 'COG', 'CIV', 'GNQ','ERI','FLK','GLP','GNB','IND','IRQ','LAO','LBY','MEX','MMR','SHN','STP','TUV' ];
var AmexNotSupportedCountries = notAllowedCountries.concat(AmexNotSupportedCountries);
if(AmexNotSupportedCountries) {
if ( $.inArray(selectedCountryCode, notAllowedCountries) !== -1 ) {
//binding your card event here
$('.cardLogoPart').find('.AMEX').hide();
}else{
$('.cardLogoPart').find('.AMEX').show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment