@@ -57,4 +57,44 @@ public function testLiveURLPrefixOther()
5757 $ url = $ service ->createBaseUrl ("https://kyc-test.adyen.com/lem/v3/legalEntities " );
5858 self ::assertEquals ("https://kyc-live.adyen.com/lem/v3/legalEntities " , $ url );
5959 }
60+
61+ // test PosMobileApi LIVE url with prefix
62+ public function testLiveURLPosSdkWithPrefix ()
63+ {
64+ $ client = new Client ();
65+ $ client ->setEnvironment (Environment::LIVE , "myCompany " );
66+ $ service = new Service ($ client );
67+ $ url = $ service ->createBaseUrl ("https://checkout-test.adyen.com/checkout/possdk/v68 " );
68+ self ::assertEquals (
69+ "https://myCompany-checkout-live.adyenpayments.com/checkout/possdk/v68 " ,
70+ $ url
71+ );
72+ }
73+
74+ // test PosMobileApi TEST url without prefx
75+ public function testTestURLPosSdk ()
76+ {
77+ $ client = new Client ();
78+ $ client ->setEnvironment (Environment::TEST );
79+ $ service = new Service ($ client );
80+ $ url = $ service ->createBaseUrl ("https://checkout-test.adyen.com/checkout/possdk/v68 " );
81+ self ::assertEquals (
82+ "https://checkout-test.adyen.com/checkout/possdk/v68 " ,
83+ $ url
84+ );
85+ }
86+
87+ // test PosMobileApi TEST url with prefix
88+ public function testTestURLPosSdkWithPrefix ()
89+ {
90+ $ client = new Client ();
91+ $ client ->setEnvironment (Environment::TEST , "myCompany " );
92+ $ service = new Service ($ client );
93+ $ url = $ service ->createBaseUrl ("https://checkout-test.adyen.com/checkout/possdk/v68 " );
94+ // check prefix is ignored on TEST
95+ self ::assertEquals (
96+ "https://checkout-test.adyen.com/checkout/possdk/v68 " ,
97+ $ url
98+ );
99+ }
60100}
0 commit comments