File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class MindboxClientV3 extends AbstractMindboxClient
2424 */
2525 const BASE_V3_URL = 'https://api.mindbox.{{domainZone}}/v3/operations/ ' ;
2626
27+ const TMP_V3_URL = 'https://api-ru.mindbox.cloud/v3/operations/ ' ;
2728 /**
2829 * Секретный ключ.
2930 */
@@ -96,7 +97,10 @@ private function getCustomerIP()
9697 */
9798 protected function prepareUrl ($ url , array $ queryParams , $ isSync = true )
9899 {
99- $ domain = str_replace ('{{domainZone}} ' , $ this ->domainZone , static ::BASE_V3_URL );
100+ $ domain = $ this ->getApiUrl ();
101+
102+ $ domain = str_replace ('{{domainZone}} ' , $ this ->domainZone , $ domain );
103+
100104 return $ domain . ($ isSync ? 'sync ' : 'async ' ) . '? ' . http_build_query ($ queryParams );
101105 }
102106
@@ -165,4 +169,21 @@ protected function prepareResponseBody($rawBody)
165169 {
166170 return $ rawBody ? json_decode ($ rawBody , true ) : [];
167171 }
172+
173+ /**
174+ * Временное решение для старых хостингов
175+ *
176+ * @return string
177+ */
178+ protected function getApiUrl ()
179+ {
180+ $ return = self :: BASE_V3_URL ;
181+ switch ($ this ->domainZone ) {
182+ case 'api-ru ' :
183+ $ return = self ::TMP_V3_URL ;
184+ break ;
185+ }
186+
187+ return $ return ;
188+ }
168189}
You can’t perform that action at this time.
0 commit comments