@@ -8,6 +8,15 @@ const TERMINAL_API_ENDPOINT_AU_LIVE = "https://terminal-api-au.adyen.com";
88const TERMINAL_API_ENDPOINT_US_LIVE = "https://terminal-api-us.adyen.com" ;
99const TERMINAL_API_ENDPOINT_APSE_LIVE = "https://terminal-api-apse.adyen.com" ;
1010
11+
12+ /**
13+ * Supported environments for the Adyen APIs.
14+ */
15+ export enum EnvironmentEnum {
16+ LIVE = "LIVE" ,
17+ TEST = "TEST"
18+ }
19+
1120/**
1221 * Supported Regions for Terminal API integration.
1322 */
@@ -30,7 +39,7 @@ export const TERMINAL_API_ENDPOINTS_MAP: Record<RegionEnum, string> = {
3039interface ConfigConstructor {
3140 username ?: string ;
3241 password ?: string ;
33- environment ?: Environment ;
42+ environment ?: EnvironmentEnum ;
3443 marketPayEndpoint ?: string ;
3544 applicationName ?: string ;
3645 apiKey ?: string ;
@@ -48,7 +57,7 @@ class Config {
4857
4958 public username ?: string ;
5059 public password ?: string ;
51- public environment ?: Environment ;
60+ public environment ?: EnvironmentEnum ;
5261 public marketPayEndpoint ?: string ;
5362 public applicationName ?: string ;
5463 public apiKey ?: string ;
@@ -75,6 +84,15 @@ class Config {
7584 if ( options . region ) this . region = options . region ;
7685 }
7786
87+ /**
88+ * Checks if the provided environment is valid.
89+ * @param environment - The environment to validate.
90+ * @returns true if the environment exists in EnvironmentEnum, false otherwise.
91+ */
92+ public static isEnvironmentValid ( environment : EnvironmentEnum ) : boolean {
93+ return Object . values ( EnvironmentEnum ) . includes ( environment ) ;
94+ }
95+
7896 /**
7997 * Checks if the provided region is a valid supported.
8098 * @param region - The region to validate.
0 commit comments