UNPKG

@doctech/fib

Version:

First Iraqi Bank payment integration for DocTech

46 lines (45 loc) 1.25 kB
export interface FIBConfig { clientId: string; clientSecret: string; baseUrl: string; } export interface MonetaryValue { amount: string; currency: "IQD"; } export interface CreatePaymentOptions { monetaryValue: MonetaryValue; statusCallbackUrl?: string; description?: string; expiresIn?: string; refundableFor?: string; category?: PaymentCategory; } export type PaymentCategory = "ERP" | "POS" | "ECOMMERCE" | "UTILITY" | "PAYROLL" | "SUPPLIER" | "LOAN" | "GOVERNMENT" | "MISCELLANEOUS" | "OTHER"; export interface PaymentResponse { paymentId: string; readableCode: string; qrCode: string; validUntil: string; personalAppLink: string; businessAppLink: string; corporateAppLink: string; } export interface AuthResponse { access_token: string; expires_in: number; refresh_token: string; token_type: string; } export interface PaymentStatus { paymentId: string; status: "PAID" | "UNPAID" | "DECLINED"; paidAt: string | null; amount: MonetaryValue; decliningReason: "SERVER_FAILURE" | "PAYMENT_EXPIRATION" | "PAYMENT_CANCELLATION" | null; declinedAt: string | null; paidBy: { name: string; iban: string; } | null; }