1.1.2 • Published 5 days ago

stripe-tax-utils v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

stripe tax utilities

Returns Stripe type for supplied tax id and country

Install

npm i stripe-tax-utils

Usage

import stripeTaxUtils from 'stripe-tax-utils';

// get stripe type
const type = stripeTaxUtils.getStripeType({
  country: 'GB',
  taxId: 'GB123456789',
});
const type2 = stripeTaxUtils.getStripeType({
  country: 'gb',
  taxId: 'XI123456789',
});

console.log(type); // gb_vat
console.log(type2); // eu_vat

// return whole array of tax items with regex to test yourself
const map = stripeTaxUtils.getMap();

// get one type
const typeObj = stripeTaxUtils.getTaxItem({
  country: 'GB',
  taxId: 'GB123456789',
});

console.log(typeObj);
// {
//   country: 'GB',
//   type: 'gb_vat',
//   description: 'United Kingdom VAT number',
//   regex: /^GB[0-9]{9}$/,
//   example: 'GB123456789'
// }

Licence MIT

1.1.2

5 days ago

1.1.1

2 months ago

1.0.12

8 months ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.2

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago