1.0.9 • Published 10 years ago

payment-tools v1.0.9

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Usage

In your project folder

npm install --save payment-tools

Format Credit Card Field Example

el.addEventListener('keyup', (e) => {
	var key = event.keyCode || event.charCode;
	if (key === 8 || key === 46) return;
	el.value = PaymentTools.formatCCNum(el.value);
});

el.addEventListener('keyup', (e) => {
	var key = event.keyCode || event.charCode;
	if (key === 8 || key === 46) return;
	el.value = PaymentTools.formatCCExp(el.value);
});

el.addEventListener('keyup', (e) => {
	var key = event.keyCode || event.charCode;
	if (key === 8 || key === 46) return;
	el.value = PaymentTools.formatCCCVV(el.value);
});

Available Functions

import * as PaymentTools from 'payment-tools';

PaymentTools.formatCCNum(num);
PaymentTools.formatCCExp(exp);
PaymentTools.formatCCCVV(cvv, type);

PaymentTools.validateCCNum(num);
PaymentTools.validateCCExp(exp);
PaymentTools.validateCCCVV(cvv, type);

PaymentTools.getCard(num);
PaymentTools.getType(num);
1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago