Created
January 10, 2017 00:31
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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