File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ describe("Service", () => {
299299 expect ( service . testCreateBaseUrl ( url ) ) . toBe ( "https://mycompany-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54" ) ;
300300 } ) ;
301301
302- it ( "should throw error if liveEndpointUrlPrefix is empty for Payout " , ( ) => {
302+ it ( "should throw error if liveEndpointUrlPrefix is empty for BinLookup " , ( ) => {
303303 // create Client for TEST environment without liveEndpointUrlPrefix
304304 const config = new Config ( {
305305 apiKey : "test_key" ,
Original file line number Diff line number Diff line change @@ -48,17 +48,19 @@ class Service {
4848 throw new Error ( "Endpoint URL must be provided." ) ;
4949 }
5050
51+ // handle TEST urls
5152 if ( config . environment !== EnvironmentEnum . LIVE ) {
5253 return url . replace ( "-live" , "-test" ) ;
5354 }
5455
56+ // handle LIVE urls
5557 if ( url . includes ( "/authe/" ) ) {
5658 return url . replace ( "https://test.adyen.com/" , "https://authe-live.adyen.com/" ) ;
5759 }
5860
5961 if ( url . includes ( "pal-" ) ) {
6062 // LIVE pal URL must provide prefix
61- if ( config . environment === EnvironmentEnum . LIVE && ! config . liveEndpointUrlPrefix ) {
63+ if ( ! config . liveEndpointUrlPrefix ) {
6264 throw new Error ( "Live endpoint URL prefix must be provided for LIVE environment." ) ;
6365 }
6466 return url . replace ( "https://pal-test.adyen.com/pal/servlet/" ,
@@ -67,7 +69,7 @@ class Service {
6769
6870 if ( url . includes ( "checkout-" ) ) {
6971 // LIVE checkout URL must provide prefix
70- if ( config . environment === EnvironmentEnum . LIVE && ! config . liveEndpointUrlPrefix ) {
72+ if ( ! config . liveEndpointUrlPrefix ) {
7173 throw new Error ( "Live endpoint URL prefix must be provided for LIVE environment." ) ;
7274 }
7375 if ( url . includes ( "/possdk/v68" ) ) {
You can’t perform that action at this time.
0 commit comments