diff --git a/docker-compose.yml b/docker-compose.yml index fa18833..f501f93 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,7 @@ services: - 8888:80 environment: SPIFF_API_BASE: 'http://host.docker.internal:8080' + SPIFF_API_AP_BASE: 'http://host.docker.internal:8080' SPIFF_API_US_BASE: 'http://host.docker.internal:8080' WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: exampleuser diff --git a/replace-env-vars.py b/replace-env-vars.py index 5801e55..2078c7d 100644 --- a/replace-env-vars.py +++ b/replace-env-vars.py @@ -9,11 +9,16 @@ if (env == 'production'): print('define("SPIFF_API_BASE", "https://api.spiff.com.au");') else: - print('define("SPIFF_API_BASE", "https://api.app.dev.spiff.com.au");') + print('define("SPIFF_API_BASE", "https://api.aumelbdev.spiffcommerce.com");') + elif line.startswith('define("SPIFF_API_AP_BASE"'): + if (env == 'production'): + print('define("SPIFF_API_AP_BASE", "https://api.au.spiffcommerce.com");') + else: + print('define("SPIFF_API_AP_BASE", "https://api.aumelbdev.spiffcommerce.com");') elif line.startswith('define("SPIFF_API_US_BASE"'): if (env == 'production'): print('define("SPIFF_API_US_BASE", "https://api.us.spiffcommerce.com");') else: - print('define("SPIFF_API_US_BASE", "https://api.app.dev.spiff.com.au");') + print('define("SPIFF_API_US_BASE", "https://api.aumelbdev.spiffcommerce.com");') else: print(line, end="") diff --git a/spiff-connect/spiff-connect.php b/spiff-connect/spiff-connect.php index c52c8aa..4e8d508 100644 --- a/spiff-connect/spiff-connect.php +++ b/spiff-connect/spiff-connect.php @@ -9,7 +9,8 @@ require plugin_dir_path(__FILE__) . 'includes/spiff-connect-requests.php'; -define("SPIFF_API_BASE", getenv("SPIFF_API_BASE")); +define("SPIFF_API_BASE", getenv("SPIFF_API_BASE")); // Legacy AU +define("SPIFF_API_AP_BASE", getenv("SPIFF_API_AP_BASE")); define("SPIFF_API_US_BASE", getenv("SPIFF_API_US_BASE")); define("SPIFF_API_INSTALLS_PATH", "/api/installs"); define("SPIFF_API_ORDERS_PATH", "/api/v2/orders"); @@ -18,6 +19,9 @@ // Get base API URL based on infrastructure choice. function spiff_get_base_api_url() { + if (get_option('spiff_infrastructure') === "AP") { + return SPIFF_API_AP_BASE; + } if (get_option('spiff_infrastructure') === "US") { return SPIFF_API_US_BASE; } @@ -145,7 +149,8 @@ function spiff_admin_menu_html() { Infrastructure