1.0.9 • Published 8 years ago

payment-tools v1.0.9

Weekly downloads
2
License
MIT
Repository
github
Last release
8 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

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago