Allow contribution forms to support Mastercard 2bin series
authorSeamus Lee <seamuslee001@gmail.com>
Tue, 13 Sep 2016 22:00:35 +0000 (08:00 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Tue, 13 Sep 2016 22:00:35 +0000 (08:00 +1000)
templates/CRM/Core/BillingBlock.js

index dec4b6581fc3a1ebbfd3b889ca95d7ef004b5ffe..894487b80c9e88b1942356aca5109aac03c6cfb0 100644 (file)
@@ -43,7 +43,7 @@
     // Based on http://davidwalsh.name/validate-credit-cards
     // See also https://en.wikipedia.org/wiki/Credit_card_numbers
     var card_types = {
-      'mastercard': '5[1-5][0-9]{14}',
+      'mastercard': '(5[1-5][0-9]{2}|2[3-6][0-9]{2}|22[3-9][0-9]|222[1-9]|27[0-1][0-9]|2720)[0-9]{12}',
       'visa': '4(?:[0-9]{12}|[0-9]{15})',
       'amex': '3[47][0-9]{13}',
       'dinersclub': '3(?:0[0-5][0-9]{11}|[68][0-9]{12})',