@kushki/js 1.41.0-alpha → 1.41.0-alpha-34148.1
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/lib/KushkiInfo.js
CHANGED
|
@@ -12,7 +12,7 @@ const UtilsService_1 = require("./../lib/service/UtilsService");
|
|
|
12
12
|
*/
|
|
13
13
|
class KInfo {
|
|
14
14
|
static buildKushkiInfo(kushkiInfo) {
|
|
15
|
-
const kushki_js_version = "1.41.0-alpha";
|
|
15
|
+
const kushki_js_version = "1.41.0-alpha-34148.1";
|
|
16
16
|
if (kushkiInfo) {
|
|
17
17
|
if (UtilsService_1.UtilsService.sIsEmpty(kushkiInfo.platformVersion))
|
|
18
18
|
kushkiInfo.platformVersion = kushki_js_version;
|
|
@@ -34,6 +34,14 @@ import { TokenChargeRequest } from "./../../lib/types/token_charge_request";
|
|
|
34
34
|
import { TransferSubscriptionTokenRequest } from "./../../lib/types/transfer_subscription_token_request";
|
|
35
35
|
import { TransferTokenRequest } from "./../../lib/types/transfer_token_request";
|
|
36
36
|
import { Validate3DsResponse } from "./../../lib/types/validate_3ds_response";
|
|
37
|
+
/**
|
|
38
|
+
* TEMPORARY (CAR-17885): routes transfer token and transfer config requests to
|
|
39
|
+
* the transfer dev environment while multi-processor is under test.
|
|
40
|
+
* Applies only when testEnv is true and regional is false.
|
|
41
|
+
* Remove this constant, the `uatDomainOverride` parameter and the related
|
|
42
|
+
* TEMPORARY tests before releasing.
|
|
43
|
+
*/
|
|
44
|
+
export declare const TEMP_TRANSFER_UAT_DOMAIN: string;
|
|
37
45
|
/**
|
|
38
46
|
* Kushki Gateway Implementation
|
|
39
47
|
*/
|
|
@@ -47,8 +55,8 @@ export declare class KushkiGateway implements IKushkiGateway {
|
|
|
47
55
|
private _uatUrl;
|
|
48
56
|
private _prodUrl;
|
|
49
57
|
private _kshAuthorization;
|
|
50
|
-
request<T = object>(body: object, headers: object, path: string, testEnv: boolean, regional: boolean): Observable<T>;
|
|
51
|
-
requestGet<T extends object = object>(path: string, testEnv: boolean, regional: boolean, mid?: string): Observable<T>;
|
|
58
|
+
request<T = object>(body: object, headers: object, path: string, testEnv: boolean, regional: boolean, uatDomainOverride?: string): Observable<T>;
|
|
59
|
+
requestGet<T extends object = object>(path: string, testEnv: boolean, regional: boolean, mid?: string, uatDomainOverride?: string): Observable<T>;
|
|
52
60
|
requestBrandsByMerchant(mid: string, testEnv: boolean, regional: boolean): Observable<string[]>;
|
|
53
61
|
requestBrandsLogosByMerchant(mid: string, testEnv: boolean, regional: boolean): Observable<GetBrandsLogosByMerchantResponse[]>;
|
|
54
62
|
requestTransferConfig(mid: string, testEnv: boolean, regional: boolean, paymentType?: TransferPaymentTypeEnum): Observable<GetTransferConfigResponse>;
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
var KushkiGateway_1;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.KushkiGateway = void 0;
|
|
10
|
+
exports.KushkiGateway = exports.TEMP_TRANSFER_UAT_DOMAIN = void 0;
|
|
11
11
|
/**
|
|
12
12
|
* Kushki Gateway File
|
|
13
13
|
*/
|
|
@@ -21,6 +21,14 @@ const rxjs_1 = require("rxjs");
|
|
|
21
21
|
const operators_1 = require("rxjs/operators");
|
|
22
22
|
const UtilsService_1 = require("./../../lib/service/UtilsService");
|
|
23
23
|
const KushkiInfo_1 = require("./../../lib/KushkiInfo");
|
|
24
|
+
/**
|
|
25
|
+
* TEMPORARY (CAR-17885): routes transfer token and transfer config requests to
|
|
26
|
+
* the transfer dev environment while multi-processor is under test.
|
|
27
|
+
* Applies only when testEnv is true and regional is false.
|
|
28
|
+
* Remove this constant, the `uatDomainOverride` parameter and the related
|
|
29
|
+
* TEMPORARY tests before releasing.
|
|
30
|
+
*/
|
|
31
|
+
exports.TEMP_TRANSFER_UAT_DOMAIN = "https://transfer-dev-01-us-east-1.kushki.dev/";
|
|
24
32
|
/**
|
|
25
33
|
* Kushki Gateway Implementation
|
|
26
34
|
*/
|
|
@@ -38,8 +46,8 @@ let KushkiGateway = KushkiGateway_1 = class KushkiGateway {
|
|
|
38
46
|
static _aurusError(data) {
|
|
39
47
|
return data.hasOwnProperty("response_code");
|
|
40
48
|
}
|
|
41
|
-
request(body, headers, path, testEnv, regional) {
|
|
42
|
-
return rxjs_1.of(this._assignChannel(regional, path)).pipe(operators_1.switchMap(() => axios_1.default.post(`${testEnv ? this._uatUrl : this._prodUrl}`, body, {
|
|
49
|
+
request(body, headers, path, testEnv, regional, uatDomainOverride) {
|
|
50
|
+
return rxjs_1.of(this._assignChannel(regional, path, uatDomainOverride)).pipe(operators_1.switchMap(() => axios_1.default.post(`${testEnv ? this._uatUrl : this._prodUrl}`, body, {
|
|
43
51
|
headers: Object.assign(Object.assign({}, headers), { [this._contentHeader]: this._contentJSON }),
|
|
44
52
|
})), operators_1.map((response) => response.data), operators_1.catchError((err) => {
|
|
45
53
|
if (KushkiGateway_1._aurusError(UtilsService_1.UtilsService.sGet(err, "response.data", {})))
|
|
@@ -47,8 +55,8 @@ let KushkiGateway = KushkiGateway_1 = class KushkiGateway {
|
|
|
47
55
|
return rxjs_1.throwError(err);
|
|
48
56
|
}));
|
|
49
57
|
}
|
|
50
|
-
requestGet(path, testEnv, regional, mid) {
|
|
51
|
-
return rxjs_1.of(this._assignChannel(regional, path)).pipe(operators_1.switchMap(() => axios_1.default.get(`${testEnv ? this._uatUrl : this._prodUrl}`, {
|
|
58
|
+
requestGet(path, testEnv, regional, mid, uatDomainOverride) {
|
|
59
|
+
return rxjs_1.of(this._assignChannel(regional, path, uatDomainOverride)).pipe(operators_1.switchMap(() => axios_1.default.get(`${testEnv ? this._uatUrl : this._prodUrl}`, {
|
|
52
60
|
headers: {
|
|
53
61
|
[this._publicHeader]: mid || "",
|
|
54
62
|
[this._contentHeader]: this._contentJSON,
|
|
@@ -62,7 +70,7 @@ let KushkiGateway = KushkiGateway_1 = class KushkiGateway {
|
|
|
62
70
|
return this.requestGet(`${PathEnum_1.PathEnum.brands_logos_by_merchant}`, testEnv, regional, mid);
|
|
63
71
|
}
|
|
64
72
|
requestTransferConfig(mid, testEnv, regional, paymentType) {
|
|
65
|
-
return this.requestGet(this._buildTransferConfigPath(paymentType), testEnv, regional, mid);
|
|
73
|
+
return this.requestGet(this._buildTransferConfigPath(paymentType), testEnv, regional, mid, exports.TEMP_TRANSFER_UAT_DOMAIN);
|
|
66
74
|
}
|
|
67
75
|
requestToken(body, mid, testEnv, regional) {
|
|
68
76
|
return this.request(body, {
|
|
@@ -80,7 +88,7 @@ let KushkiGateway = KushkiGateway_1 = class KushkiGateway {
|
|
|
80
88
|
}, PathEnum_1.PathEnum.card_subscription_tokens, testEnv, regional);
|
|
81
89
|
}
|
|
82
90
|
requestTransferToken(body, mid, testEnv, regional) {
|
|
83
|
-
return rxjs_1.of(1).pipe(operators_1.concatMap(() => this.request(body, Object.assign(Object.assign({}, this._buildHeader(mid)), { [this._kushkiInfoHeader]: KushkiInfo_1.KInfo.sKushkiInfo }), PathEnum_1.PathEnum.transfer_tokens, testEnv, regional)));
|
|
91
|
+
return rxjs_1.of(1).pipe(operators_1.concatMap(() => this.request(body, Object.assign(Object.assign({}, this._buildHeader(mid)), { [this._kushkiInfoHeader]: KushkiInfo_1.KInfo.sKushkiInfo }), PathEnum_1.PathEnum.transfer_tokens, testEnv, regional, exports.TEMP_TRANSFER_UAT_DOMAIN)));
|
|
84
92
|
}
|
|
85
93
|
requestMerchantSettings(mid, testEnv, regional) {
|
|
86
94
|
return rxjs_1.of(1).pipe(operators_1.concatMap(() => this.requestGet(`${PathEnum_1.PathEnum.merchant_settings}settings`, testEnv, regional, mid)), operators_1.map((response) => response));
|
|
@@ -170,9 +178,10 @@ let KushkiGateway = KushkiGateway_1 = class KushkiGateway {
|
|
|
170
178
|
path += `?${params.join("&")}`;
|
|
171
179
|
return path;
|
|
172
180
|
}
|
|
173
|
-
_assignChannel(regional, path)
|
|
181
|
+
_assignChannel(regional, path, uatDomainOverride // TEMPORARY (CAR-17885), see TEMP_TRANSFER_UAT_DOMAIN
|
|
182
|
+
) {
|
|
174
183
|
if (!regional) {
|
|
175
|
-
this._uatUrl = `${EnvironmentEnum_1.EnvironmentEnum.uat}${path}`;
|
|
184
|
+
this._uatUrl = `${uatDomainOverride ? uatDomainOverride : EnvironmentEnum_1.EnvironmentEnum.uat}${path}`;
|
|
176
185
|
this._prodUrl = `${EnvironmentEnum_1.EnvironmentEnum.prod}${path}`;
|
|
177
186
|
}
|
|
178
187
|
else {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Environment enum file
|
|
4
4
|
*/
|
|
5
5
|
export declare enum EnvironmentEnum {
|
|
6
|
-
uat = "https://api-
|
|
6
|
+
uat = "https://api-qa.orizaba.kushki.dev/",
|
|
7
7
|
prod = "https://api.kushkipagos.com/",
|
|
8
8
|
regionalUat = "https://regional-uat.kushkipagos.com/",
|
|
9
9
|
regionalProd = "https://regional.kushkipagos.com/"
|
|
@@ -6,7 +6,7 @@ exports.EnvironmentEnum = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
var EnvironmentEnum;
|
|
8
8
|
(function (EnvironmentEnum) {
|
|
9
|
-
EnvironmentEnum["uat"] = "https://api-
|
|
9
|
+
EnvironmentEnum["uat"] = "https://api-qa.orizaba.kushki.dev/";
|
|
10
10
|
EnvironmentEnum["prod"] = "https://api.kushkipagos.com/";
|
|
11
11
|
EnvironmentEnum["regionalUat"] = "https://regional-uat.kushkipagos.com/";
|
|
12
12
|
EnvironmentEnum["regionalProd"] = "https://regional.kushkipagos.com/";
|