import { TOpenOptions } from '../apis/App'; import { CheckoutConfig } from '../interfaces/CheckoutConfig'; export declare enum CALLBACK_MODE_ENUM { handler = "callback_handler", redirect = "callback_url_redirect", noredirect = "callback_url_noredirect" } export declare enum PAYMENT_MODE_ENUM { 'net_banking' = "Netbanking", 'wallet' = "Wallet", 'card' = "Cards", 'upi' = "UPI", 'emi' = "EMI" } export type TPaymentModes = keyof typeof PAYMENT_MODE_ENUM; type PaymentModeCodes = `${PAYMENT_MODE_ENUM}`; /** * list of all the util functions used in `App.js` * to open checkout */ declare class AppUtil { static readonly CUSTOM_PROPERTY_MAX_LENGTH = 5000; /** * PS-1599: the origin of `checkoutHost`, or null if it is not a usable absolute URL. * `event.origin` is always scheme://host[:port] with no trailing slash and no path, * so this is the only value it may be compared against. */ private static resolveExpectedOrigin; /** * PS-1609: any page may post any payload to the merchant window, so `data` is * untrusted input. Returns null for anything that is not a JSON object carrying a * string event_type, rather than letting a throw escape into the message handler. */ private static parseCheckoutMessage; static validateOptions: (samunnayaUrl: string, options: TOpenOptions, commonTrackingData: any) => void; static getPaymentModeCode: (mode: TPaymentModes | undefined) => PaymentModeCodes | null; static generateCheckoutUrl: (options: TOpenOptions & typeof CheckoutConfig & { paymentMode: PaymentModeCodes | null; }) => Promise; static openIframe: (checkoutUrl: string) => HTMLIFrameElement; /** * PS-1613: the single message listener owned by this class, so that a second * open() cannot stack another one on top of it. */ private static activeMessageHandler; static removeCloseListener: () => void; static addCloseListener: (options: { checkoutHost: string | undefined; callbackHandler: (response: unknown) => void; commonTrackingData: any; }, samunnayaUrl: string, checkoutFrame?: HTMLIFrameElement | null) => void; } export default AppUtil;