@craynic/qr-platba
Version:
Library to work with Czech QR payments
108 lines (107 loc) • 3.97 kB
TypeScript
import * as Dinero from 'dinero.js';
export declare enum RequestType {
PaymentRequest = "SPD",
CollectionRequest = "SCD"
}
export declare class QrRequest {
private requestType;
static readonly VERSION: string;
private account;
private amountInCents;
private message;
private constantSymbol;
private specificSymbol;
private variableSymbol;
private paymentReference;
private receiverName;
private dateOfTransaction;
private dateOfLastTransaction;
private paymentType;
private notificationType;
private notificationAddress;
private frequency;
private payAfterDeath;
private retryPeriod;
private senderID;
private url;
private senderNote;
constructor(account: string | string[], requestType?: RequestType);
getAccount(): BankAccountString[];
setAccount(account: string | string[]): QrRequest;
private validateAccount;
getAmount(): AmountInCents | null;
setAmountInCents(amountInCents: number | null): QrRequest;
private validateAmount;
getMessage(): Message | null;
setMessage(value: string | null): QrRequest;
getConstantSymbol(): ConstantSymbol | null;
setConstantSymbol(value: string | null): QrRequest;
getSpecificSymbol(): SpecificSymbol | null;
setSpecificSymbol(value: string | null): QrRequest;
getVariableSymbol(): VariableSymbol | null;
setVariableSymbol(value: string | null): QrRequest;
getPaymentReference(): PaymentReference | null;
setPaymentReference(value: string | null): QrRequest;
getReceiverName(): ReceiverName | null;
setReceiverName(value: string | null): QrRequest;
getDateOfTransaction(): Date | null;
setDateOfTransaction(value: Date | null): QrRequest;
getDateOfLastTransaction(): Date | null;
setDateOfLastTransaction(value: Date | null): QrRequest;
getPaymentType(): PaymentType | null;
setPaymentType(value: string | null): QrRequest;
getNotificationType(): NotificationType | null;
setNotificationType(value: NotificationType | null): QrRequest;
getNotificationAddress(): NotificationAddress | null;
setNotificationAddress(value: string | null): QrRequest;
getFrequency(): Frequency | null;
setFrequency(value: string | null): QrRequest;
isPayAfterDeath(): boolean;
setPayAfterDeath(value: boolean): QrRequest;
getRetryPeriod(): RetryPeriod | null;
setRetryPeriod(value: number | null): QrRequest;
getSenderID(): SenderID | null;
setSenderID(value: string | null): QrRequest;
getURL(): URL | null;
setURL(value: string | null): QrRequest;
getSenderNote(): SenderNote | null;
setSenderNote(value: string | null): QrRequest;
toString(): string;
getChecksum(): string;
private toStringWithoutChecksum;
private getFields;
isAlphanumericQRCode(): boolean;
}
type BankAccountString = string & {
readonly QrPayAccountString: unique symbol;
};
type AmountInCents = Dinero.Dinero & {
readonly Dinero: unique symbol;
};
type StringOfLength<Min, Max> = string & {
min: Min;
max: Max;
readonly QrPayStringOfLength: unique symbol;
};
type Message = StringOfLength<0, 60>;
type NumericStringOfLength<Min, Max> = StringOfLength<Min, Max> & {
readonly NumericStringOfLength: unique symbol;
};
type ConstantSymbol = NumericStringOfLength<0, 10>;
type SpecificSymbol = NumericStringOfLength<0, 10>;
type VariableSymbol = NumericStringOfLength<0, 10>;
type PaymentReference = NumericStringOfLength<0, 16>;
type ReceiverName = StringOfLength<0, 35>;
type PaymentType = StringOfLength<0, 3>;
type NotificationType = 'P' | 'E';
type NotificationAddress = StringOfLength<0, 320>;
type Frequency = StringOfLength<1, 3> & {
readonly Frequency: unique symbol;
};
type RetryPeriod = number & {
readonly RetryPeriod: unique symbol;
};
type SenderID = StringOfLength<0, 20>;
type URL = StringOfLength<0, 140>;
type SenderNote = StringOfLength<0, 60>;
export {};