defmodule DaProductApp.TestHelper do @moduledoc """ Test helpers for DaProductApp tests. """ @doc """ Set application to test mode. """ def set_test_mode do Application.put_env(:da_product_app, :test_mode, true) end @doc """ Create test MPGS configuration. """ def test_mpgs_config do %{ base_url: "https://test-gateway.mastercard.com", api_version: "version/60", network_name: "mastercard_mpgs_sandbox", timeout: 30_000, mpgs_config: %{ merchant_id: "TEST_MERCHANT", endpoints: %{ session: "/api/rest/{version}/merchant/{merchantId}/session", payment: "/api/rest/{version}/merchant/{merchantId}/order/{orderId}/transaction/{transactionId}", payment_inquiry: "/api/rest/{version}/merchant/{merchantId}/order/{orderId}" }, retry_config: %{ max_retries: 3 } }, auth_config: %{ consumer_key: "test_consumer_key_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef12345", signing_key_file: "/path/to/test-key.p12", signing_key_password: "test_password", signature_method: "RSA-SHA256", oauth_version: "1.0", test_mode: true } } end end