Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added mastercard MCC list #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions iso18245/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class MCC(NamedTuple):
visa_description: str
visa_req_clearing_name: str
alipay_description: str
mastercard_description: str


_cached_csv: Dict[str, List[List[str]]] = {}
Expand Down Expand Up @@ -72,6 +73,7 @@ def get_mcc(mcc: str) -> MCC:
visa_description = ""
visa_req_clearing_name = ""
alipay_description = ""
mastercard_description = ""

if not mcc_range.reserved:
data = _find_mcc_in_csv(mcc, "iso18245_official_list.csv")
Expand All @@ -98,6 +100,10 @@ def get_mcc(mcc: str) -> MCC:
if alipay_info:
alipay_description, found = alipay_info[0], True

mastercard_info = _find_mcc_in_csv(mcc, "mastercard_list.csv")
if mastercard_info:
mastercard_description, found = mastercard_info[0], True

if not found:
raise MCCNotFound(mcc)

Expand All @@ -111,6 +117,7 @@ def get_mcc(mcc: str) -> MCC:
visa_description=visa_description,
visa_req_clearing_name=visa_req_clearing_name,
alipay_description=alipay_description,
mastercard_description=mastercard_description,
)


Expand Down
Loading
Loading