UNPKG

ynkap-payment

Version:

Module de paiement Y-Nkap pour Angular - Intégration simple des paiements mobiles (Orange Money, MTN Mobile Money)

54 lines (53 loc) 1.82 kB
import { Observable } from 'rxjs'; import { YnkapError, RetryOptions } from '../../error-handling/models/error.model'; import * as i0 from "@angular/core"; export interface RetryState { attemptNumber: number; maxRetries: number; nextRetryDelayMs: number; canRetry: boolean; lastError?: YnkapError; transactionId?: string; } export declare class RetryService { private retryStates; private defaultRetryOptions; /** * Initialize retry state for a transaction */ initializeRetryState(transactionId: string, options?: Partial<RetryOptions>): RetryState; /** * Get retry state for a transaction */ getRetryState(transactionId: string): RetryState | null; /** * Check if an error is retryable */ isRetryable(error: YnkapError, options?: Partial<RetryOptions>): boolean; /** * Calculate next retry delay with exponential backoff */ calculateRetryDelay(attemptNumber: number, options?: Partial<RetryOptions>): number; /** * Update retry state after an attempt */ updateRetryState(transactionId: string, error: YnkapError): RetryState | null; /** * Execute retry with proper delay and state management */ executeRetry<T>(transactionId: string, retryFn: () => Observable<T>, options?: Partial<RetryOptions>): Observable<T>; /** * Clear retry state for a transaction */ clearRetryState(transactionId: string): void; /** * Get human-readable retry information */ getRetryInfo(transactionId: string): string; /** * Check if automatic retry should be attempted */ shouldAutoRetry(error: YnkapError): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<RetryService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<RetryService>; }