@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
package/lib/Kushki.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { BinBody } from "./../lib/types/bin_body";
|
|
|
10
10
|
import { BinInfoResponse } from "./../lib/types/bin_info_response";
|
|
11
11
|
import { CardAsyncTokenRequest } from "./../lib/types/card_async_token_request";
|
|
12
12
|
import { CardAsyncTokenResponse } from "./../lib/types/card_async_token_response";
|
|
13
|
+
import { CardBrandingRequest } from "./../lib/types/card_branding_request";
|
|
13
14
|
import { CashTokenRequest } from "./../lib/types/cash_token_request";
|
|
14
15
|
import { DeletePaymentMethodRequest } from "./../lib/types/delete_payment_method_request";
|
|
15
16
|
import { DeviceTokenRequest } from "./../lib/types/device_token_request";
|
|
@@ -50,7 +51,6 @@ import { Validate3DsResponse } from "./../lib/types/validate_3ds_response";
|
|
|
50
51
|
import { ValidateSessionResponse } from "./../lib/types/validate_session_response";
|
|
51
52
|
import { VerifyAuthRequest } from "./../lib/types/verify_auth_request";
|
|
52
53
|
import { VerifyAuthResponse } from "./../lib/types/verify_auth_response";
|
|
53
|
-
import { VisaBrandingRequest } from "./../lib/types/visa_branding_request";
|
|
54
54
|
/**
|
|
55
55
|
* Implementation
|
|
56
56
|
*/
|
|
@@ -126,7 +126,22 @@ export declare class Kushki {
|
|
|
126
126
|
validateSession(callback: (value: ValidateSessionResponse | ErrorResponse) => void): void;
|
|
127
127
|
requestValidate3DS(body: Validate3DSRequest, callback: (value: Validate3DsResponse | ErrorResponse) => void): void;
|
|
128
128
|
requestSecureInit(body: SecureInitRequest, callback: (value: SecureInitResponse | ErrorResponse) => void): void;
|
|
129
|
-
|
|
129
|
+
/**
|
|
130
|
+
* @param {Function} callback - function to execute when animation ends.
|
|
131
|
+
* @param {ErrorResponse} [callback.error] - return when throw an error during the animation.
|
|
132
|
+
* @param {VisaBrandingRequest | MasterCardBrandingRequest} body - configurations of the animation.
|
|
133
|
+
* @param {string} body.brand - Visa/MasterCard param - card brand ["visa" | "mastercard"]
|
|
134
|
+
* @param {string} [body.color="white"] - Visa param - The background of animation ["white" | "blue" | "blur"].
|
|
135
|
+
* @param {boolean} [body.constrained=false] - Visa param - The container visualization.
|
|
136
|
+
* @param {boolean} [body.sound=false] - Visa param - The activation of the sound.
|
|
137
|
+
* @param {string} [body.checkmark="none"] - Visa param - The visualization of checkmark ["none" | "checkmark" | "checkmarkWithText"].
|
|
138
|
+
* @param {string} [body.checkmarkTextOption="approved"] - Visa param - The text to appear if checkmarkWithText is enabled ["approved" | "success" | "complete"].
|
|
139
|
+
* @param {string} [body.languageCode="es"] - Visa param - The language of the checkmark text ["es" | "en" | "pt_br"].
|
|
140
|
+
* @param {string} [body.type="default"] - MasterCard param - define type of component ["default" | "animation-only" | "sound-only"].
|
|
141
|
+
* @param {boolean} [body.clearBackground=false] - MasterCard param - clears the background.
|
|
142
|
+
* @returns {void}
|
|
143
|
+
*/
|
|
144
|
+
initCardBrandingAnimation(callback: (error?: ErrorResponse) => void, body: CardBrandingRequest): void;
|
|
130
145
|
static callbackError(err: ErrorResponse | KushkiError | AxiosError, callback: (value: ErrorResponse) => void): void;
|
|
131
146
|
private _requestBankList;
|
|
132
147
|
private _requestDeviceToken;
|
package/lib/Kushki.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Kushki = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const Identifiers_1 = require("./../lib/constant/Identifiers");
|
|
5
|
+
const KushkiError_1 = require("./../lib/generic/KushkiError");
|
|
6
|
+
const CardBrandsEnum_1 = require("./../lib/infrastructure/CardBrandsEnum");
|
|
7
|
+
const Container_1 = require("./../lib/infrastructure/Container");
|
|
8
|
+
const ErrorEnum_1 = require("./../lib/infrastructure/ErrorEnum");
|
|
7
9
|
require("reflect-metadata");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
const UtilsService_1 = require("./../lib/service/UtilsService");
|
|
11
|
+
const KushkiInfo_1 = require("./../lib/KushkiInfo");
|
|
10
12
|
/**
|
|
11
13
|
* Implementation
|
|
12
14
|
*/
|
|
13
|
-
|
|
15
|
+
class Kushki {
|
|
14
16
|
// tslint:disable-next-line:max-func-body-length
|
|
15
|
-
|
|
17
|
+
constructor(body) {
|
|
16
18
|
KushkiInfo_1.KInfo.sKushkiInfo = KushkiInfo_1.KInfo.buildKushkiInfo(body.kushkiInfo);
|
|
17
19
|
body.inTestEnvironment =
|
|
18
20
|
body.inTestEnvironment === undefined ? false : body.inTestEnvironment;
|
|
@@ -38,177 +40,194 @@ var Kushki = /** @class */ (function () {
|
|
|
38
40
|
this._cardDynamicService = Container_1.CONTAINER.get(Identifiers_1.IDENTIFIERS.CardDynamicService)();
|
|
39
41
|
this._cardSubscriptionDynamicService = Container_1.CONTAINER.get(Identifiers_1.IDENTIFIERS.CardSubscriptionDynamicService)();
|
|
40
42
|
}
|
|
41
|
-
|
|
43
|
+
requestToken(body, callback) {
|
|
42
44
|
this._cardService.requestToken(body, this._merchantId, this._inTestEnvironment, this._regional, callback);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
+
}
|
|
46
|
+
requestInitAntiFraud(userId, callback) {
|
|
45
47
|
this._resolve(this._siftScience.requestInitAntiFraud(userId, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
46
|
-
}
|
|
48
|
+
}
|
|
47
49
|
/**
|
|
48
50
|
* @deprecated use requestDeviceToken instead
|
|
49
51
|
* @param {Function} body with value
|
|
50
52
|
* @param {Function} callback with value
|
|
51
53
|
* @returns {void}
|
|
52
54
|
*/
|
|
53
|
-
|
|
55
|
+
requestTokenCharge(body, callback) {
|
|
54
56
|
this._requestDeviceToken(body, callback);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
+
}
|
|
58
|
+
requestDeviceToken(body, callback) {
|
|
57
59
|
this._requestDeviceToken(body, callback);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
+
}
|
|
61
|
+
requestSubscriptionToken(body, callback) {
|
|
60
62
|
this._cardService.requestSubscriptionToken(body, this._merchantId, this._inTestEnvironment, this._regional, callback);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
+
}
|
|
64
|
+
requestTransferToken(body, callback) {
|
|
63
65
|
this._resolve(this._transferService.requestTransferToken(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
+
}
|
|
67
|
+
checkStatus(callback) {
|
|
66
68
|
this._resolve(this._kushkiService.checkStatus(this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
67
|
-
}
|
|
69
|
+
}
|
|
68
70
|
/**
|
|
69
71
|
* @deprecated since version 1.19.8 use requestBankList instead
|
|
70
72
|
* @param {Function} callback with value
|
|
71
73
|
* @returns {void}
|
|
72
74
|
*/
|
|
73
|
-
|
|
75
|
+
requestPseBankList(callback) {
|
|
74
76
|
this._requestBankList(callback);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
+
}
|
|
78
|
+
requestBankList(callback) {
|
|
77
79
|
this._requestBankList(callback);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
+
}
|
|
81
|
+
requestDeferred(body, callback) {
|
|
80
82
|
this._resolve(this._cardService.requestDeferred(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
+
}
|
|
84
|
+
requestBinInfo(body, callback) {
|
|
83
85
|
this._cardService
|
|
84
86
|
.requestBinInfo(body, this._merchantId, this._inTestEnvironment, this._regional)
|
|
85
87
|
.subscribe({
|
|
86
|
-
error:
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
next: function (response) {
|
|
88
|
+
error: (err) => Kushki.callbackError(err, callback),
|
|
89
|
+
next: (response) => {
|
|
90
90
|
callback(response);
|
|
91
|
-
}
|
|
91
|
+
},
|
|
92
92
|
});
|
|
93
|
-
}
|
|
94
|
-
|
|
93
|
+
}
|
|
94
|
+
requestBrandsByMerchant(callback) {
|
|
95
95
|
this._kushkiService
|
|
96
96
|
.requestBrandsByMerchant(this._merchantId, this._inTestEnvironment, this._regional)
|
|
97
97
|
.subscribe({
|
|
98
|
-
error:
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
next: function (response) {
|
|
98
|
+
error: (err) => Kushki.callbackError(err, callback),
|
|
99
|
+
next: (response) => {
|
|
102
100
|
callback(response);
|
|
103
|
-
}
|
|
101
|
+
},
|
|
104
102
|
});
|
|
105
|
-
}
|
|
106
|
-
|
|
103
|
+
}
|
|
104
|
+
requestBrandsLogosByMerchant(callback) {
|
|
107
105
|
this._kushkiService
|
|
108
106
|
.requestBrandsLogosByMerchant(this._merchantId, this._inTestEnvironment, this._regional)
|
|
109
107
|
.subscribe({
|
|
110
|
-
error:
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
next: function (response) {
|
|
108
|
+
error: (err) => Kushki.callbackError(err, callback),
|
|
109
|
+
next: (response) => {
|
|
114
110
|
callback(response);
|
|
115
|
-
}
|
|
111
|
+
},
|
|
116
112
|
});
|
|
117
|
-
}
|
|
118
|
-
|
|
113
|
+
}
|
|
114
|
+
requestCashToken(body, callback) {
|
|
119
115
|
this._resolve(this._cashService.requestCashToken(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
120
|
-
}
|
|
121
|
-
|
|
116
|
+
}
|
|
117
|
+
requestSecureServiceValidation(body, callback) {
|
|
122
118
|
this._resolve(this._secureService.requestSecureServiceValidation(this._merchantId, body, this._inTestEnvironment, this._regional), callback);
|
|
123
|
-
}
|
|
124
|
-
|
|
119
|
+
}
|
|
120
|
+
requestCardAsyncToken(body, callback) {
|
|
125
121
|
this._resolve(this._cardAsyncService.requestCardAsyncToken(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
126
|
-
}
|
|
127
|
-
|
|
122
|
+
}
|
|
123
|
+
requestSubscriptionCardAsyncToken(body, callback) {
|
|
128
124
|
this._resolve(this._cardAsyncService.requestCardSubscriptionAsyncToken(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
129
|
-
}
|
|
130
|
-
|
|
125
|
+
}
|
|
126
|
+
multiMerchantInfo(body, callback) {
|
|
131
127
|
this._resolve(this._multiMerchantInfoService.multiMerchantInfo(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
132
|
-
}
|
|
133
|
-
|
|
128
|
+
}
|
|
129
|
+
requestPayoutsCashToken(body, callback) {
|
|
134
130
|
this._resolve(this._payoutsCashService.requestPayoutsCashToken(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
135
|
-
}
|
|
136
|
-
|
|
131
|
+
}
|
|
132
|
+
requestPayoutsTransferToken(body, callback) {
|
|
137
133
|
this._resolve(this._payoutsTransferService.requestPayoutsTransferToken(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
138
|
-
}
|
|
139
|
-
|
|
134
|
+
}
|
|
135
|
+
getCommissionConfiguration(body, callback) {
|
|
140
136
|
this._resolve(this._commissionService.getCommissionConfiguration(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
141
|
-
}
|
|
142
|
-
|
|
137
|
+
}
|
|
138
|
+
requestTransferSubscriptionToken(body, callback) {
|
|
143
139
|
this._resolve(this._transferSubscriptionService.requestToken(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
144
|
-
}
|
|
145
|
-
|
|
140
|
+
}
|
|
141
|
+
requestTransferSubscriptionBankList(callback) {
|
|
146
142
|
this._resolve(this._transferSubscriptionService.requestBankList(this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
147
|
-
}
|
|
148
|
-
|
|
143
|
+
}
|
|
144
|
+
requestPayoutsTransferBankList(callback) {
|
|
149
145
|
this._resolve(this._payoutsTransferService.requestPayoutsTransferBankList(this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
150
|
-
}
|
|
151
|
-
|
|
146
|
+
}
|
|
147
|
+
requestMobileProcessorToken(body, callback) {
|
|
152
148
|
this._resolve(this._mobileProcessorService.requestToken(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
153
|
-
}
|
|
154
|
-
|
|
149
|
+
}
|
|
150
|
+
requestCardDynamicToken(bin, body, callback) {
|
|
155
151
|
this._cardDynamicService.requestCardDynamicToken(bin, body, this._merchantId, this._inTestEnvironment, this._regional, callback);
|
|
156
|
-
}
|
|
157
|
-
|
|
152
|
+
}
|
|
153
|
+
requestCardSubscriptionDynamicToken(bin, body, callback) {
|
|
158
154
|
this._cardSubscriptionDynamicService.requestCardSubscriptionDynamicToken(bin, body, this._merchantId, this._inTestEnvironment, this._regional, callback);
|
|
159
|
-
}
|
|
160
|
-
|
|
155
|
+
}
|
|
156
|
+
requestInitAuth(body, callback) {
|
|
161
157
|
this._resolve(this._authService.requestInitAuth(body, this._inTestEnvironment), callback);
|
|
162
|
-
}
|
|
163
|
-
|
|
158
|
+
}
|
|
159
|
+
deletePaymentMethod(body, callback) {
|
|
164
160
|
this._resolve(this._kPayService.deletePaymentMethod(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
165
|
-
}
|
|
166
|
-
|
|
161
|
+
}
|
|
162
|
+
requestSavedPaymentMethods(body, callback) {
|
|
167
163
|
this._resolve(this._kPayService.requestSavedPaymentMethods(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
168
|
-
}
|
|
169
|
-
|
|
164
|
+
}
|
|
165
|
+
requestVerifyAuth(body, callback) {
|
|
170
166
|
this._resolve(this._authService.requestVerifyAuth(body.code, this._inTestEnvironment), callback);
|
|
171
|
-
}
|
|
172
|
-
|
|
167
|
+
}
|
|
168
|
+
validateSession(callback) {
|
|
173
169
|
this._resolve(this._authService.validateSession(this._inTestEnvironment), callback);
|
|
174
|
-
}
|
|
175
|
-
|
|
170
|
+
}
|
|
171
|
+
requestValidate3DS(body, callback) {
|
|
176
172
|
this._cardService.validate3DS(body, this._merchantId, this._inTestEnvironment, this._regional, callback);
|
|
177
|
-
}
|
|
178
|
-
|
|
173
|
+
}
|
|
174
|
+
requestSecureInit(body, callback) {
|
|
179
175
|
this._resolve(this._cardService.requestSecureInit(body, this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* @param {Function} callback - function to execute when animation ends.
|
|
179
|
+
* @param {ErrorResponse} [callback.error] - return when throw an error during the animation.
|
|
180
|
+
* @param {VisaBrandingRequest | MasterCardBrandingRequest} body - configurations of the animation.
|
|
181
|
+
* @param {string} body.brand - Visa/MasterCard param - card brand ["visa" | "mastercard"]
|
|
182
|
+
* @param {string} [body.color="white"] - Visa param - The background of animation ["white" | "blue" | "blur"].
|
|
183
|
+
* @param {boolean} [body.constrained=false] - Visa param - The container visualization.
|
|
184
|
+
* @param {boolean} [body.sound=false] - Visa param - The activation of the sound.
|
|
185
|
+
* @param {string} [body.checkmark="none"] - Visa param - The visualization of checkmark ["none" | "checkmark" | "checkmarkWithText"].
|
|
186
|
+
* @param {string} [body.checkmarkTextOption="approved"] - Visa param - The text to appear if checkmarkWithText is enabled ["approved" | "success" | "complete"].
|
|
187
|
+
* @param {string} [body.languageCode="es"] - Visa param - The language of the checkmark text ["es" | "en" | "pt_br"].
|
|
188
|
+
* @param {string} [body.type="default"] - MasterCard param - define type of component ["default" | "animation-only" | "sound-only"].
|
|
189
|
+
* @param {boolean} [body.clearBackground=false] - MasterCard param - clears the background.
|
|
190
|
+
* @returns {void}
|
|
191
|
+
*/
|
|
192
|
+
initCardBrandingAnimation(callback, body) {
|
|
193
|
+
switch (body.brand) {
|
|
194
|
+
case CardBrandsEnum_1.CardBrandsEnum.VISA:
|
|
195
|
+
this._kushkiService.initVisaBrandingAnimation(this._inTestEnvironment, callback, body);
|
|
196
|
+
break;
|
|
197
|
+
case CardBrandsEnum_1.CardBrandsEnum.MASTERCARD:
|
|
198
|
+
this._kushkiService.initMasterCardBrandingAnimation(callback, body);
|
|
199
|
+
break;
|
|
200
|
+
default:
|
|
201
|
+
return Kushki.callbackError(new KushkiError_1.KushkiError(ErrorEnum_1.ERRORS.E017), callback);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
static callbackError(err, callback) {
|
|
185
205
|
if (err instanceof KushkiError_1.KushkiError)
|
|
186
206
|
callback({
|
|
187
|
-
code:
|
|
188
|
-
error: err.code
|
|
189
|
-
message:
|
|
207
|
+
code: `${err.code}`,
|
|
208
|
+
error: `${err.code} - ${err.getMessage()}`,
|
|
209
|
+
message: `${err.getMessage()}`,
|
|
190
210
|
});
|
|
191
211
|
else
|
|
192
212
|
callback({
|
|
193
|
-
code:
|
|
194
|
-
error:
|
|
195
|
-
message:
|
|
213
|
+
code: `${UtilsService_1.UtilsService.sGet(err, "response.data.code", "K002")}`,
|
|
214
|
+
error: `${UtilsService_1.UtilsService.sGet(err, "message", "Ha ocurrido un error inesperado.")}`,
|
|
215
|
+
message: `${UtilsService_1.UtilsService.sGet(err, "response.data.message", "Ha ocurrido un error inesperado.")}`,
|
|
196
216
|
});
|
|
197
|
-
}
|
|
198
|
-
|
|
217
|
+
}
|
|
218
|
+
_requestBankList(callback) {
|
|
199
219
|
this._resolve(this._transferService.requestBankList(this._merchantId, this._inTestEnvironment, this._regional), callback);
|
|
200
|
-
}
|
|
201
|
-
|
|
220
|
+
}
|
|
221
|
+
_requestDeviceToken(body, callback) {
|
|
202
222
|
this._cardService.requestDeviceToken(body, this._merchantId, this._inTestEnvironment, this._regional, callback);
|
|
203
|
-
}
|
|
204
|
-
|
|
223
|
+
}
|
|
224
|
+
_resolve(observable, callback) {
|
|
205
225
|
observable.subscribe({
|
|
206
|
-
error:
|
|
207
|
-
next:
|
|
226
|
+
error: (err) => Kushki.callbackError(err, callback),
|
|
227
|
+
next: (response) => {
|
|
208
228
|
callback(response);
|
|
209
|
-
}
|
|
229
|
+
},
|
|
210
230
|
});
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
}());
|
|
231
|
+
}
|
|
232
|
+
}
|
|
214
233
|
exports.Kushki = Kushki;
|
package/lib/KushkiInfo.js
CHANGED
|
@@ -2,18 +2,16 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Kushki file
|
|
4
4
|
*/
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.KInfo = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const PlatformCodeEnum_1 = require("./../lib/infrastructure/PlatformCodeEnum");
|
|
8
|
+
const UtilsService_1 = require("./../lib/service/UtilsService");
|
|
9
9
|
/**
|
|
10
10
|
* Implementation
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
KInfo.buildKushkiInfo = function (kushkiInfo) {
|
|
16
|
-
var kushki_js_version = "1.36.0";
|
|
12
|
+
class KInfo {
|
|
13
|
+
static buildKushkiInfo(kushkiInfo) {
|
|
14
|
+
const kushki_js_version = "1.37.0";
|
|
17
15
|
if (kushkiInfo) {
|
|
18
16
|
if (UtilsService_1.UtilsService.sIsEmpty(kushkiInfo.platformVersion))
|
|
19
17
|
kushkiInfo.platformVersion = kushki_js_version;
|
|
@@ -21,12 +19,11 @@ var KInfo = /** @class */ (function () {
|
|
|
21
19
|
}
|
|
22
20
|
return KInfo._encodeKushkiInfo({
|
|
23
21
|
platformId: PlatformCodeEnum_1.PlatformCodeEnum.KUSHKIJS,
|
|
24
|
-
platformVersion: kushki_js_version
|
|
22
|
+
platformVersion: kushki_js_version,
|
|
25
23
|
});
|
|
26
|
-
}
|
|
27
|
-
|
|
24
|
+
}
|
|
25
|
+
static _encodeKushkiInfo(kushkiInfo) {
|
|
28
26
|
return btoa(JSON.stringify(kushkiInfo));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
}());
|
|
27
|
+
}
|
|
28
|
+
}
|
|
32
29
|
exports.KInfo = KInfo;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CREDIT_CARD_ESPECIFICATIONS = void 0;
|
|
4
4
|
exports.CREDIT_CARD_ESPECIFICATIONS = {
|
|
5
5
|
cardFinalBinPlace: 8,
|
|
6
6
|
cardFinalBinPlaceSift: 6,
|
|
7
|
-
cardInitialBinPlace: 0
|
|
7
|
+
cardInitialBinPlace: 0,
|
|
8
8
|
};
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Injection identifiers
|
|
4
4
|
*/
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.IDENTIFIERS = void 0;
|
|
7
|
-
|
|
8
|
-
AntiFraud: Symbol
|
|
9
|
-
AuthService: Symbol
|
|
10
|
-
CardAsyncService: Symbol
|
|
11
|
-
CardDynamicService: Symbol
|
|
12
|
-
CardService: Symbol
|
|
13
|
-
CardSubscriptionDynamicService: Symbol
|
|
14
|
-
CashService: Symbol
|
|
15
|
-
CommissionService: Symbol
|
|
16
|
-
KPayService: Symbol
|
|
17
|
-
KushkiGateway: Symbol
|
|
18
|
-
KushkiService: Symbol
|
|
19
|
-
MobileProcessorService: Symbol
|
|
20
|
-
MultiMerchantService: Symbol
|
|
21
|
-
PayoutsCashService: Symbol
|
|
22
|
-
PayoutsTransferService: Symbol
|
|
23
|
-
SecureService: Symbol
|
|
24
|
-
SiftScienceService: Symbol
|
|
25
|
-
TransferService: Symbol
|
|
26
|
-
TransferSubscriptionService: Symbol
|
|
7
|
+
const IDENTIFIERS = {
|
|
8
|
+
AntiFraud: Symbol.for("AntiFraud"),
|
|
9
|
+
AuthService: Symbol.for("AuthService"),
|
|
10
|
+
CardAsyncService: Symbol.for("CardAsyncService"),
|
|
11
|
+
CardDynamicService: Symbol.for("CardDynamicService"),
|
|
12
|
+
CardService: Symbol.for("CardService"),
|
|
13
|
+
CardSubscriptionDynamicService: Symbol.for("CardSubscriptionDynamicService"),
|
|
14
|
+
CashService: Symbol.for("CashService"),
|
|
15
|
+
CommissionService: Symbol.for("CommissionService"),
|
|
16
|
+
KPayService: Symbol.for("KPayService"),
|
|
17
|
+
KushkiGateway: Symbol.for("KushkiGateway"),
|
|
18
|
+
KushkiService: Symbol.for("KushkiService"),
|
|
19
|
+
MobileProcessorService: Symbol.for("MobileProcessorService"),
|
|
20
|
+
MultiMerchantService: Symbol.for("MultiMerchantService"),
|
|
21
|
+
PayoutsCashService: Symbol.for("PayoutsCashService"),
|
|
22
|
+
PayoutsTransferService: Symbol.for("PayoutsTransferService"),
|
|
23
|
+
SecureService: Symbol.for("SecureService"),
|
|
24
|
+
SiftScienceService: Symbol.for("SiftScienceService"),
|
|
25
|
+
TransferService: Symbol.for("TransferService"),
|
|
26
|
+
TransferSubscriptionService: Symbol.for("TransferSubscriptionsService"),
|
|
27
27
|
};
|
|
28
28
|
exports.IDENTIFIERS = IDENTIFIERS;
|