From 496ae06d404685cda635e2a2ce7e0b9f71141a2a Mon Sep 17 00:00:00 2001 From: Bruno Borges Russian Date: Wed, 28 Oct 2020 13:47:41 -0300 Subject: [PATCH] Add brand: JCB --- creditcard/card.py | 1 + tests/unit/test_card.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/creditcard/card.py b/creditcard/card.py index cae76e8..fa703c6 100644 --- a/creditcard/card.py +++ b/creditcard/card.py @@ -9,6 +9,7 @@ "elo": r"^(401178|401179|431274|438935|451416|457393|457631|457632|504175|627780|636297|636368|(506699|5067[0-6]\d|50677[0-8])|(50900\d|5090[1-9]\d|509[1-9]\d{2})|65003[1-3]|(65003[5-9]|65004\d|65005[0-1])|(65040[5-9]|6504[1-3]\d)|(65048[5-9]|65049\d|6505[0-2]\d|65053[0-8])|(65054[1-9]|6505[5-8]\d|65059[0-8])|(65070\d|65071[0-8])|65072[0-7]|(65090[1-9]|65091\d|650920)|(65165[2-9]|6516[6-7]\d)|(65500\d|65501\d)|(65502[1-9]|6550[3-4]\d|65505[0-8]))[0-9]{10,12}$", # noqa: E501 "cabal": r"^(604324|604330|604337|604203|604338)[0-9]{10,12}", "softnex": r"^610800", + "jcb": r"^(?:2131|1800|35\d{3})\d{11}$", "diners": r"^3(?:0[0-5]|[68][0-9])[0-9]{11}$", "discover": r"^6(?:011|5[0-9]{2}|4[4-9][0-9]{1}|(22(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[01][0-9]|92[0-5]$)[0-9]{10}$))[0-9]{12}$", # noqa: E501 "hipercard": r"^(38[0-9]{17}|60[0-9]{14})$", diff --git a/tests/unit/test_card.py b/tests/unit/test_card.py index 1dcf5e0..80f9fc0 100644 --- a/tests/unit/test_card.py +++ b/tests/unit/test_card.py @@ -38,6 +38,9 @@ def test_is_valid(self): ("cabal", "6043240000000000"), ("master", "5369835519963014"), ("visa", "4539578763621486"), + ("jcb", "3567060000000000"), + ("jcb", "3558820541695558"), + ("jcb", "3569620447726565"), ], ) def test_get_brand(self, brand, number):