File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -131,4 +131,31 @@ describe("Service", () => {
131131 const url = "https://some-test.adyen.com/api/" ;
132132 expect ( service . testCreateBaseUrl ( url ) ) . toBe ( "https://some-live.adyen.com/api/" ) ;
133133 } ) ;
134- } ) ;
134+
135+ it ( "should build TEST url for SessionAuthentication" , ( ) => {
136+ const config = new Config ( {
137+ apiKey : "test_key" ,
138+ environment : EnvironmentEnum . TEST ,
139+ liveEndpointUrlPrefix : "mycompany"
140+ } ) ;
141+ client = new Client ( config ) ;
142+
143+ const service = new TestService ( client ) ;
144+ const url = "https://test.adyen.com/authe/api/v1" ;
145+ expect ( service . testCreateBaseUrl ( url ) ) . toBe ( "https://test.adyen.com/authe/api/v1" ) ;
146+ } ) ;
147+
148+ it ( "should build LIVE url for SessionAuthentication" , ( ) => {
149+ const config = new Config ( {
150+ apiKey : "test_key" ,
151+ environment : EnvironmentEnum . LIVE ,
152+ liveEndpointUrlPrefix : "mycompany"
153+ } ) ;
154+ client = new Client ( config ) ;
155+
156+ const service = new TestService ( client ) ;
157+ const url = "https://test.adyen.com/authe/api/v1" ;
158+ expect ( service . testCreateBaseUrl ( url ) ) . toBe ( "https://authe-live.adyen.com/authe/api/v1" ) ;
159+ } ) ;
160+
161+ } ) ;
Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ class Service {
5858 }
5959 }
6060
61+ if ( url . includes ( "/authe/" ) ) {
62+ return url . replace ( "https://test.adyen.com/" , "https://authe-live.adyen.com/" ) ;
63+ }
64+
6165 if ( url . includes ( "pal-" ) ) {
6266 return url . replace ( "https://pal-test.adyen.com/pal/servlet/" ,
6367 `https://${ this . client . config . liveEndpointUrlPrefix } -pal-live.adyenpayments.com/pal/servlet/` ) ;
You can’t perform that action at this time.
0 commit comments