import type { Environment } from '../../types/Envinronment'; interface UrlServiceProps { isMobile?: boolean; useIP?: boolean; preferPublicIp?: boolean; } export type PaymentSuccessRedirectURL = `${string}/payment/processed?orderId=${string}`; export type PaymentFailedRedirectURL = `${string}/payment/cancelled?paymentFailed=true&orderId=${string}`; export type PaymentCancelledRedirectURL = `${string}/payment/cancelled?orderId=${string}`; export declare class UrlService { publicBucketName: string; privateBucketName: string; baseDomain: string; backendApiBaseUrl: string; environment: Environment; constructor({ publicBucketName, privateBucketName, baseDomain, backendApiBaseUrl, environment, }: { publicBucketName: string; privateBucketName: string; baseDomain: string; backendApiBaseUrl: string; environment: Environment; }); getBackendUrl: ({ isMobile, useIP }?: UrlServiceProps) => string; /** * When running locally, the storage can be accessed * either using localhost, the localIp of the host or Nginx URL * * We mainly use this for local testing as Chrome forces us to have * an HTTPS endpoint to upload assets to the Firebase Emulator * @returns */ getLocalStorageHostUrl: ({ isMobile, useIP, }: UrlServiceProps) => Promise; getPublicStorageUrl: ({ isMobile, useIP }: UrlServiceProps) => Promise; getPrivateStorageUrl: ({ isMobile, useIP, }: UrlServiceProps) => Promise; getFrontendUrl: () => string; /** * Decides where to send the user back after the payment has been completed * if we already decided on an origin, it will use that origin * * @param origin * @returns */ getFrontendRedirectURL(origin?: string): string; /** * Decides which backend the payment provider should reply to * It can be either dev, prod or local. Transbank queries the backend from * the frontend, so you will still be able to use local urls * @param origin * @returns */ getBackendRedirectURLForTransBankPayments({ origin, orderId, storeId, }: { origin?: string; orderId?: string; storeId?: string; }): string; /** * Redirección de pago exitoso * @param origin * @param orderId */ getPaymentSuccessRedirectURL(origin: string | undefined, orderId: string): PaymentSuccessRedirectURL; /** * Redirección de pago con error (fallo en commit, etc) * @param origin * @param orderId */ getPaymentFailedRedirectURL(origin: string | undefined, orderId: string): PaymentFailedRedirectURL; /** * Redirección de pago cancelado por el usuario * @param origin * @param orderId */ getPaymentCancelledRedirectURL(origin: string | undefined, orderId: string): PaymentCancelledRedirectURL; } export {};