@tap-payments/connect 2.8.0 → 2.8.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.
package/README.md CHANGED
@@ -85,7 +85,7 @@ const ConnectComponent = () => {
85
85
  content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no"
86
86
  />
87
87
  <title>Auth-JsConnect</title>
88
- <script src="https://tap-sdks.b-cdn.net/connect/build-2.8.0/main.js"></script>
88
+ <script src="https://tap-sdks.b-cdn.net/connect/build-2.8.1/main.js"></script>
89
89
  </head>
90
90
  <body>
91
91
  <div id="root"></div>
@@ -11,7 +11,6 @@ export interface ConfigInfo {
11
11
  platforms?: string[];
12
12
  payment_provider?: PaymentProvider;
13
13
  notification?: Notification;
14
- country?: string;
15
14
  }
16
15
  export interface ConnectFeatures {
17
16
  poweredBy?: boolean;
@@ -1,4 +1,4 @@
1
- export declare const CDN_LIBRARY_BASE_URL = "https://auth-jsconnect.b-cdn.net/build-2.8.0";
1
+ export declare const CDN_LIBRARY_BASE_URL = "https://auth-jsconnect.b-cdn.net/build-2.8.1";
2
2
  export declare const Maturity: {
3
3
  readonly FULL: "full";
4
4
  readonly EXPRESS: "express";
@@ -1,4 +1,4 @@
1
- export var CDN_LIBRARY_BASE_URL = 'https://auth-jsconnect.b-cdn.net/build-2.8.0';
1
+ export var CDN_LIBRARY_BASE_URL = 'https://auth-jsconnect.b-cdn.net/build-2.8.1';
2
2
  export var Maturity = {
3
3
  FULL: 'full',
4
4
  EXPRESS: 'express'
@@ -87,14 +87,14 @@ export var TapConnect = React.memo(function (props) {
87
87
  });
88
88
  var tapConnectInstance = null;
89
89
  export var renderTapConnect = function (props, elementId) { return __awaiter(void 0, void 0, void 0, function () {
90
- var mode, board, publicKey, boardMaturity, language, country, scope, lead, postURL, mature, onError, redirectUrl, AuthData, payload, _a, data, publicKeyValue, _b, token, connect, baseUrl, countryCode, fallbackURL_1, url_1, fallbackURL, url, el, root, unmount;
90
+ var mode, board, publicKey, boardMaturity, language, country, scope, lead, postURL, mature, onError, redirectUrl, AuthData, payload, _a, data, publicKeyValue, _b, token, connect, baseUrl, url_1, countryCode, url, el, root, unmount;
91
91
  return __generator(this, function (_c) {
92
92
  switch (_c.label) {
93
93
  case 0:
94
94
  props.mode = props.mode || 'popup';
95
95
  mode = props.mode, board = props.board, publicKey = props.publicKey, boardMaturity = props.boardMaturity, language = props.language, country = props.country, scope = props.scope, lead = props.lead, postURL = props.postURL, mature = props.mature, onError = props.onError, redirectUrl = props.redirectUrl, AuthData = props.data;
96
96
  if (!(mode === 'page')) return [3, 2];
97
- payload = __assign(__assign(__assign(__assign(__assign({ operator: {
97
+ payload = __assign(__assign(__assign(__assign({ operator: {
98
98
  public_key: publicKey
99
99
  }, scope: scope }, (AuthData && {
100
100
  data: AuthData
@@ -113,7 +113,7 @@ export var renderTapConnect = function (props, elementId) { return __awaiter(voi
113
113
  post: {
114
114
  url: postURL
115
115
  }
116
- })), { country: country });
116
+ }));
117
117
  return [4, generateConfigToken(payload)];
118
118
  case 1:
119
119
  _a = _c.sent(), data = _a.data, publicKeyValue = _a.publicKey;
@@ -123,19 +123,13 @@ export var renderTapConnect = function (props, elementId) { return __awaiter(voi
123
123
  }
124
124
  _b = data || {}, token = _b.token, connect = _b.connect;
125
125
  baseUrl = getRedirectBaseUrl(publicKeyValue || '');
126
- countryCode = (country !== null && country !== void 0 ? country : '').toLowerCase();
127
126
  if (!mature || scope === 'auth') {
128
- fallbackURL_1 = "".concat(baseUrl, "?config_token=").concat(token);
129
- if (country)
130
- fallbackURL_1 += "&country_code=".concat(country);
131
- url_1 = (connect === null || connect === void 0 ? void 0 : connect.url) || fallbackURL_1;
127
+ url_1 = (connect === null || connect === void 0 ? void 0 : connect.url) || "".concat(baseUrl, "?config_token=").concat(token);
132
128
  window.location.href = url_1;
133
129
  return [2];
134
130
  }
135
- fallbackURL = "".concat(baseUrl).concat(countryCode, "?config_token=").concat(token);
136
- if (country)
137
- fallbackURL += "&country_code=".concat(country);
138
- url = (connect === null || connect === void 0 ? void 0 : connect.url) || fallbackURL;
131
+ countryCode = country.toLowerCase();
132
+ url = (connect === null || connect === void 0 ? void 0 : connect.url) || "".concat(baseUrl).concat(countryCode, "?config_token=").concat(token);
139
133
  window.location.href = url;
140
134
  return [2];
141
135
  case 2:
@@ -12,23 +12,19 @@ var __assign = (this && this.__assign) || function () {
12
12
  import * as React from 'react';
13
13
  import { wrapLibConfig } from '../../utils';
14
14
  var ConnectExpress = function (props) {
15
- var _a;
16
- var _b = React.useState(''), token = _b[0], setToken = _b[1];
17
- var _c = React.useState('express'), name = _c[0], setName = _c[1];
18
- var _d = React.useState((_a = props.country) !== null && _a !== void 0 ? _a : ''), busCountryCode = _d[0], setBusCountryCode = _d[1];
15
+ var _a = React.useState(''), token = _a[0], setToken = _a[1];
16
+ var _b = React.useState('express'), name = _b[0], setName = _b[1];
19
17
  var onButtonClick = function (_a) {
20
- var name = _a.name, token = _a.token, countryCode = _a.countryCode;
18
+ var name = _a.name, token = _a.token;
21
19
  setToken(token);
22
20
  setName(name);
23
- if (countryCode)
24
- setBusCountryCode(countryCode);
25
21
  };
26
- var _e = window['TapAuth'], renderConnectExpressLib = _e.renderConnectExpressLib, renderIndividualLib = _e.renderIndividualLib, renderBankLib = _e.renderBankLib, renderTaxLib = _e.renderTaxLib, renderEntityLib = _e.renderEntityLib, renderBrandLib = _e.renderBrandLib;
22
+ var _c = window['TapAuth'], renderConnectExpressLib = _c.renderConnectExpressLib, renderIndividualLib = _c.renderIndividualLib, renderBankLib = _c.renderBankLib, renderTaxLib = _c.renderTaxLib, renderEntityLib = _c.renderEntityLib, renderBrandLib = _c.renderBrandLib;
27
23
  var elementId = props.elementId;
28
24
  var unmountComponent = function () { };
29
25
  React.useEffect(function () {
30
26
  console.log('rendering: ', name);
31
- var config = wrapLibConfig(__assign(__assign({}, props), { country: busCountryCode, verifyToken: token, onBoardButtonClick: onButtonClick }));
27
+ var config = wrapLibConfig(__assign(__assign({}, props), { verifyToken: token, onBoardButtonClick: onButtonClick }));
32
28
  switch (name) {
33
29
  case 'brand':
34
30
  unmountComponent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/connect",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Tap Connect",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.js",