@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.
|
|
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>
|
package/build/@types/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CDN_LIBRARY_BASE_URL = "https://auth-jsconnect.b-cdn.net/build-2.8.
|
|
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";
|
package/build/constants/index.js
CHANGED
|
@@ -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,
|
|
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(
|
|
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
|
-
}))
|
|
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
|
-
|
|
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
|
-
|
|
136
|
-
|
|
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(''),
|
|
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
|
|
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
|
|
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), {
|
|
27
|
+
var config = wrapLibConfig(__assign(__assign({}, props), { verifyToken: token, onBoardButtonClick: onButtonClick }));
|
|
32
28
|
switch (name) {
|
|
33
29
|
case 'brand':
|
|
34
30
|
unmountComponent();
|