@kushki/js 1.27.0-dev.12985.1 → 1.27.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/.DS_Store ADDED
Binary file
@@ -3,7 +3,7 @@
3
3
  * Environment enum file
4
4
  */
5
5
  export declare enum EnvironmentEnum {
6
- uat = "https://api-qa.kushkipagos.com/",
6
+ uat = "https://api-uat.kushkipagos.com/",
7
7
  prod = "https://api.kushkipagos.com/",
8
8
  regionalUat = "https://regional-uat.kushkipagos.com/",
9
9
  regionalProd = "https://regional.kushkipagos.com/"
@@ -6,7 +6,7 @@ exports.EnvironmentEnum = void 0;
6
6
  */
7
7
  var EnvironmentEnum;
8
8
  (function (EnvironmentEnum) {
9
- EnvironmentEnum["uat"] = "https://api-qa.kushkipagos.com/";
9
+ EnvironmentEnum["uat"] = "https://api-uat.kushkipagos.com/";
10
10
  EnvironmentEnum["prod"] = "https://api.kushkipagos.com/";
11
11
  EnvironmentEnum["regionalUat"] = "https://regional-uat.kushkipagos.com/";
12
12
  EnvironmentEnum["regionalProd"] = "https://regional.kushkipagos.com/";
@@ -35,6 +35,7 @@ export declare class CardService implements ICardService {
35
35
  private readonly _antiFraud;
36
36
  private readonly _authService;
37
37
  private readonly _3Dsecure;
38
+ private readonly _cardNumber;
38
39
  private _sandboxEnable;
39
40
  constructor(gateway: IKushkiGateway, authService: IAuthService, antiFraud: IAntiFraud);
40
41
  requestToken(request: TokenRequest | TokenKPayRequest, mid: string, isTest: boolean, regional: boolean): Observable<TokenResponse>;
@@ -77,27 +77,30 @@ var UtilsService_1 = require("./../../lib/service/UtilsService");
77
77
  var Kushki_1 = require("./../../lib/Kushki");
78
78
  var CardService = /** @class */ (function () {
79
79
  function CardService(gateway, authService, antiFraud) {
80
+ var _a;
80
81
  this._3Dsecure = "active_3dsecure";
82
+ this._cardNumber = "card.number";
81
83
  this._sandboxEnable = false;
82
84
  this._gateway = gateway;
83
85
  this._antiFraud = antiFraud;
84
86
  this._authService = authService;
85
- this._receipt = {
86
- amount: "totalAmount",
87
- "card.cvc": "card.cvv",
88
- "card.expiryMonth": "card.expiryMonth",
89
- "card.expiryYear": "card.expiryYear",
90
- "card.name": "card.name",
91
- "card.number": "card.number",
92
- currency: "currency",
93
- isDeferred: "isDeferred",
94
- jwt: "jwt",
95
- months: "months",
96
- savePaymentData: "savePaymentData",
97
- sessionId: "sessionId",
98
- userId: "userId",
99
- walletId: "walletId"
100
- };
87
+ this._receipt = (_a = {
88
+ amount: "totalAmount",
89
+ "card.cvc": "card.cvv",
90
+ "card.expiryMonth": "card.expiryMonth",
91
+ "card.expiryYear": "card.expiryYear",
92
+ "card.name": "card.name"
93
+ },
94
+ _a[this._cardNumber] = this._cardNumber,
95
+ _a.currency = "currency",
96
+ _a.isDeferred = "isDeferred",
97
+ _a.jwt = "jwt",
98
+ _a.months = "months",
99
+ _a.savePaymentData = "savePaymentData",
100
+ _a.sessionId = "sessionId",
101
+ _a.userId = "userId",
102
+ _a.walletId = "walletId",
103
+ _a);
101
104
  }
102
105
  CardService_1 = CardService;
103
106
  CardService.prototype.requestToken = function (request, mid, isTest, regional) {
@@ -155,12 +158,19 @@ var CardService = /** @class */ (function () {
155
158
  CardService.prototype.requestSubscriptionToken = function (subscriptionTokenRequest, mid, isTest, regional) {
156
159
  var _this = this;
157
160
  return this._gateway.requestMerchantSettings(mid, isTest, regional).pipe(operators_1.switchMap(function (merchant) {
158
- return _this._getScienceSession(subscriptionTokenRequest, mid, isTest, merchant);
159
- }), operators_1.concatMap(function (siftObject) {
161
+ _this._setSandboxEnable(!!merchant.sandboxEnable);
162
+ return rxjs_1.forkJoin([
163
+ _this._getScienceSession(subscriptionTokenRequest, mid, isTest, merchant),
164
+ _this._getCybersourceJwt(merchant, mid, isTest, regional, UtilsService_1.UtilsService.sGet(subscriptionTokenRequest, _this._cardNumber)),
165
+ ]);
166
+ }), operators_1.concatMap(function (_a) {
167
+ var sift_object = _a[0], jwt = _a[1];
160
168
  _this._checkRequestBody(subscriptionTokenRequest);
161
169
  var data_to_transform = __assign({}, subscriptionTokenRequest);
162
- if (siftObject.userId === null || siftObject.sessionId === null)
163
- data_to_transform.siftObject = __assign({}, siftObject);
170
+ if (sift_object.userId === null || sift_object.sessionId === null)
171
+ data_to_transform.siftObject = __assign({}, sift_object);
172
+ if (jwt !== undefined)
173
+ data_to_transform.jwt = jwt;
164
174
  return rxjs_1.forkJoin([
165
175
  rxjs_1.of(dot.transform(_this._receipt, data_to_transform)),
166
176
  subscriptionTokenRequest.walletId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kushki/js",
3
- "version": "1.27.0-dev.12985.1",
3
+ "version": "1.27.0",
4
4
  "description": "kushki-js",
5
5
  "main": "lib/lib.js",
6
6
  "types": "lib/lib.d.ts",