@spot-flow/checkout-inline-js
Version:
This project is an inline library that enables users to make payments seamlessly. It integrates smoothly into your application, providing a streamlined checkout experience.
86 lines (84 loc) • 2.86 kB
TypeScript
import { PaymentAPIResponse } from '../api';
import { CardDetailValueType, GetMerchantDetailsTax } from '../types/types';
type Props = {
container: HTMLElement;
token: string;
encryption: string;
email: string;
amount: number;
totalAmount: number;
switchTab: (val: number) => void;
planId: string;
onSuccess?: (_val?: any) => void;
currency: string;
rdtCode?: string;
url?: string;
reference: string;
callBackUrl: string;
metadata: Record<string, unknown>;
localCurrency: string;
hidePaymentMethods: () => void;
showPaymentMethods: () => void;
onClose: (notClosePayment: boolean) => void;
restartTransactionProcess: () => void;
retryingPayment: boolean;
};
declare class Card {
private contents;
private cardDetailForm;
private cardOtpValidationForm;
private merchantPlanDetail;
private cardPinForm;
private avsForm;
private successScreen;
private pageLoader;
private warningScreen;
private transactionIssuesScreen;
private container;
private onSuccess;
private planId;
private email;
private token;
private amount;
private totalAmount;
private encryption;
private currency;
private _currentStep;
private activeRef;
private rdtCode?;
private url?;
private reference;
private callBackUrl;
private metadata;
private localCurrency;
private hidePaymentMethods;
private showPaymentMethods;
private onClose;
private cardResponse;
private cardResponseHeader;
private confirmationEnd;
private confirmationProgress;
private restartTransactionProcess;
private retryingPayment;
isMaxRetriesReached: boolean;
isMobile: boolean;
constructor({ amount, totalAmount, container, email, encryption, planId, token, currency, rdtCode, url, reference, onSuccess, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, }: Props);
get currentStep(): number;
set currentStep(step: number);
submitCardDetails(e: Event, _values: CardDetailValueType): Promise<void>;
private handlePinRequest;
showLoader(): void;
pinErrorStates(error: string, showLoader: HTMLElement, cancelPayment: HTMLButtonElement): void;
setPaymentError(text: string): void;
validatedAVS(e: Event, values: any): void;
submitOtp(e: Event, values: string): void;
private redirectTo3DS;
private redirectToPreciumDoc;
verifyPayment(onSuccess: (data: PaymentAPIResponse) => void, onError: (data: PaymentAPIResponse) => void): Promise<void>;
verifyPaymentProcess(): Promise<void>;
goBackToMerchant(): void;
renderCardContent(values?: GetMerchantDetailsTax): void;
private redirectTo;
private displayButtonText;
}
export default Card;