ynkap-payment
Version:
Module de paiement Y-Nkap pour Angular - Intégration simple des paiements mobiles (Orange Money, MTN Mobile Money)
64 lines (63 loc) • 2.55 kB
TypeScript
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { ConfigurationService } from '../configuration/configuration.service';
import { ErrorHandlingService } from '../error-handling/error-handling.service';
import { AuthService } from '../auth/auth.service';
import { RetryService } from './retry/retry.service';
import { PaymentMethod, PaymentRequest, PaymentResponse, PaymentTransaction } from './models/payment.model';
import { LogoService } from '../shared/logo.service';
import * as i0 from "@angular/core";
export declare class PaymentService {
private http;
private configService;
private errorHandlingService;
private authService;
private retryService;
private logoService;
private availablePaymentMethodsSubject;
private currentTransactionSubject;
private transactionHistorySubject;
/**
* Observable of available payment methods
*/
get availablePaymentMethods$(): Observable<PaymentMethod[]>;
/**
* Observable of the current transaction
*/
get currentTransaction$(): Observable<PaymentTransaction | null>;
/**
* Observable of transaction history
*/
get transactionHistory$(): Observable<PaymentTransaction[]>;
private getMockPaymentMethods;
constructor(http: HttpClient, configService: ConfigurationService, errorHandlingService: ErrorHandlingService, authService: AuthService, retryService: RetryService, logoService: LogoService);
/**
* Load available payment methods
*/
private loadPaymentMethods;
/**
* Initiate a payment transaction
* @param paymentRequest The payment request details
* @returns Observable of the payment response
*/
initiatePayment(request: PaymentRequest): Observable<PaymentResponse>;
/**
* Retry a payment after an error or failure
* @param transactionId ID of the failed transaction
* @returns Observable of the payment response
*/
retryPayment(transactionId: string): Observable<PaymentResponse>;
/**
* Generate a unique transaction ID for retry tracking
*/
private generateTransactionId;
/**
* Create authentication headers for API requests
* @param apiKey The API key from configuration
* @param apiSecret The API secret from configuration
* @returns Object with authorization headers
*/
private getAuthHeaders;
static ɵfac: i0.ɵɵFactoryDeclaration<PaymentService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<PaymentService>;
}