import { CollectibleBillingData } from '../CollectibleBillingData'; /** * Google Pay environment configuration */ export enum GooglePayEnvironment { /** * Test environment - for development and testing * Uses Google Pay test servers and test payment methods */ TEST = 'TEST', /** * Production environment - for live transactions * Uses Google Pay production servers with real payment methods */ PRODUCTION = 'PRODUCTION', } /** * Google Pay configuration * Used to configure Google Pay environment and behavior */ export interface GooglePayNativeConfig { /** * Google Pay environment (TEST or PRODUCTION) */ environment: GooglePayEnvironment; /** * The types of billing data that can be collected via Google Pay * Optional - if not specified, no additional billing data will be collected */ collectibleBillingData?: CollectibleBillingData[]; } /** * Convert GooglePayNativeConfig to JSON for native modules */ export function googlePayNativeConfigToJson(config: GooglePayNativeConfig): { [key: string]: any; } { return { environment: config.environment, collectibleBillingData: config.collectibleBillingData, }; } /** * Convert GooglePayEnvironment enum to JSON string */ export function googlePayEnvironmentToJson(env: GooglePayEnvironment): string { return env; } /** * Convert string to GooglePayEnvironment enum */ export function googlePayEnvironmentFromString( env: string ): GooglePayEnvironment { switch (env.toUpperCase()) { case 'TEST': return GooglePayEnvironment.TEST; case 'PRODUCTION': return GooglePayEnvironment.PRODUCTION; default: return GooglePayEnvironment.PRODUCTION; // Default to production for safety } }