@kushki/js 1.26.4 → 1.27.0-alpha.12990.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.
@@ -14,7 +14,6 @@ export declare enum ErrorCode {
14
14
  E008 = "E008",
15
15
  E009 = "E009",
16
16
  E010 = "E010",
17
- E011 = "E011",
18
- E012 = "E012"
17
+ E011 = "E011"
19
18
  }
20
19
  export declare const ERRORS: KushkiErrors;
@@ -16,7 +16,6 @@ var ErrorCode;
16
16
  ErrorCode["E009"] = "E009";
17
17
  ErrorCode["E010"] = "E010";
18
18
  ErrorCode["E011"] = "E011";
19
- ErrorCode["E012"] = "E012";
20
19
  })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
21
20
  exports.ERRORS = (_a = {},
22
21
  _a[ErrorCode.E001] = {
@@ -74,9 +73,4 @@ exports.ERRORS = (_a = {},
74
73
  message: "Sesión no disponible.",
75
74
  statusCode: StatusCodeEnum_1.StatusCodeEnum.BadRequest
76
75
  },
77
- _a[ErrorCode.E012] = {
78
- code: ErrorCode.E012,
79
- message: "Campos 3DS inválidos",
80
- statusCode: StatusCodeEnum_1.StatusCodeEnum.BadRequest
81
- },
82
76
  _a);
@@ -43,7 +43,6 @@ export declare class CardService implements ICardService {
43
43
  requestDeferred(binBody: BinBody, mid: string, isTest: boolean, regional: boolean): Observable<IDeferredResponse[]>;
44
44
  requestBinInfo(binBody: BinBody, mid: string, isTest: boolean, regional: boolean): Observable<BinInfoResponse>;
45
45
  validate3DS(body: Validate3DSRequest, mid: string, isTest: boolean, regional: boolean, callback: (value: Validate3DsResponse | ErrorResponse) => void): void;
46
- private _validateParameters;
47
46
  private _checkCardLength;
48
47
  private _getScienceSession;
49
48
  private _checkCurrency;
@@ -83,6 +83,7 @@ var CardService = /** @class */ (function () {
83
83
  this._antiFraud = antiFraud;
84
84
  this._authService = authService;
85
85
  this._receipt = {
86
+ accountType: "accountType",
86
87
  amount: "totalAmount",
87
88
  "card.cvc": "card.cvv",
88
89
  "card.expiryMonth": "card.expiryMonth",
@@ -175,16 +176,10 @@ var CardService = /** @class */ (function () {
175
176
  };
176
177
  CardService.prototype.validate3DS = function (body, mid, isTest, regional, callback) {
177
178
  var _this = this;
178
- // tslint:disable-next-line
179
- if (body.security === undefined)
180
- return Kushki_1.Kushki.callbackError(new KushkiError_1.KushkiError(ErrorEnum_1.ERRORS.E012), callback);
181
179
  if (!UtilsService_1.UtilsService.sGet(body, "security.authRequired", false)) {
182
180
  callback({ isValid: true });
183
181
  return;
184
182
  }
185
- if (UtilsService_1.UtilsService.sGet(body, "security.authRequired") &&
186
- this._validateParameters(body))
187
- return Kushki_1.Kushki.callbackError(new KushkiError_1.KushkiError(ErrorEnum_1.ERRORS.E012), callback);
188
183
  if (this._sandboxEnable ||
189
184
  UtilsService_1.UtilsService.sGet(body, "security.paReq", ThreeDSEnum_1.ThreeDSEnum.SANDBOX) ===
190
185
  ThreeDSEnum_1.ThreeDSEnum.SANDBOX)
@@ -208,11 +203,6 @@ var CardService = /** @class */ (function () {
208
203
  });
209
204
  }
210
205
  };
211
- CardService.prototype._validateParameters = function (body) {
212
- return (body.security.acsURL === undefined ||
213
- body.security.paReq === undefined ||
214
- body.security.authenticationTransactionId === undefined);
215
- };
216
206
  CardService.prototype._checkCardLength = function (request) {
217
207
  if (request.card.number.length < 14 || request.card.number.length > 19)
218
208
  throw new KushkiError_1.KushkiError(ErrorEnum_1.ERRORS.E005);
@@ -343,10 +333,8 @@ var CardService = /** @class */ (function () {
343
333
  }
344
334
  });
345
335
  // istanbul ignore next
346
- cardinal_sandbox_js_1.KushkiCardinalSandbox.on("payments.validated", function (isErrorFlow) {
347
- if (isErrorFlow === true)
348
- return Kushki_1.Kushki.callbackError(new KushkiError_1.KushkiError(ErrorEnum_1.ERRORS.E008), callback);
349
- callback({ isValid: true });
336
+ cardinal_sandbox_js_1.KushkiCardinalSandbox.on("payments.validated", function () {
337
+ return callback({ isValid: true });
350
338
  });
351
339
  };
352
340
  var CardService_1;
@@ -15,5 +15,6 @@ export interface TokenRequest {
15
15
  amount: number | string;
16
16
  months?: number;
17
17
  savePaymentData?: boolean;
18
+ accountType?: "CR" | "CA" | "CC";
18
19
  [k: string]: any;
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kushki/js",
3
- "version": "1.26.4",
3
+ "version": "1.27.0-alpha.12990.1",
4
4
  "description": "kushki-js",
5
5
  "main": "lib/lib.js",
6
6
  "types": "lib/lib.d.ts",
@@ -95,7 +95,7 @@
95
95
  },
96
96
  "dependencies": {
97
97
  "@aws-amplify/auth": "3.4.22",
98
- "@kushki/cardinal-sandbox-js": "1.0.1",
98
+ "@kushki/cardinal-sandbox-js": "1.0.0",
99
99
  "acorn": "6.4.1",
100
100
  "aws-amplify": "3.3.19",
101
101
  "axios": "0.21.1",