pix-utils
Version:
Set of tools to parse, generate and validate payments of Brazil Instant Payment System (Pix)
64 lines (63 loc) • 1.59 kB
TypeScript
export declare enum EmvSchema {
TAG_INIT = 0,
TAG_ONETIME = 1,
TAG_MAI = 26,
TAG_MCC = 52,
TAG_TRANSACTION_CURRENCY = 53,
TAG_TRANSACTION_AMOUNT = 54,
TAG_COUNTRY_CODE = 58,
TAG_MERCHANT_NAME = 59,
TAG_MERCHANT_CITY = 60,
TAG_ADDITIONAL_DATA = 62,
TAG_CRC = 63
}
export declare enum EmvAdditionalDataSchema {
TAG_TXID = 5
}
export declare enum EmvMaiSchema {
TAG_MAI_GUI = 0,
TAG_MAI_PIXKEY = 1,
TAG_MAI_INFO_ADD = 2,
TAG_MAI_FSS = 3,
TAG_MAI_URL = 25,
BC_GUI = "br.gov.bcb.pix"
}
export declare enum EmvMandatory {
TAG_MCC = 52,
TAG_TRANSACTION_CURRENCY = 53,
TAG_COUNTRY_CODE = 58,
TAG_MERCHANT_NAME = 59,
TAG_MERCHANT_CITY = 60
}
export declare enum TagsWithSubTags {
TAG_MAI = 26,
TAG_ADDITIONAL_DATA = 62
}
export type ValidTags = {
readonly isValid: true;
readonly [key: number]: {
readonly tag: number;
readonly length: number;
readonly value: string;
};
readonly rawTags: {
readonly [key: number]: {
readonly tag: number;
readonly length: number;
readonly value: string;
};
};
readonly getTag: (tag: number) => string;
readonly getSubTag: (mainTag: number, tag: number) => string;
};
export type InvalidTags = {
readonly isValid: false;
readonly rawTags: {
readonly [key: number]: {
readonly tag: number;
readonly length: number;
readonly value: string;
};
};
};
export type ParsedTags = ValidTags | InvalidTags;