@kushki/js 1.40.2 → 1.40.3-alpha.19108.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/KushkiInfo.js CHANGED
@@ -12,7 +12,7 @@ const UtilsService_1 = require("./../lib/service/UtilsService");
12
12
  */
13
13
  class KInfo {
14
14
  static buildKushkiInfo(kushkiInfo) {
15
- const kushki_js_version = "1.40.2";
15
+ const kushki_js_version = "1.40.3-alpha.19108.0";
16
16
  if (kushkiInfo) {
17
17
  if (UtilsService_1.UtilsService.sIsEmpty(kushkiInfo.platformVersion))
18
18
  kushkiInfo.platformVersion = kushki_js_version;
@@ -3,7 +3,7 @@
3
3
  * Environment enum file
4
4
  */
5
5
  export declare enum EnvironmentEnum {
6
- uat = "https://api-uat.kushkipagos.com/",
6
+ uat = "https://ecomm-dev-01-us-east-1.kushki.dev/",
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-uat.kushkipagos.com/";
9
+ EnvironmentEnum["uat"] = "https://ecomm-dev-01-us-east-1.kushki.dev/";
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/";
@@ -66,7 +66,7 @@ let ApplePayService = ApplePayService_1 = class ApplePayService {
66
66
  } }, options.optionalApplePayFields);
67
67
  const session = new window.ApplePaySession(this._getSupportedApplePayVersion(), session_params);
68
68
  session.onvalidatemerchant = (event) => this._onValidateMerchant(event, mid, session, options, isTest, regional, callback);
69
- session.onpaymentauthorized = (event) => this._onPaymentAuthorized(event, mid, session, isTest, regional, callback);
69
+ session.onpaymentauthorized = (event) => this._onPaymentAuthorized(event, mid, session, isTest, regional, options.isSubscription, callback);
70
70
  session.oncancel = () => {
71
71
  onCancel();
72
72
  };
@@ -150,10 +150,10 @@ let ApplePayService = ApplePayService_1 = class ApplePayService {
150
150
  }
151
151
  });
152
152
  }
153
- _onPaymentAuthorized(event, mid, session, isTest, regional, callback) {
153
+ _onPaymentAuthorized(event, mid, session, isTest, regional, isSubscription = false, callback) {
154
154
  return __awaiter(this, void 0, void 0, function* () {
155
155
  try {
156
- const apple_token = Object.assign(Object.assign({}, event.payment.token.paymentData), { paymentMethod: event.payment.token.paymentMethod });
156
+ const apple_token = Object.assign(Object.assign({}, event.payment.token.paymentData), { isSubscription, paymentMethod: event.payment.token.paymentMethod });
157
157
  const kushki_token = yield this._gateway
158
158
  .getApplePayToken(apple_token, mid, isTest, regional)
159
159
  .toPromise();
@@ -41,6 +41,7 @@ export interface ApplePayPaymentData {
41
41
  signature: string;
42
42
  version: string;
43
43
  paymentMethod?: ApplePayPaymentMethod;
44
+ isSubscription?: boolean;
44
45
  }
45
46
  export interface ApplePayPaymentMethod {
46
47
  network: string;
@@ -6,6 +6,7 @@ export interface ApplePayGetTokenOptions {
6
6
  currencyCode: "USD" | "COP" | "CLP" | "UF" | "PEN" | "MXN" | "BRL" | "CRC" | "GTQ" | "HNL" | "NIO";
7
7
  displayName: string;
8
8
  amount: number;
9
+ isSubscription?: boolean;
9
10
  optionalApplePayFields?: {
10
11
  [k: string]: any;
11
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kushki/js",
3
- "version": "1.40.2",
3
+ "version": "1.40.3-alpha.19108.0",
4
4
  "description": "kushki-js",
5
5
  "main": "lib/lib.js",
6
6
  "types": "lib/lib.d.ts",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "scripts": {
19
19
  "publish:latest": "npm run build && npm publish",
20
- "publish:alpha": "npm run build && npm publish --tag alpha",
20
+ "publish:alpha": "npm run build && npm publish --tag alpha.19108.0",
21
21
  "prepare": "npm run tsc:interface && npm run test:unit && npm run test:coverage && npm run build:npm",
22
22
  "tsc:interface": "kushki json2ts",
23
23
  "tsc:check": "tsc --project tsconfig.check.json --noEmit",