@kushki/js 1.36.0 → 1.37.0
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/Kushki.d.ts +17 -2
- package/lib/Kushki.js +132 -113
- package/lib/KushkiInfo.js +11 -14
- package/lib/constant/CreditCardEspecifications.js +2 -2
- package/lib/constant/Identifiers.js +21 -21
- package/lib/gateway/KushkiGateway.js +161 -276
- package/lib/gateway/SiftScience.js +42 -45
- package/lib/generic/AurusError.js +12 -28
- package/lib/generic/KushkiError.js +15 -33
- package/lib/infrastructure/BinCardTypeEnum.js +1 -1
- package/lib/infrastructure/CardBrandsEnum.d.ts +5 -0
- package/lib/infrastructure/CardBrandsEnum.js +8 -0
- package/lib/infrastructure/CognitoErrorEnum.js +1 -1
- package/lib/infrastructure/Container.js +41 -75
- package/lib/infrastructure/EnvironmentEnum.js +1 -1
- package/lib/infrastructure/ErrorEnum.d.ts +2 -1
- package/lib/infrastructure/ErrorEnum.js +42 -37
- package/lib/infrastructure/HeadersEnum.js +1 -1
- package/lib/infrastructure/KPayUserPoolEnum.js +1 -1
- package/lib/infrastructure/KpayPaymentKind.js +1 -1
- package/lib/infrastructure/PathEnum.js +1 -1
- package/lib/infrastructure/PlatformCodeEnum.js +15 -15
- package/lib/infrastructure/SiftScienceEnum.js +1 -1
- package/lib/infrastructure/StatusCodeEnum.js +1 -1
- package/lib/infrastructure/ThreeDSEnum.js +1 -1
- package/lib/infrastructure/VisaBrandingResourceUrlEnum.d.ts +2 -2
- package/lib/infrastructure/VisaBrandingResourceUrlEnum.js +3 -3
- package/lib/lib.js +1 -1
- package/lib/libs/MCSensoryBranding/mastercard-sensory-branding.d.ts +21 -0
- package/lib/libs/MCSensoryBranding/mastercard-sensory-branding.js +781 -0
- package/lib/libs/VisaSensoryBranding/visa-sensory-branding.d.ts +1 -1
- package/lib/libs/VisaSensoryBranding/visa-sensory-branding.js +630 -158
- package/lib/libs/cardinal/prod.js +10 -10
- package/lib/libs/cardinal/staging.js +9 -9
- package/lib/repository/IAntiFraud.js +1 -1
- package/lib/repository/IAuthService.js +1 -1
- package/lib/repository/ICardAsyncService.js +1 -1
- package/lib/repository/ICardDynamicService.js +1 -1
- package/lib/repository/ICardService.js +1 -1
- package/lib/repository/ICardSubscriptionDynamicService.js +1 -1
- package/lib/repository/ICashService.js +1 -1
- package/lib/repository/ICommissionService.js +1 -1
- package/lib/repository/IKPayService.js +1 -1
- package/lib/repository/IKushkiGateway.js +1 -1
- package/lib/repository/IKushkiService.d.ts +9 -2
- package/lib/repository/IKushkiService.js +1 -1
- package/lib/repository/IMobileProcessorService.js +1 -1
- package/lib/repository/IMultiMerchantService.js +1 -1
- package/lib/repository/IPayoutsCashService.js +1 -1
- package/lib/repository/IPayoutsTransferService.js +1 -1
- package/lib/repository/ISecureService.js +1 -1
- package/lib/repository/ISiftScienceService.js +1 -1
- package/lib/repository/ITransferService.js +1 -1
- package/lib/repository/ITransferSubscriptionService.js +1 -1
- package/lib/service/AuthService.js +99 -161
- package/lib/service/CardAsyncService.js +19 -26
- package/lib/service/CardDynamicService.js +32 -43
- package/lib/service/CardService.js +271 -382
- package/lib/service/CardSubscriptionDynamicService.js +31 -40
- package/lib/service/CashService.js +15 -16
- package/lib/service/CommissionService.js +13 -14
- package/lib/service/KPayService.js +19 -23
- package/lib/service/KushkiService.d.ts +2 -1
- package/lib/service/KushkiService.js +48 -33
- package/lib/service/MobileProcessorService.js +59 -70
- package/lib/service/MultiMerchantService.js +13 -14
- package/lib/service/PayoutsCashService.js +15 -16
- package/lib/service/PayoutsTransferService.js +17 -18
- package/lib/service/SecureService.js +13 -14
- package/lib/service/SiftScienceService.js +16 -20
- package/lib/service/TransferService.js +21 -36
- package/lib/service/TransferSubscriptionsService.js +16 -17
- package/lib/service/UtilsService.js +51 -57
- package/lib/types/card_branding_request.d.ts +40 -0
- package/lib/types/visa_branding_request.d.ts +25 -3
- package/package.json +2 -2
|
@@ -11,35 +11,34 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
exports
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.PayoutsTransferService = void 0;
|
|
16
16
|
/**
|
|
17
17
|
* Payouts Transfer Service file
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const Identifiers_1 = require("./../../lib/constant/Identifiers");
|
|
20
|
+
const KushkiGateway_1 = require("./../../lib/gateway/KushkiGateway");
|
|
21
|
+
const inversify_1 = require("inversify");
|
|
22
22
|
require("reflect-metadata");
|
|
23
23
|
/**
|
|
24
24
|
* Implementation
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
let PayoutsTransferService = class PayoutsTransferService {
|
|
27
|
+
constructor(antiFraud, gateway) {
|
|
28
28
|
this._kushkiGateway = gateway;
|
|
29
29
|
this._antiFraud = antiFraud;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
requestPayoutsTransferToken(body, mid, isTest, regional) {
|
|
32
32
|
return this._kushkiGateway.requestPayoutsTransferToken(body, mid, isTest, regional);
|
|
33
|
-
}
|
|
34
|
-
|
|
33
|
+
}
|
|
34
|
+
requestPayoutsTransferBankList(mid, isTest, regional) {
|
|
35
35
|
return this._kushkiGateway.requestPayoutsTransferBankList(mid, isTest, regional);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}());
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
PayoutsTransferService = __decorate([
|
|
39
|
+
inversify_1.injectable(),
|
|
40
|
+
__param(0, inversify_1.inject(Identifiers_1.IDENTIFIERS.AntiFraud)),
|
|
41
|
+
__param(1, inversify_1.inject(Identifiers_1.IDENTIFIERS.KushkiGateway)),
|
|
42
|
+
__metadata("design:paramtypes", [Object, KushkiGateway_1.KushkiGateway])
|
|
43
|
+
], PayoutsTransferService);
|
|
45
44
|
exports.PayoutsTransferService = PayoutsTransferService;
|
|
@@ -11,25 +11,24 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
exports
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.SecureService = void 0;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const Identifiers_1 = require("./../../lib/constant/Identifiers");
|
|
17
|
+
const inversify_1 = require("inversify");
|
|
18
18
|
/**
|
|
19
19
|
* SecureService implementation.
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
let SecureService = class SecureService {
|
|
22
|
+
constructor(gateway) {
|
|
23
23
|
this._gateway = gateway;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
requestSecureServiceValidation(mid, request, isTest, regional) {
|
|
26
26
|
return this._gateway.requestSecureServiceValidation(mid, request, isTest, regional);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}());
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
SecureService = __decorate([
|
|
30
|
+
inversify_1.injectable(),
|
|
31
|
+
__param(0, inversify_1.inject(Identifiers_1.IDENTIFIERS.KushkiGateway)),
|
|
32
|
+
__metadata("design:paramtypes", [Object])
|
|
33
|
+
], SecureService);
|
|
35
34
|
exports.SecureService = SecureService;
|
|
@@ -11,37 +11,33 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
exports
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.SiftScienceService = void 0;
|
|
16
16
|
/**
|
|
17
17
|
* SiftScience Service file
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const Identifiers_1 = require("./../../lib/constant/Identifiers");
|
|
20
|
+
const inversify_1 = require("inversify");
|
|
21
21
|
require("reflect-metadata");
|
|
22
|
-
|
|
22
|
+
const operators_1 = require("rxjs/operators");
|
|
23
23
|
/**
|
|
24
24
|
* Implementation
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
let SiftScienceService = class SiftScienceService {
|
|
27
|
+
constructor(gateway, antiFraud) {
|
|
28
28
|
this._gateway = gateway;
|
|
29
29
|
this._antiFraud = antiFraud;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
var _this = this;
|
|
31
|
+
requestInitAntiFraud(userId, mid, isTest, regional) {
|
|
33
32
|
return this._gateway
|
|
34
33
|
.requestMerchantSettings(mid, isTest, regional)
|
|
35
|
-
.pipe(operators_1.switchMap(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
], SiftScienceService);
|
|
45
|
-
return SiftScienceService;
|
|
46
|
-
}());
|
|
34
|
+
.pipe(operators_1.switchMap((merchant) => this._antiFraud.createSiftScienceAntiFraudSession(userId, mid, isTest, merchant)));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
SiftScienceService = __decorate([
|
|
38
|
+
inversify_1.injectable(),
|
|
39
|
+
__param(0, inversify_1.inject(Identifiers_1.IDENTIFIERS.KushkiGateway)),
|
|
40
|
+
__param(1, inversify_1.inject(Identifiers_1.IDENTIFIERS.AntiFraud)),
|
|
41
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
42
|
+
], SiftScienceService);
|
|
47
43
|
exports.SiftScienceService = SiftScienceService;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
14
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -22,43 +11,39 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
22
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
23
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
24
13
|
};
|
|
25
|
-
exports
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
15
|
exports.TransferService = void 0;
|
|
27
16
|
/**
|
|
28
17
|
* Transfer Service file
|
|
29
18
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
const Identifiers_1 = require("./../../lib/constant/Identifiers");
|
|
20
|
+
const inversify_1 = require("inversify");
|
|
32
21
|
require("reflect-metadata");
|
|
33
|
-
|
|
22
|
+
const operators_1 = require("rxjs/operators");
|
|
34
23
|
/**
|
|
35
24
|
* Implementation
|
|
36
25
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
let TransferService = class TransferService {
|
|
27
|
+
constructor(gateway, antiFraud) {
|
|
39
28
|
this._gateway = gateway;
|
|
40
29
|
this._antiFraud = antiFraud;
|
|
41
30
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var client = request.documentNumber !== undefined
|
|
31
|
+
requestTransferToken(request, mid, isTest, regional) {
|
|
32
|
+
return this._gateway.requestMerchantSettings(mid, isTest, regional).pipe(operators_1.switchMap((merchant) => {
|
|
33
|
+
const client = request.documentNumber !== undefined
|
|
46
34
|
? request.documentNumber
|
|
47
35
|
: new Date().getTime().toString();
|
|
48
|
-
return
|
|
49
|
-
}), operators_1.switchMap(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
TransferService.prototype.requestBankList = function (mid, isTest, regional) {
|
|
36
|
+
return this._antiFraud.createSiftScienceSession(request.bankId, client, mid, isTest, merchant);
|
|
37
|
+
}), operators_1.switchMap((siftObject) => this._gateway.requestTransferToken(Object.assign(Object.assign({}, request), siftObject), mid, isTest, regional)));
|
|
38
|
+
}
|
|
39
|
+
requestBankList(mid, isTest, regional) {
|
|
54
40
|
return this._gateway.requestPseBankList(mid, isTest, regional);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}());
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
TransferService = __decorate([
|
|
44
|
+
inversify_1.injectable(),
|
|
45
|
+
__param(0, inversify_1.inject(Identifiers_1.IDENTIFIERS.KushkiGateway)),
|
|
46
|
+
__param(1, inversify_1.inject(Identifiers_1.IDENTIFIERS.AntiFraud)),
|
|
47
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
48
|
+
], TransferService);
|
|
64
49
|
exports.TransferService = TransferService;
|
|
@@ -11,27 +11,26 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
exports
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.TransferSubscriptionsService = void 0;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const Identifiers_1 = require("./../../lib/constant/Identifiers");
|
|
17
|
+
const inversify_1 = require("inversify");
|
|
18
|
+
let TransferSubscriptionsService = class TransferSubscriptionsService {
|
|
19
|
+
constructor(antiFraud, gateway) {
|
|
20
20
|
this._antiFraud = antiFraud;
|
|
21
21
|
this._gateway = gateway;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
requestToken(tokenRequest, mid, isTest, regional) {
|
|
24
24
|
return this._gateway.requestTokenTransferSubscription(tokenRequest, mid, isTest, regional);
|
|
25
|
-
}
|
|
26
|
-
|
|
25
|
+
}
|
|
26
|
+
requestBankList(mid, isTest, regional) {
|
|
27
27
|
return this._gateway.requestBankList(mid, isTest, regional);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}());
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
TransferSubscriptionsService = __decorate([
|
|
31
|
+
inversify_1.injectable(),
|
|
32
|
+
__param(0, inversify_1.inject(Identifiers_1.IDENTIFIERS.AntiFraud)),
|
|
33
|
+
__param(1, inversify_1.inject(Identifiers_1.IDENTIFIERS.KushkiGateway)),
|
|
34
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
35
|
+
], TransferSubscriptionsService);
|
|
37
36
|
exports.TransferSubscriptionsService = TransferSubscriptionsService;
|
|
@@ -1,71 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBinFromCreditCardNumberSift = exports.getBinFromCreditCardNumber = exports.UtilsService = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* UtilsService Class
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Lodash native methods implementation: https://youmightnotneed.com/lodash/
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Gets the value at path of object. Note: If provided path does not exists inside the object js will generate error.
|
|
16
|
-
* @param obj
|
|
17
|
-
* @param path
|
|
18
|
-
* @param defValue
|
|
19
|
-
*/
|
|
20
|
-
// tslint:disable-next-line:no-any
|
|
21
|
-
UtilsService.sGet = function (obj, path, defValue) {
|
|
22
|
-
if (defValue === void 0) { defValue = undefined; }
|
|
23
|
-
// If path is not defined or it has false value
|
|
24
|
-
if (!path)
|
|
25
|
-
return;
|
|
26
|
-
// Check if path is string or array. Regex : ensure that we do not have '.' and brackets.
|
|
27
|
-
// Regex explained: https://regexr.com/58j0k
|
|
28
|
-
var path_array = Array.isArray(path) ? path : path.match(/([^[.\]])+/g);
|
|
29
|
-
// Find value if exist return otherwise return undefined value;
|
|
30
|
-
return (path_array.reduce(function (prevObj, key) { return prevObj && prevObj[key]; }, obj) ||
|
|
31
|
-
defValue);
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Sets the value at path of object. If a portion of path doesn't exist, it's created. Arrays are created for missing index properties while objects are created for all other missing properties.
|
|
35
|
-
* @param obj
|
|
36
|
-
* @param path
|
|
37
|
-
* @param value
|
|
38
|
-
*/
|
|
39
|
-
UtilsService.sSet = function (obj, path, value) {
|
|
40
|
-
// Regex explained: https://regexr.com/58j0k
|
|
41
|
-
var path_array = Array.isArray(path) ? path : path.match(/([^[.\]])+/g);
|
|
42
|
-
path_array.reduce(function (acc, key, i) {
|
|
43
|
-
if (acc[key] === undefined)
|
|
44
|
-
acc[key] = {};
|
|
45
|
-
if (i === path_array.length - 1)
|
|
46
|
-
acc[key] = value;
|
|
47
|
-
return acc[key];
|
|
48
|
-
}, obj);
|
|
49
|
-
return obj;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Checks if value is an empty object or collection.
|
|
53
|
-
* @param obj
|
|
54
|
-
*/
|
|
55
|
-
UtilsService.sIsEmpty = function (obj) {
|
|
56
|
-
return [Object, Array].includes((obj || {}).constructor) &&
|
|
57
|
-
!Object.entries(obj || {}).length;
|
|
58
|
-
};
|
|
59
|
-
return UtilsService;
|
|
60
|
-
}());
|
|
7
|
+
const CreditCardEspecifications_1 = require("./../../lib/constant/CreditCardEspecifications");
|
|
8
|
+
class UtilsService {
|
|
9
|
+
}
|
|
61
10
|
exports.UtilsService = UtilsService;
|
|
11
|
+
/**
|
|
12
|
+
* Lodash native methods implementation: https://youmightnotneed.com/lodash/
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Gets the value at path of object. Note: If provided path does not exists inside the object js will generate error.
|
|
16
|
+
* @param obj
|
|
17
|
+
* @param path
|
|
18
|
+
* @param defValue
|
|
19
|
+
*/
|
|
20
|
+
// tslint:disable-next-line:no-any
|
|
21
|
+
UtilsService.sGet = (obj, path, defValue = undefined) => {
|
|
22
|
+
// If path is not defined or it has false value
|
|
23
|
+
if (!path)
|
|
24
|
+
return;
|
|
25
|
+
// Check if path is string or array. Regex : ensure that we do not have '.' and brackets.
|
|
26
|
+
// Regex explained: https://regexr.com/58j0k
|
|
27
|
+
const path_array = Array.isArray(path) ? path : path.match(/([^[.\]])+/g);
|
|
28
|
+
// Find value if exist return otherwise return undefined value;
|
|
29
|
+
return (path_array.reduce((prevObj, key) => prevObj && prevObj[key], obj) ||
|
|
30
|
+
defValue);
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Sets the value at path of object. If a portion of path doesn't exist, it's created. Arrays are created for missing index properties while objects are created for all other missing properties.
|
|
34
|
+
* @param obj
|
|
35
|
+
* @param path
|
|
36
|
+
* @param value
|
|
37
|
+
*/
|
|
38
|
+
UtilsService.sSet = (obj, path, value) => {
|
|
39
|
+
// Regex explained: https://regexr.com/58j0k
|
|
40
|
+
const path_array = Array.isArray(path) ? path : path.match(/([^[.\]])+/g);
|
|
41
|
+
path_array.reduce((acc, key, i) => {
|
|
42
|
+
if (acc[key] === undefined)
|
|
43
|
+
acc[key] = {};
|
|
44
|
+
if (i === path_array.length - 1)
|
|
45
|
+
acc[key] = value;
|
|
46
|
+
return acc[key];
|
|
47
|
+
}, obj);
|
|
48
|
+
return obj;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Checks if value is an empty object or collection.
|
|
52
|
+
* @param obj
|
|
53
|
+
*/
|
|
54
|
+
UtilsService.sIsEmpty = obj => [Object, Array].includes((obj || {}).constructor) &&
|
|
55
|
+
!Object.entries(obj || {}).length;
|
|
62
56
|
function getBinFromCreditCardNumber(value) {
|
|
63
|
-
|
|
57
|
+
const card_value = value.replace(/\D/g, "");
|
|
64
58
|
return card_value.slice(CreditCardEspecifications_1.CREDIT_CARD_ESPECIFICATIONS.cardInitialBinPlace, CreditCardEspecifications_1.CREDIT_CARD_ESPECIFICATIONS.cardFinalBinPlace);
|
|
65
59
|
}
|
|
66
60
|
exports.getBinFromCreditCardNumber = getBinFromCreditCardNumber;
|
|
67
61
|
function getBinFromCreditCardNumberSift(value) {
|
|
68
|
-
|
|
62
|
+
const card_value = value.replace(/\D/g, "");
|
|
69
63
|
return card_value.slice(CreditCardEspecifications_1.CREDIT_CARD_ESPECIFICATIONS.cardInitialBinPlace, CreditCardEspecifications_1.CREDIT_CARD_ESPECIFICATIONS.cardFinalBinPlaceSift);
|
|
70
64
|
}
|
|
71
65
|
exports.getBinFromCreditCardNumberSift = getBinFromCreditCardNumberSift;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* tslint:disable:all */
|
|
2
|
+
/* tslint:disable:all */
|
|
3
|
+
|
|
4
|
+
export type CardBrandingRequest = VisaBrandingRequest | MasterCardBrandingRequest;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Visa animation properties
|
|
8
|
+
*/
|
|
9
|
+
export interface VisaBrandingRequest {
|
|
10
|
+
brand: "visa";
|
|
11
|
+
/**
|
|
12
|
+
* ("white" | "blue" | "blur") [default = "white"] The background of animation.
|
|
13
|
+
*/
|
|
14
|
+
color?: "white" | "blue" | "blur";
|
|
15
|
+
/**
|
|
16
|
+
* (boolean) [default= false] The container visualization.
|
|
17
|
+
*/
|
|
18
|
+
constrained?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* (boolean) [default = false] The activation of the sound.
|
|
21
|
+
*/
|
|
22
|
+
sound?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* ("none" | "checkmark" | "checkmarkWithText") [default = "none"] The visualization of checkmark.
|
|
25
|
+
*/
|
|
26
|
+
checkmark?: "none" | "checkmark" | "checkmarkWithText";
|
|
27
|
+
/**
|
|
28
|
+
* ("approved" | "success" | "complete") [default = "approved"] The text to appear if checkmarkWithText is enabled.
|
|
29
|
+
*/
|
|
30
|
+
checkmarkTextOption?: "approved" | "success" | "complete";
|
|
31
|
+
/**
|
|
32
|
+
* ("es" | "en" | "pt_br") [default = "es"] The language of the checkmark text.
|
|
33
|
+
*/
|
|
34
|
+
languageCode?: "es" | "en" | "pt_br";
|
|
35
|
+
}
|
|
36
|
+
export interface MasterCardBrandingRequest {
|
|
37
|
+
brand: "mastercard";
|
|
38
|
+
type?: "default" | "animation-only" | "sound-only";
|
|
39
|
+
clearBackground?: boolean;
|
|
40
|
+
}
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
/* tslint:disable:all */
|
|
2
2
|
/* tslint:disable:all */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Visa animation properties
|
|
6
|
+
*/
|
|
4
7
|
export interface VisaBrandingRequest {
|
|
5
|
-
|
|
8
|
+
/**
|
|
9
|
+
* ("white" | "blue" | "blur" | "transparent") [default = "white"] The background of animation.
|
|
10
|
+
*/
|
|
11
|
+
color?: "white" | "blue" | "blur" | "transparent";
|
|
12
|
+
/**
|
|
13
|
+
* (boolean) [default= false] The container visualization.
|
|
14
|
+
*/
|
|
6
15
|
constrained?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* (boolean) [default = false] The activation of the sound.
|
|
18
|
+
*/
|
|
7
19
|
sound?: boolean;
|
|
8
|
-
|
|
9
|
-
|
|
20
|
+
/**
|
|
21
|
+
* ("none" | "checkmark" | "checkmarkWithText") [default = "none"] The visualization of checkmark.
|
|
22
|
+
*/
|
|
23
|
+
checkmark?: "none" | "checkmark" | "checkmarkWithText";
|
|
24
|
+
/**
|
|
25
|
+
* ("approved" | "success" | "complete") [default = "approved"] The text to appear if checkmarkWithText is enabled.
|
|
26
|
+
*/
|
|
27
|
+
checkmarkTextOption?: "approved" | "success" | "complete";
|
|
28
|
+
/**
|
|
29
|
+
* ("es" | "en" | "pt_br") [default = "es"] The language of the checkmark text.
|
|
30
|
+
*/
|
|
31
|
+
languageCode?: "es" | "en" | "pt_br";
|
|
10
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kushki/js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
4
4
|
"description": "kushki-js",
|
|
5
5
|
"main": "lib/lib.js",
|
|
6
6
|
"types": "lib/lib.d.ts",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"gulp-typescript": "5.0.1 ",
|
|
67
67
|
"husky": "2.1.0",
|
|
68
68
|
"jscpd": "2.0.15",
|
|
69
|
-
"jsdom": "
|
|
69
|
+
"jsdom": "16.6.0",
|
|
70
70
|
"jsdom-global": "3.0.2",
|
|
71
71
|
"json-schema-faker": "0.5.0-rc7",
|
|
72
72
|
"lint-staged": "8.1.5",
|