File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 20
20
import Client from "./client" ;
21
21
import Config from "./config" ;
22
22
23
-
23
+ /**
24
+ * Base Service class for all API services.
25
+ * Handles the setup of the endpoint URL for the API requests.
26
+ */
24
27
class Service {
25
28
public apiKeyRequired = false ;
26
29
public client : Client ;
@@ -29,6 +32,15 @@ class Service {
29
32
this . client = client ;
30
33
}
31
34
35
+ /**
36
+ * Constructs the base URL for API requests based on environment and endpoint type.
37
+ * - For non-LIVE environments, replaces '-live' with '-test'.
38
+ * - For LIVE environment, requires a liveEndpointUrlPrefix.
39
+ * - Handles special cases for 'pal-' and 'checkout-' endpoints.
40
+ * @param url - The original endpoint URL.
41
+ * @returns The formatted endpoint URL.
42
+ * @throws Error if liveEndpointUrlPrefix is missing for LIVE environment.
43
+ */
32
44
protected createBaseUrl ( url : string ) : string {
33
45
const config : Config = this . client . config ;
34
46
You can’t perform that action at this time.
0 commit comments