From f2d1b863e69a4206142168f05f0ebbc230387f36 Mon Sep 17 00:00:00 2001 From: Steve Kroll Date: Mon, 28 Dec 2020 10:45:35 -0600 Subject: [PATCH 1/2] updated mastercard regex --- payment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payment.go b/payment.go index 1ee1fbb..1484441 100644 --- a/payment.go +++ b/payment.go @@ -17,7 +17,7 @@ var ( var ( amexCardFormatString = "^3[47][0-9]{13}$" visaCardFormatString = "^4[0-9]{15}$" - mastercardCardFormatString = "^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$" + mastercardCardFormatString = "^(?:5[1-9][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$" discoverCardFormatString = "^65[0-9]{14}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$" jcbCardFormatString = "^(?:2131|1800|35[0-9]{3})[0-9]{11}$" dinersClubInternationalFormatString = "^3(?:0[0-5]|[68][0-9])[0-9]{11}$" From b8d74197e92853ac9ed3d19d750544b024cbbe3b Mon Sep 17 00:00:00 2001 From: Steve Kroll Date: Mon, 28 Dec 2020 11:13:10 -0600 Subject: [PATCH 2/2] merged in develop --- payment.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/payment.go b/payment.go index 1484441..e500bc1 100644 --- a/payment.go +++ b/payment.go @@ -18,9 +18,9 @@ var ( amexCardFormatString = "^3[47][0-9]{13}$" visaCardFormatString = "^4[0-9]{15}$" mastercardCardFormatString = "^(?:5[1-9][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$" - discoverCardFormatString = "^65[0-9]{14}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$" - jcbCardFormatString = "^(?:2131|1800|35[0-9]{3})[0-9]{11}$" - dinersClubInternationalFormatString = "^3(?:0[0-5]|[68][0-9])[0-9]{11}$" + discoverCardFormatString = "^65[0-9]{14,17}|64[4-9][0-9]{13,16}|6011[0-9]{12,15}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10,13})$" + jcbCardFormatString = "^(?:2131|1800|35[0-9]{2})[0-9]{12,15}$" + dinersClubInternationalFormatString = "^3(?:0[0-5]|[68][0-9])[0-9]{11,16}$" AMEXCardFormatRegex = regexp.MustCompile(amexCardFormatString) VISACardFormatRegex = regexp.MustCompile(visaCardFormatString)