@kushki/js 1.37.0 → 1.37.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/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.37.
|
|
14
|
+
const kushki_js_version = "1.37.2";
|
|
15
15
|
if (kushkiInfo) {
|
|
16
16
|
if (UtilsService_1.UtilsService.sIsEmpty(kushkiInfo.platformVersion))
|
|
17
17
|
kushkiInfo.platformVersion = kushki_js_version;
|
|
@@ -79,9 +79,4 @@ export interface ICardService {
|
|
|
79
79
|
* @param regional - Define if endpoint used regional URL
|
|
80
80
|
*/
|
|
81
81
|
requestSecureInit(body: SecureInitRequest, mid: string, isTest: boolean, regional: boolean): Observable<SecureInitResponse>;
|
|
82
|
-
/**
|
|
83
|
-
*
|
|
84
|
-
* @param alreadyObtainedToken
|
|
85
|
-
*/
|
|
86
|
-
setAlreadyObtainedToken(alreadyObtainedToken: boolean): any;
|
|
87
82
|
}
|
|
@@ -39,7 +39,6 @@ export declare class CardService implements ICardService {
|
|
|
39
39
|
private readonly _3Dsecure;
|
|
40
40
|
private readonly _cardNumber;
|
|
41
41
|
private _sandboxEnable;
|
|
42
|
-
private _alreadyObtainedToken;
|
|
43
42
|
constructor(gateway: IKushkiGateway, authService: IAuthService, antiFraud: IAntiFraud);
|
|
44
43
|
requestToken(request: TokenRequest | TokenKPayRequest, mid: string, isTest: boolean, regional: boolean, callback: (value: TokenResponse | ErrorResponse) => void): void;
|
|
45
44
|
requestDeviceToken(request: SubscriptionIdRequest, mid: string, isTest: boolean, regional: boolean, callback: (value: TokenResponse | ErrorResponse) => void): void;
|
|
@@ -48,8 +47,6 @@ export declare class CardService implements ICardService {
|
|
|
48
47
|
requestBinInfo(binBody: BinBody, mid: string, isTest: boolean, regional: boolean): Observable<BinInfoResponse>;
|
|
49
48
|
validate3DS(body: Validate3DSRequest, mid: string, isTest: boolean, regional: boolean, callback: (value: Validate3DsResponse | ErrorResponse) => void): void;
|
|
50
49
|
requestSecureInit(request: SecureInitRequest, mid: string, isTest: boolean, regional: boolean): Observable<SecureInitResponse>;
|
|
51
|
-
setAlreadyObtainedToken(alreadyObtainedToken: boolean): void;
|
|
52
|
-
private _handleRetryRequestToken3DS;
|
|
53
50
|
private _getCreateSubscriptionDataToTransform;
|
|
54
51
|
private _request3DSToken;
|
|
55
52
|
private _setupCompleteCardinal;
|
|
@@ -44,7 +44,6 @@ let CardService = CardService_1 = class CardService {
|
|
|
44
44
|
this._3Dsecure = "active_3dsecure";
|
|
45
45
|
this._cardNumber = "card.number";
|
|
46
46
|
this._sandboxEnable = false;
|
|
47
|
-
this._alreadyObtainedToken = false;
|
|
48
47
|
this._gateway = gateway;
|
|
49
48
|
this._antiFraud = antiFraud;
|
|
50
49
|
this._authService = authService;
|
|
@@ -99,14 +98,10 @@ let CardService = CardService_1 = class CardService {
|
|
|
99
98
|
.subscribe({
|
|
100
99
|
error: (err) => Kushki_1.Kushki.callbackError(err, callback),
|
|
101
100
|
next: ([final_request, authorization, merchant]) => {
|
|
102
|
-
if (final_request.jwt && !merchant.sandboxEnable)
|
|
101
|
+
if (final_request.jwt && !merchant.sandboxEnable)
|
|
103
102
|
this._request3DSToken(isTest, () => {
|
|
104
|
-
window.Cardinal.off("payments.setupComplete");
|
|
105
|
-
// istanbul ignore next
|
|
106
103
|
this._requestTokenGateway(final_request, mid, isTest, regional, callback, authorization);
|
|
107
104
|
});
|
|
108
|
-
this._handleRetryRequestToken3DS(final_request, mid, isTest, regional, callback, authorization);
|
|
109
|
-
}
|
|
110
105
|
else
|
|
111
106
|
this._requestTokenGateway(final_request, mid, isTest, regional, callback, authorization);
|
|
112
107
|
},
|
|
@@ -223,24 +218,6 @@ let CardService = CardService_1 = class CardService {
|
|
|
223
218
|
jwt: jwt,
|
|
224
219
|
})));
|
|
225
220
|
}
|
|
226
|
-
setAlreadyObtainedToken(alreadyObtainedToken) {
|
|
227
|
-
this._alreadyObtainedToken = alreadyObtainedToken;
|
|
228
|
-
}
|
|
229
|
-
_handleRetryRequestToken3DS(finalRequest, mid, isTest, regional, callback, authorization) {
|
|
230
|
-
// istanbul ignore next
|
|
231
|
-
if (this._alreadyObtainedToken)
|
|
232
|
-
return;
|
|
233
|
-
window.Cardinal.complete({
|
|
234
|
-
Status: "Success",
|
|
235
|
-
})
|
|
236
|
-
.then(() => {
|
|
237
|
-
this._requestTokenGateway(finalRequest, mid, isTest, regional, callback, authorization);
|
|
238
|
-
})
|
|
239
|
-
.catch(() => {
|
|
240
|
-
const error = ErrorEnum_1.ERRORS[ErrorEnum_1.ErrorCode.E002];
|
|
241
|
-
Kushki_1.Kushki.callbackError(new KushkiError_1.KushkiError(error, ""), callback);
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
221
|
_getCreateSubscriptionDataToTransform(siftObject, subscriptionTokenRequest) {
|
|
245
222
|
if (siftObject.userId === null || siftObject.sessionId === null)
|
|
246
223
|
return Object.assign({}, subscriptionTokenRequest);
|
|
@@ -269,7 +246,6 @@ let CardService = CardService_1 = class CardService {
|
|
|
269
246
|
error: (err) => Kushki_1.Kushki.callbackError(err, callback),
|
|
270
247
|
next: (response) => {
|
|
271
248
|
callback(response);
|
|
272
|
-
this._alreadyObtainedToken = true;
|
|
273
249
|
},
|
|
274
250
|
});
|
|
275
251
|
}
|
|
@@ -9,9 +9,9 @@ export type CardBrandingRequest = VisaBrandingRequest | MasterCardBrandingReques
|
|
|
9
9
|
export interface VisaBrandingRequest {
|
|
10
10
|
brand: "visa";
|
|
11
11
|
/**
|
|
12
|
-
* ("white" | "blue" | "blur") [default = "white"] The background of animation.
|
|
12
|
+
* ("white" | "blue" | "blur" | "transparent") [default = "white"] The background of animation.
|
|
13
13
|
*/
|
|
14
|
-
color?: "white" | "blue" | "blur";
|
|
14
|
+
color?: "white" | "blue" | "blur" | "transparent";
|
|
15
15
|
/**
|
|
16
16
|
* (boolean) [default= false] The container visualization.
|
|
17
17
|
*/
|
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/* tslint:disable:all */
|
|
2
|
-
/* tslint:disable:all */
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Visa animation properties
|
|
6
|
-
*/
|
|
7
|
-
export interface VisaBrandingRequest {
|
|
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
|
-
*/
|
|
15
|
-
constrained?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* (boolean) [default = false] The activation of the sound.
|
|
18
|
-
*/
|
|
19
|
-
sound?: boolean;
|
|
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";
|
|
32
|
-
}
|