import { OnInit, OnDestroy, EventEmitter, ChangeDetectorRef } from '@angular/core'; import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; import { SubtrakService } from '../../services/subtrak.service'; import { PaymentMethodsService } from '../../services/payment-methods.service'; import { PaymentMethod, PaymentProvider, PaymentProviderConfig } from '../../models'; import * as i0 from "@angular/core"; /** * PaymentProviderCardComponent * * Automatically detects and renders the appropriate payment provider (Stripe/Paymob) * based on customer country and tenant's configured payment providers. * * Features: * - Automatic provider detection based on country * - Dynamic Stripe Elements rendering * - Dynamic Paymob iframe rendering * - Tenant-specific publishable keys * - Tokenization and payment method creation * - Loading and error states * - Responsive design * * @example * ```html * * * * * * * * * * * * ``` */ export declare class PaymentProviderCardComponent implements OnInit, OnDestroy { private subtrak; private paymentMethods; private cdr; private sanitizer; /** * Customer ID for the payment method */ customerId: string; /** * Customer's country code (ISO 3166-1 alpha-2) * Used to determine the appropriate payment provider * If not provided, will be automatically fetched from customer data */ countryCode?: string; /** * Optional: Force a specific provider instead of auto-detection */ provider?: PaymentProvider; /** * Optional: Payment amount (required for Paymob) * For Stripe: If not provided, creates a payment method for future use * For Paymob: Required to create payment intent */ amount?: number; /** * Optional: Payment currency (required for Paymob) * Examples: 'EGP' (Egypt), 'SAR' (Saudi Arabia), 'AED' (UAE), 'USD', 'EUR' */ currency?: string; /** * Optional: Payment description */ description?: string; /** * Optional: Redirect URL after payment completion (Paymob only) * Where to redirect the user after successful payment * Example: 'https://yourapp.com/payment-success' */ redirectUrl?: string; /** * Emitted when a payment method is successfully added */ paymentMethodAdded: EventEmitter; /** * Emitted when an error occurs */ error: EventEmitter; /** * Emitted when the component is loading */ loadingChange: EventEmitter; loading: boolean; errorMessage: string | null; detectedProvider: PaymentProvider | null; providerConfig: PaymentProviderConfig | null; isProcessing: boolean; savedPaymentMethods: PaymentMethod[]; selectedPaymentMethodId: string | null; showNewCardForm: boolean; loadingSavedMethods: boolean; private stripe; private stripeElements; private stripeCardElement; paymobIframeUrl: SafeResourceUrl | null; paymobClientSecret: string | null; private paymobCardElement; private destroy$; private isBrowser; constructor(subtrak: SubtrakService, paymentMethods: PaymentMethodsService, cdr: ChangeDetectorRef, sanitizer: DomSanitizer, platformId: object); ngOnInit(): void; ngOnDestroy(): void; private initializePaymentProvider; /** * Load saved payment methods for the customer */ private loadSavedPaymentMethods; /** * Select a saved payment method */ selectPaymentMethod(methodId: string | undefined): void; /** * Use selected saved payment method (emit it) */ useSavedPaymentMethod(): void; /** * Get display text for card brand */ getCardBrandIcon(brand: string | null | undefined): string; private fetchCustomerCountry; private detectProviderByCountry; private isPaymobProvider; private fetchProviderConfig; private initializeStripe; private initializePaymob; private loadStripeScript; private loadPaymobPixelScript; private initializePaymobPixel; submitPayment(): Promise; private submitStripePayment; private submitPaymobPayment; private setLoading; private handleError; get isStripe(): boolean; get isPaymob(): boolean; get providerName(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }