UNPKG

cashfree-pg-api-contract

Version:

This package contains the contract for Cashfree PG

152 lines (151 loc) 4.78 kB
export declare enum CFEnvironment { PRODUCTION = "PRODUCTION", SANDBOX = "SANDBOX" } export declare class CFSession { payment_session_id: string; orderID: string; environment: string; constructor(sessionID: string, orderID: string, environment: CFEnvironment); } export declare class CFSubscriptionSession { subscription_session_id: string; subscription_id: string; environment: string; constructor(subscriptionSessionId: string, subscriptionId: string, environment: CFEnvironment); } export interface CFCard { } export declare class Card implements CFCard { cardNumber: string; cardHolderName: string; cardExpiryMM: string; cardExpiryYY: string; cardCvv: string; saveCard: boolean; constructor(cardNumber: string, cardHolderName: string, cardExpiryMM: string, cardExpiryYY: string, cardCvv: string, saveCard: boolean); } export declare class SavedCard implements CFCard { instrumentId: string; cardCvv: string; constructor(instrumentId: string, cardCvv: string); } export declare class ElementCard extends Card { constructor(cardHolderName: string, cardExpiryMM: string, cardExpiryYY: string, cardCvv: string, saveCard: boolean); } export declare enum UPIMode { COLLECT = "COLLECT", INTENT = "INTENT" } export declare class CFUPI { mode: UPIMode; id: string; constructor(mode: UPIMode, id: string); } export declare enum CFPaymentModes { CARD = "CARD", UPI = "UPI", NB = "NB", WALLET = "WALLET", EMI = "EMI", PAY_LATER = "PAY_LATER", PAYPAL = "PAYPAL" } export interface CFPaymentComponent { hashset: Set<CFPaymentModes>; } export declare class CFPaymentComponentBuilder { private hashset; private enableAllModes; build(): CFPaymentComponent; add(cfPaymentModes: CFPaymentModes): this; } export interface CFTheme { navigationBarBackgroundColor: string; navigationBarTextColor: string; buttonBackgroundColor: string; buttonTextColor: string; backgroundColor: string; primaryTextColor: string; secondaryTextColor: string; } export declare class CFThemeBuilder { private navigationBarBackgroundColor; private navigationBarTextColor; private buttonBackgroundColor; private buttonTextColor; private backgroundColor; private primaryTextColor; private secondaryTextColor; setNavigationBarBackgroundColor(value: string): this; setNavigationBarTextColor(value: string): this; setButtonBackgroundColor(value: string): this; setButtonTextColor(value: string): this; setPrimaryTextColor(value: string): this; setSecondaryTextColor(value: string): this; setBackgroundColor(value: string): this; build(): CFTheme; } export interface CFIntentTheme extends CFTheme { } export declare class CFIntentThemeBuilder { private backgroundColor; private primaryTextColor; setBackgroundColor(value: string): this; setPrimaryTextColor(value: string): this; build(): CFIntentTheme; } export interface CFWebTheme extends CFTheme { } export declare class CFWebThemeBuilder { private navigationBarBackgroundColor; private navigationBarTextColor; setNavigationBarBackgroundColor(value: string): this; setNavigationBarTextColor(value: string): this; build(): CFWebTheme; } export interface CheckoutPayment { version: string; } export declare class CFDropCheckoutPayment implements CheckoutPayment { private readonly session; private readonly components; private readonly theme; version: string; constructor(session: CFSession, components: CFPaymentComponent | null, theme: CFTheme | null); getSession(): CFSession; getComponents(): string[]; getTheme(): CFTheme; } export declare class CFWebCheckoutPayment implements CheckoutPayment { private readonly session; private readonly theme; version: string; constructor(session: CFSession, theme: CFWebTheme | null); getSession(): CFSession; getTheme(): CFWebTheme; } export declare class CFUPIIntentCheckoutPayment implements CheckoutPayment { private readonly session; private readonly theme; version: string; constructor(session: CFSession, theme: CFTheme | null); getSession(): CFSession; getTheme(): CFTheme; } export declare class CFCardPayment implements CheckoutPayment { private readonly session; private readonly card; version: string; constructor(session: CFSession, card: CFCard); getSession(): CFSession; getCard(): CFCard; } export declare class CFUPIPayment implements CheckoutPayment { private readonly session; private readonly upi; version: string; constructor(session: CFSession, upi: CFUPI); getSession(): CFSession; getUpi(): CFUPI; }