pix-utils
Version:
Set of tools to parse, generate and validate payments of Brazil Instant Payment System (Pix)
68 lines (67 loc) • 1.74 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_POSTAL_CODE = 61,
TAG_UNRESERVED_TEMPLATE = 80,
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,// EL52
TAG_TRANSACTION_CURRENCY = 53,// EL53
TAG_COUNTRY_CODE = 58,//EL58
TAG_MERCHANT_NAME = 59,//EL59
TAG_MERCHANT_CITY = 60,//EL60
TAG_POSTAL_CODE = 61
}
export declare enum TagsWithSubTags {
TAG_MAI = 26,//EL26
TAG_ADDITIONAL_DATA = 62,//EL62
TAG_UT = 80
}
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;