@kushki/js 1.27.0 → 1.27.2-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.
@@ -60,5 +60,5 @@ export declare class CardService implements ICardService {
60
60
  private static _is3dsValid;
61
61
  private _setSandboxEnable;
62
62
  private _initCybersourceSandbox;
63
- private static _ccaSandbox;
63
+ private _ccaSandbox;
64
64
  }
@@ -85,6 +85,7 @@ var CardService = /** @class */ (function () {
85
85
  this._antiFraud = antiFraud;
86
86
  this._authService = authService;
87
87
  this._receipt = (_a = {
88
+ accountType: "accountType",
88
89
  amount: "totalAmount",
89
90
  "card.cvc": "card.cvv",
90
91
  "card.expiryMonth": "card.expiryMonth",
@@ -203,7 +204,7 @@ var CardService = /** @class */ (function () {
203
204
  if (this._sandboxEnable ||
204
205
  UtilsService_1.UtilsService.sGet(body, "security.paReq", ThreeDSEnum_1.ThreeDSEnum.SANDBOX) ===
205
206
  ThreeDSEnum_1.ThreeDSEnum.SANDBOX)
206
- return CardService_1._ccaSandbox(body, callback);
207
+ return this._ccaSandbox(body, mid, isTest, regional, callback);
207
208
  if (isTest) {
208
209
  // tslint:disable-next-line:no-duplicate-string
209
210
  Promise.resolve().then(function () { return require("cardinal-commerce-songbird-staging"); }).then(function () {
@@ -345,8 +346,10 @@ var CardService = /** @class */ (function () {
345
346
  // istanbul ignore next
346
347
  CardService._is3dsValid = function (secureOtpResponse) {
347
348
  return ("message" in secureOtpResponse &&
348
- secureOtpResponse.message === "3DS000" &&
349
- secureOtpResponse.code === "ok");
349
+ ((secureOtpResponse.message === "3DS000" &&
350
+ secureOtpResponse.code === "ok") ||
351
+ (secureOtpResponse.code === "3DS000" &&
352
+ secureOtpResponse.message === "ok")));
350
353
  };
351
354
  CardService.prototype._setSandboxEnable = function (payload) {
352
355
  this._sandboxEnable = payload;
@@ -358,7 +361,8 @@ var CardService = /** @class */ (function () {
358
361
  return jwt;
359
362
  }));
360
363
  };
361
- CardService._ccaSandbox = function (body, callback) {
364
+ CardService.prototype._ccaSandbox = function (body, mid, isTest, regional, callback) {
365
+ var _this = this;
362
366
  cardinal_sandbox_js_1.KushkiCardinalSandbox["continue"]("cca", {
363
367
  AcsUrl: body.security.acsURL,
364
368
  Payload: body.security.paReq
@@ -368,11 +372,28 @@ var CardService = /** @class */ (function () {
368
372
  }
369
373
  });
370
374
  // istanbul ignore next
371
- cardinal_sandbox_js_1.KushkiCardinalSandbox.on("payments.validated", function (isErrorFlow) {
372
- if (isErrorFlow === true)
373
- return Kushki_1.Kushki.callbackError(new KushkiError_1.KushkiError(ErrorEnum_1.ERRORS.E008), callback);
374
- callback({ isValid: true });
375
- });
375
+ cardinal_sandbox_js_1.KushkiCardinalSandbox.on("payments.validated", function (isErrorFlow) { return __awaiter(_this, void 0, void 0, function () {
376
+ var otp_request, secure;
377
+ return __generator(this, function (_a) {
378
+ if (isErrorFlow === true)
379
+ return [2 /*return*/, Kushki_1.Kushki.callbackError(new KushkiError_1.KushkiError(ErrorEnum_1.ERRORS.E008), callback)];
380
+ otp_request = {
381
+ otpValue: "",
382
+ secureServiceId: body.secureId
383
+ };
384
+ secure = this._gateway.requestSecureServiceValidation(mid, otp_request, isTest, regional);
385
+ return [2 /*return*/, secure.subscribe({
386
+ error: function (err) {
387
+ return Kushki_1.Kushki.callbackError(err, callback);
388
+ },
389
+ next: function (response) {
390
+ return callback({
391
+ isValid: CardService_1._is3dsValid(response)
392
+ });
393
+ }
394
+ })];
395
+ });
396
+ }); });
376
397
  };
377
398
  var CardService_1;
378
399
  CardService = CardService_1 = __decorate([
@@ -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.27.0",
3
+ "version": "1.27.2-alpha.12990.1",
4
4
  "description": "kushki-js",
5
5
  "main": "lib/lib.js",
6
6
  "types": "lib/lib.d.ts",
package/lib/.DS_Store DELETED
Binary file