1.1.1 • Published 2 years ago

mcc-helper v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

MCC Helper

npm version

License

MCC Helperis a utility library designed to assist in fetching and interpreting Merchant Category Codes (MCC) across various card networks.

Features

šŸ›ļø Retrieve human-readable descriptions for MCC codes.

🌐 Support for multiple networks: Visa, Stripe, and an official list.

šŸ› ļø Graceful error handling for undefined or unknown MCCs.

šŸ”„ Convert MCC codes provided as strings or numbers. Installation Install the package via npm:

npm install mcc-helper

Or using Yarn:

yarn add mcc-helper

Usage

Basic Usage

import { getMCC } from '@sinclairliang/mcc-helper';

const exampleMcc = getMCC(1750, 'visa');
console.log(exampleMcc);  
// Carpentry Contractors

const description = getMCC('4131', 'stripe');
console.log(description);  
// Bus Lines

API

getMCC(mcc: number | string | undefined, network?: string): string

Fetches the description for a given MCC code.

  • mcc: The MCC code. Can be a number, string, or undefined.
  • network (optional): Specify the card network. Accepts 'visa', 'stripe', or leave undefined for the official list.
1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago