@kushki/js 1.36.0-alpha-3ds.1 → 1.36.0-alpha.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/Card.d.ts +19 -0
- package/lib/Card.js +23 -0
- package/lib/KushkiInfo.js +1 -1
- package/lib/infrastructure/CardContainer.d.ts +4 -0
- package/lib/infrastructure/CardContainer.js +21 -0
- package/lib/lib.d.ts +1 -1
- package/lib/lib.js +1 -1
- package/lib/service/CardService.js +1 -1
- package/package.json +3 -3
package/lib/Card.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* tslint:disable:all */
|
|
2
|
+
import { ErrorResponse } from "./../lib/types/error_response";
|
|
3
|
+
import { KushkiInfo } from "./../lib/types/kushki_info";
|
|
4
|
+
import { TokenResponse } from "./../lib/types/remote/token_response";
|
|
5
|
+
import { TokenKPayRequest } from "./../lib/types/token_kpay_request";
|
|
6
|
+
import { TokenRequest } from "./../lib/types/token_request";
|
|
7
|
+
export declare class Card {
|
|
8
|
+
private readonly _merchantId;
|
|
9
|
+
private readonly _inTestEnvironment;
|
|
10
|
+
private readonly _cardService;
|
|
11
|
+
private readonly _regional;
|
|
12
|
+
constructor(body: {
|
|
13
|
+
merchantId: string;
|
|
14
|
+
inTestEnvironment?: boolean;
|
|
15
|
+
regional?: boolean;
|
|
16
|
+
kushkiInfo?: KushkiInfo;
|
|
17
|
+
});
|
|
18
|
+
requestToken(body: TokenRequest | TokenKPayRequest, callback: (value: TokenResponse | ErrorResponse) => void): void;
|
|
19
|
+
}
|
package/lib/Card.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.Card = void 0;
|
|
4
|
+
var Identifiers_1 = require("./../lib/constant/Identifiers");
|
|
5
|
+
var CardContainer_1 = require("./../lib/infrastructure/CardContainer");
|
|
6
|
+
var KushkiInfo_1 = require("./../lib/KushkiInfo");
|
|
7
|
+
var Card = /** @class */ (function () {
|
|
8
|
+
function Card(body) {
|
|
9
|
+
KushkiInfo_1.KInfo.sKushkiInfo = KushkiInfo_1.KInfo.buildKushkiInfo(body.kushkiInfo);
|
|
10
|
+
body.inTestEnvironment =
|
|
11
|
+
body.inTestEnvironment === undefined ? false : body.inTestEnvironment;
|
|
12
|
+
body.regional = body.regional === undefined ? false : body.regional;
|
|
13
|
+
this._merchantId = body.merchantId;
|
|
14
|
+
this._inTestEnvironment = body.inTestEnvironment;
|
|
15
|
+
this._regional = body.regional;
|
|
16
|
+
this._cardService = CardContainer_1.CARD_CONTAINER.get(Identifiers_1.IDENTIFIERS.CardService)(this._regional);
|
|
17
|
+
}
|
|
18
|
+
Card.prototype.requestToken = function (body, callback) {
|
|
19
|
+
this._cardService.requestToken(body, this._merchantId, this._inTestEnvironment, this._regional, callback);
|
|
20
|
+
};
|
|
21
|
+
return Card;
|
|
22
|
+
}());
|
|
23
|
+
exports.Card = Card;
|
package/lib/KushkiInfo.js
CHANGED
|
@@ -13,7 +13,7 @@ var KInfo = /** @class */ (function () {
|
|
|
13
13
|
function KInfo() {
|
|
14
14
|
}
|
|
15
15
|
KInfo.buildKushkiInfo = function (kushkiInfo) {
|
|
16
|
-
var kushki_js_version = "1.36.0-alpha
|
|
16
|
+
var kushki_js_version = "1.36.0-alpha.1";
|
|
17
17
|
if (kushkiInfo) {
|
|
18
18
|
if (UtilsService_1.UtilsService.sIsEmpty(kushkiInfo.platformVersion))
|
|
19
19
|
kushkiInfo.platformVersion = kushki_js_version;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.CARD_CONTAINER = void 0;
|
|
4
|
+
var Identifiers_1 = require("./../../lib/constant/Identifiers");
|
|
5
|
+
var inversify_1 = require("inversify");
|
|
6
|
+
var AuthService_1 = require("./../../lib/service/AuthService");
|
|
7
|
+
var KushkiGateway_1 = require("./../../lib/gateway/KushkiGateway");
|
|
8
|
+
var SiftScience_1 = require("./../../lib/gateway/SiftScience");
|
|
9
|
+
var CardService_1 = require("./../../lib/service/CardService");
|
|
10
|
+
var CARD_CONTAINER = new inversify_1.Container();
|
|
11
|
+
exports.CARD_CONTAINER = CARD_CONTAINER;
|
|
12
|
+
// Service
|
|
13
|
+
CARD_CONTAINER.bind(Identifiers_1.IDENTIFIERS.AuthService).toFactory(function (context) { return function () {
|
|
14
|
+
return new AuthService_1.AuthService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway));
|
|
15
|
+
}; });
|
|
16
|
+
CARD_CONTAINER.bind(Identifiers_1.IDENTIFIERS.CardService).toFactory(function (context) { return function (regional) {
|
|
17
|
+
return new CardService_1.CardService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway), context.container.get(Identifiers_1.IDENTIFIERS.AuthService)(regional), context.container.get(Identifiers_1.IDENTIFIERS.AntiFraud)(regional));
|
|
18
|
+
}; });
|
|
19
|
+
// Gateway
|
|
20
|
+
CARD_CONTAINER.bind(Identifiers_1.IDENTIFIERS.KushkiGateway).to(KushkiGateway_1.KushkiGateway);
|
|
21
|
+
CARD_CONTAINER.bind(Identifiers_1.IDENTIFIERS.AntiFraud).toFactory(function () { return function (regional) { return new SiftScience_1.SiftScience(regional); }; });
|
package/lib/lib.d.ts
CHANGED
package/lib/lib.js
CHANGED
|
@@ -15,4 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
16
16
|
};
|
|
17
17
|
exports.__esModule = true;
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./Card"), exports);
|
|
@@ -186,7 +186,7 @@ var CardService = /** @class */ (function () {
|
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
else {
|
|
189
|
-
sift_science_obj = __assign(__assign({}, sift_science_obj), { jwt: jwt
|
|
189
|
+
sift_science_obj = __assign(__assign({}, sift_science_obj), { jwt: jwt });
|
|
190
190
|
_this._requestDeviceToken(__assign({ subscriptionId: request.subscriptionId }, sift_science_obj), mid, isTest, regional, callback);
|
|
191
191
|
}
|
|
192
192
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kushki/js",
|
|
3
|
-
"version": "1.36.0-alpha
|
|
3
|
+
"version": "1.36.0-alpha.1",
|
|
4
4
|
"description": "kushki-js",
|
|
5
5
|
"main": "lib/lib.js",
|
|
6
6
|
"types": "lib/lib.d.ts",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"lint:format": "prettier --write \"./**/*.{ts,js,json,yml,yaml}\" \"./.{pull_review.kushkirc,lintstagedrc,nycrc,prettierrc}\"",
|
|
29
29
|
"sonar": "nyc report --reporter=lcov",
|
|
30
30
|
"test": "npm run test:unit && npm run test:coverage",
|
|
31
|
-
"test:unit": "mocha --opts ./mocha.opts src/**/*.ts src/*.ts --ignore src/libs/**/*.ts",
|
|
32
|
-
"test:coverage": "nyc mocha --opts ./mocha.nyc.opts src/**/*.ts src/*.ts --ignore src/libs/**/*.ts",
|
|
31
|
+
"test:unit": "mocha --opts ./mocha.opts src/**/*.ts src/*.ts --ignore src/libs/**/*.ts src/Card.ts src/infrastructure/CardContainer.ts",
|
|
32
|
+
"test:coverage": "nyc mocha --opts ./mocha.nyc.opts src/**/*.ts src/*.ts --ignore src/libs/**/*.ts src/Card.ts src/infrastructure/CardContainer.ts",
|
|
33
33
|
"test:watch": "mocha --watch --opts ./mocha.opts src/**/*.spec.ts",
|
|
34
34
|
"validate": "npm run lint && npm run test",
|
|
35
35
|
"build": "npm run build:npm && npm run build:cdn",
|