@kushki/js 1.39.0 → 1.39.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/Kushki.js
CHANGED
|
@@ -172,7 +172,7 @@ class Kushki {
|
|
|
172
172
|
this._cardService.validate3DS(body, this._merchantId, this._inTestEnvironment, this._regional, callback);
|
|
173
173
|
}
|
|
174
174
|
requestSecureInit(body, callback) {
|
|
175
|
-
this.
|
|
175
|
+
this._cardService.requestSecureInit(body, this._merchantId, this._inTestEnvironment, this._regional, callback);
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
178
|
* @param {Function} callback - function to execute when animation ends.
|
package/lib/KushkiInfo.js
CHANGED
|
@@ -11,7 +11,7 @@ const UtilsService_1 = require("./../lib/service/UtilsService");
|
|
|
11
11
|
*/
|
|
12
12
|
class KInfo {
|
|
13
13
|
static buildKushkiInfo(kushkiInfo) {
|
|
14
|
-
const kushki_js_version = "1.39.
|
|
14
|
+
const kushki_js_version = "1.39.1";
|
|
15
15
|
if (kushkiInfo) {
|
|
16
16
|
if (UtilsService_1.UtilsService.sIsEmpty(kushkiInfo.platformVersion))
|
|
17
17
|
kushkiInfo.platformVersion = kushki_js_version;
|
|
@@ -77,6 +77,7 @@ export interface ICardService {
|
|
|
77
77
|
* @param mid - public merchant id
|
|
78
78
|
* @param isTest - is test environment
|
|
79
79
|
* @param regional - Define if endpoint used regional URL
|
|
80
|
+
* @param callback
|
|
80
81
|
*/
|
|
81
|
-
requestSecureInit(body: SecureInitRequest, mid: string, isTest: boolean, regional: boolean):
|
|
82
|
+
requestSecureInit(body: SecureInitRequest, mid: string, isTest: boolean, regional: boolean, callback: (value: SecureInitResponse | ErrorResponse) => void): void;
|
|
82
83
|
}
|
|
@@ -46,7 +46,7 @@ export declare class CardService implements ICardService {
|
|
|
46
46
|
requestDeferred(binBody: BinBody, mid: string, isTest: boolean, regional: boolean): Observable<IDeferredResponse[]>;
|
|
47
47
|
requestBinInfo(binBody: BinBody, mid: string, isTest: boolean, regional: boolean): Observable<BinInfoResponse>;
|
|
48
48
|
validate3DS(body: Validate3DSRequest, mid: string, isTest: boolean, regional: boolean, callback: (value: Validate3DsResponse | ErrorResponse) => void): void;
|
|
49
|
-
requestSecureInit(request: SecureInitRequest, mid: string, isTest: boolean, regional: boolean):
|
|
49
|
+
requestSecureInit(request: SecureInitRequest, mid: string, isTest: boolean, regional: boolean, callback: (value: SecureInitResponse | ErrorResponse) => void): void;
|
|
50
50
|
private _getCreateSubscriptionDataToTransform;
|
|
51
51
|
private _request3DSToken;
|
|
52
52
|
private _setupCompleteCardinal;
|
|
@@ -213,30 +213,39 @@ let CardService = CardService_1 = class CardService {
|
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
requestSecureInit(request, mid, isTest, regional) {
|
|
217
|
-
|
|
216
|
+
requestSecureInit(request, mid, isTest, regional, callback) {
|
|
217
|
+
rxjs_1.of(1)
|
|
218
|
+
.pipe(operators_1.map(() => this._checkCardLength(request, ErrorEnum_1.ErrorCode.E014)), operators_1.switchMap(() => this._getMerchantSettings(mid, isTest, regional)), operators_1.switchMap((merchantSettings) => rxjs_1.iif(() => this._is3DSSecureEnabled(merchantSettings), rxjs_1.of(merchantSettings), rxjs_1.throwError(new KushkiError_1.KushkiError(ErrorEnum_1.ERRORS.E013)))), operators_1.switchMap((merchant) => this._getCybersourceJwt(merchant, mid, isTest, regional, request.card.number)), operators_1.map((jwt) => ({
|
|
218
219
|
jwt: jwt,
|
|
219
|
-
})))
|
|
220
|
+
})))
|
|
221
|
+
.subscribe({
|
|
222
|
+
error: (err) => Kushki_1.Kushki.callbackError(err, callback),
|
|
223
|
+
next: (jwtResponse) => {
|
|
224
|
+
this._request3DSToken(isTest, () => {
|
|
225
|
+
callback(jwtResponse);
|
|
226
|
+
});
|
|
227
|
+
},
|
|
228
|
+
});
|
|
220
229
|
}
|
|
221
230
|
_getCreateSubscriptionDataToTransform(siftObject, subscriptionTokenRequest) {
|
|
222
231
|
if (siftObject.userId === null || siftObject.sessionId === null)
|
|
223
232
|
return Object.assign({}, subscriptionTokenRequest);
|
|
224
233
|
return Object.assign(Object.assign({}, subscriptionTokenRequest), siftObject);
|
|
225
234
|
}
|
|
226
|
-
_request3DSToken(isTest,
|
|
235
|
+
_request3DSToken(isTest, callback) {
|
|
227
236
|
if (isTest)
|
|
228
237
|
Promise.resolve().then(() => require("./../../lib/libs/cardinal/staging")).then(() => {
|
|
229
|
-
this._setupCompleteCardinal(
|
|
238
|
+
this._setupCompleteCardinal(callback);
|
|
230
239
|
});
|
|
231
240
|
else
|
|
232
241
|
Promise.resolve().then(() => require("./../../lib/libs/cardinal/prod")).then(() => {
|
|
233
|
-
this._setupCompleteCardinal(
|
|
242
|
+
this._setupCompleteCardinal(callback);
|
|
234
243
|
});
|
|
235
244
|
}
|
|
236
245
|
// istanbul ignore next
|
|
237
|
-
_setupCompleteCardinal(
|
|
246
|
+
_setupCompleteCardinal(callback) {
|
|
238
247
|
window.Cardinal.on("payments.setupComplete", () => __awaiter(this, void 0, void 0, function* () {
|
|
239
|
-
|
|
248
|
+
callback();
|
|
240
249
|
}));
|
|
241
250
|
}
|
|
242
251
|
// istanbul ignore next
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kushki/js",
|
|
3
|
-
"version": "1.39.
|
|
3
|
+
"version": "1.39.1",
|
|
4
4
|
"description": "kushki-js",
|
|
5
5
|
"main": "lib/lib.js",
|
|
6
6
|
"types": "lib/lib.d.ts",
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"husky": {
|
|
13
13
|
"hooks": {
|
|
14
|
-
"pre-commit": "lint-staged"
|
|
15
|
-
"pre-push": "npm run lint:duplicate && npm run lint:check && npm run test:unit"
|
|
14
|
+
"pre-commit": "lint-staged"
|
|
16
15
|
}
|
|
17
16
|
},
|
|
18
17
|
"scripts": {
|