import Config # Note we also include the path to a cache manifest # containing the digested version of static files. config :payment_gateway_app, PaymentGatewayAppWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json", server: true # Runtime production configuration. config :payment_gateway_app, PaymentGatewayAppWeb.Endpoint, secret_key_base: System.get_env("SECRET_KEY_BASE") || raise("SECRET_KEY_BASE not set") # Configure your payment provider config :payment_gateway_app, api_provider: get_provider_module(), api_key: System.get_env("PG_API_KEY"), api_secret: System.get_env("PG_API_SECRET"), api_endpoint: System.get_env("PG_API_ENDPOINT") defp get_provider_module do case System.get_env("PG_PROVIDER_MODULE") do nil -> PaymentGatewayApp.Providers.MockProvider module_string -> try do Module.concat([module_string]) rescue ArgumentError -> PaymentGatewayApp.Providers.MockProvider end end end