Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
2-series card type identification for mastercard
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Kramer committed Sep 1, 2018
1 parent 4b64534 commit 4e0907d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SwiftLuhn/Classes/SwiftLuhn.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ open class SwiftLuhn {
case .jcb:
return "^(?:2131|1800|35[0-9]{3})[0-9]{3,}$"
case .mastercard:
return "^5[1-5][0-9]{5,}$"
return "^5[1-5][0-9]{5,}|222[1-9][0-9]{3,}|22[3-9][0-9]{4,}|2[3-6][0-9]{5,}|27[01][0-9]{4,}|2720[0-9]{3,}$"
case .visa:
return "^4[0-9]{6,}$"
case .maestro:
Expand All @@ -60,7 +60,7 @@ open class SwiftLuhn {
case .jcb:
return "^(?:2131|1800|35[0-9]{3})[0-9]+$"
case .mastercard:
return "^5[1-5][0-9]+$"
return "^5[1-5][0-9]{5,}|222[1-9][0-9]{3,}|22[3-9][0-9]{4,}|2[3-6][0-9]{5,}|27[01][0-9]{4,}|2720[0-9]{3,}$"
case .visa:
return "^4[0-9]+$"
case .maestro:
Expand Down

0 comments on commit 4e0907d

Please sign in to comment.