@tap-payments/auth-jsconnect 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/utils/common.js +3 -3
- package/package.json +1 -1
package/build/utils/common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { axiosInstance } from '../api';
|
|
2
|
-
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL,
|
|
2
|
+
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
|
|
3
3
|
export var sleep = function (milliseconds) {
|
|
4
4
|
if (milliseconds === void 0) { milliseconds = 1000; }
|
|
5
5
|
return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
|
|
@@ -13,7 +13,7 @@ export var dangerousMessage = function (message, callBack) {
|
|
|
13
13
|
export var setBaseUrl = function (publicKey) {
|
|
14
14
|
var isProd = publicKey.includes('pk_live');
|
|
15
15
|
if (isProd) {
|
|
16
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
16
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
@@ -35,7 +35,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
|
35
35
|
window.history.replaceState({}, '', newUrl);
|
|
36
36
|
};
|
|
37
37
|
export var openConnect = function (pk, countryCode) {
|
|
38
|
-
var newUrl = new URL(pk.includes('pk_live') ?
|
|
38
|
+
var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_SANDBOX_URL);
|
|
39
39
|
if (countryCode) {
|
|
40
40
|
newUrl.pathname = "/".concat(countryCode.toLowerCase());
|
|
41
41
|
}
|