kvcvc / isic

DiscountManager API client

Home Page:https://www.npmjs.com/package/@kvcvc/isic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

isic

Version Downloads

ISIC Discount Manager client implementation

  • verify ISIC/ITIC/ALIVE cards
  • report discount usage

Installation

Using npm:

npm install @kvcvc/isic

Usage

const DiscountManagerClient = require('@kvcvc/isic');

const client = new DiscountManagerClient(
  'DM_USERNAME',
  'DM_PASSWORD',
  'DM_INSTANCE_URL'
);

client
  .verifyCard('S420001019431J', 'Janička Testová')
  .then((res) => {
    /* {
      id: 3215481, 
      createdOn: '2022-01-01T08:00:00+00:00',
      cardNumber: 'S420001019431J',
      cardholderName: 'Janička Testová',
      mode: 'CARDHOLDER',
      result: 'FAILED',
      reason: 'CARD_EXPIRED',
      cardType: 'ISIC'
    } */
  })
  .catch((err) => {
    // DiscountManagerClientException: Invalid credentials specified
  });

Documentation

For complete documentation about the available operations, please see the auto-generated JSDocs documentation.

License

MIT

About

DiscountManager API client

https://www.npmjs.com/package/@kvcvc/isic

License:MIT License


Languages

Language:JavaScript 100.0%