import { ValidationError } from './account.types'; export interface Installment { pk: number; installment_count: number; label: string; price_with_accrued_interest: string; monthly_price_with_accrued_interest: string; } export interface CardType { name: string; slug: string; logo: string; } export interface PaymentProcessRequest { requestReferenceNo: string; cvc: string; cardAlias: string; accountKey: string; amount: string; orderNo: string; currencyCode: string; paymentType: string; acquirerIcaNumber: string; installmentCount: number; authenticationMethod: string; secure3DModel: string; terminalGroupId: string; additionalFields?: any; } export interface OrderData { pre_order?: { total_amount: string; currency_type_label: string; redirect_to_three_d?: boolean; installment?: { installment_count: number; monthly_price_with_accrued_interest: string; }; payment_option?: { name: string; }; application_date?: string; }; context_list?: Array<{ page_context?: { order_no: string; installments?: Installment[]; msisdn?: string; three_d?: boolean; extras?: { user_id: string; bank_ica: string | null; }; }; page_name?: string; page_slug?: string; }>; } export type OTPType = 'RTA' | 'OTP' | 'CVV'; export type TransactionType = | 'PURCHASE' | 'PURCHASE_3D' | 'DIRECT_PURCHASE' | 'DIRECT_PURCHASE_3D'; export type RewardName = 'FBB' | 'BNS'; export type RewardCategory = 'special' | 'general'; export interface RewardItem { type: RewardCategory; amount: number | string; name?: RewardName; } export interface PaymentState { selectedCard: any | null; selectedInstallment: Installment | null; installments: Installment[]; cardType: CardType | null; orderData: OrderData | null; orderCompleted: boolean; cvc: string; useThreeD: boolean; availableRewards: RewardItem[]; selectedRewards: RewardItem[]; isLoadingRewards: boolean; } export type InformationModalType = 'warning' | 'error' | 'success' | 'info'; export interface InformationModalData { type: InformationModalType; title: string; message: string; secondaryMessage?: string; buttonText: string; } export type OTPContext = 'account' | 'payment'; export interface ModalState { showLinkModal: boolean; showOTPModal: boolean; show3DSecureModal: boolean; showInformationModal: boolean; showRewardModal: boolean; informationModalData: InformationModalData | null; otpType: OTPType; otpContext: OTPContext; verificationData: any | null; cardToDelete: any | null; removingCardId: string | null; } export interface DirectPaymentRequest { requestReferenceNo: string; cvc: string; cardNumber: string; cardHolderName: string; expiryDate: string; accountKey: string; amount: string; orderNo: string; currencyCode: string; paymentType: string; acquirerIcaNumber: string; installmentCount: number; authenticationMethod: string; secure3DModel: string; terminalGroupId: string; additionalFields?: any; } export interface DirectPaymentResponse { responseCode: string; responseDescription: string; token?: string; retrievalReferenceNumber?: string; maskedNumber?: string; terminalGroupId?: string; url3d?: string; url3dSuccess?: string; url3dFail?: string; } export interface MPResponse { version: string; buildId: string; statusCode: number; message: string; correlationId: string; requestId: string; result: T; exception?: ExceptionResponse; } export interface ExceptionResponse { level: string; code: string; message: string; validationErrors: ValidationError[]; details: string[]; }