@tap-payments/connect 2.8.97-development → 2.9.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/README.md +34 -33
- package/build/@types/config.d.ts +5 -0
- package/build/@types/index.d.ts +5 -1
- package/build/constants/index.d.ts +5 -2
- package/build/constants/index.js +5 -2
- package/build/features/Connect/Connect.d.ts +1 -1
- package/build/features/Connect/ConnectAuth.d.ts +2 -2
- package/build/features/Connect/ConnectAuth.js +2 -1
- package/build/features/Connect/ConnectBank.d.ts +2 -2
- package/build/features/Connect/ConnectBank.js +2 -1
- package/build/features/Connect/ConnectBoard.d.ts +2 -2
- package/build/features/Connect/ConnectBoard.js +2 -1
- package/build/features/Connect/ConnectBrand.d.ts +2 -2
- package/build/features/Connect/ConnectBrand.js +2 -1
- package/build/features/Connect/ConnectEntity.d.ts +2 -2
- package/build/features/Connect/ConnectEntity.js +2 -1
- package/build/features/Connect/ConnectIndividual.d.ts +2 -2
- package/build/features/Connect/ConnectIndividual.js +2 -1
- package/build/features/Connect/ConnectPassword.d.ts +2 -2
- package/build/features/Connect/ConnectPassword.js +2 -1
- package/build/features/Connect/ConnectTax.d.ts +2 -2
- package/build/features/Connect/ConnectTax.js +2 -1
- package/build/utils/common.d.ts +2 -2
- package/build/utils/common.js +3 -3
- package/build/utils/config.d.ts +1 -1
- package/build/utils/config.js +3 -1
- package/build/utils/validation.d.ts +3 -3
- package/build/utils/validation.js +16 -4
- package/package.json +3 -3
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
|
|
88
|
+
<script src="https://cdn.tap.company/tap-sdks/connect/build-2.9.0/main.js"></script>
|
|
89
89
|
</head>
|
|
90
90
|
<body>
|
|
91
91
|
<div id="root"></div>
|
|
@@ -106,7 +106,7 @@ const ConnectComponent = () => {
|
|
|
106
106
|
mature: false,
|
|
107
107
|
board: true,
|
|
108
108
|
boardMaturity: false,
|
|
109
|
-
|
|
109
|
+
mode: "popup",
|
|
110
110
|
open: true,
|
|
111
111
|
postURL: 'https://api.example.com/post',
|
|
112
112
|
redirectUrl: '',
|
|
@@ -137,34 +137,35 @@ const ConnectComponent = () => {
|
|
|
137
137
|
|
|
138
138
|
## Properties
|
|
139
139
|
|
|
140
|
-
| name | type
|
|
141
|
-
| ----------------------------------------- |
|
|
142
|
-
| publicKey `required` | `string`
|
|
143
|
-
| domain `required` | `string`
|
|
144
|
-
| language `required` | `Languages`
|
|
145
|
-
| country `required` | `string`
|
|
146
|
-
| scope `required` | `string`
|
|
147
|
-
| data `optional` | `Array<string>`
|
|
148
|
-
| lead `optional` | `string`
|
|
149
|
-
| mode `required` | `string`
|
|
150
|
-
| mature `required` | `boolean`
|
|
151
|
-
| board `optional` | `string`
|
|
152
|
-
| open `required` | `boolean`
|
|
153
|
-
| features.dialogStartTransition `optional` | `left or right or up or down`
|
|
154
|
-
| features.dialogEndTransition `optional` | `left or right or up or down`
|
|
155
|
-
| features `object` | `all values true`
|
|
156
|
-
| loaderColor `optional` | `string`
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
|
|
|
163
|
-
|
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
140
|
+
| name | type | description |
|
|
141
|
+
| ----------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
142
|
+
| publicKey `required` | `string` | Public key of the merchant account provided by Tap Payments |
|
|
143
|
+
| domain `required` | `string` | Domain of the merchant |
|
|
144
|
+
| language `required` | `Languages` | language flag to control the language of the connect element and only accept [ar,en] |
|
|
145
|
+
| country `required` | `string` | Country ISO2 of the merchant |
|
|
146
|
+
| scope `required` | `string` | the scope of the merchant available values [merchant, auth] |
|
|
147
|
+
| data `optional` | `Array<string>` | Merchant data array `ex: [operator]` |
|
|
148
|
+
| lead `optional` | `string` | Lead Id can be passed in case of you already created a lead using our API |
|
|
149
|
+
| mode `required` | `string` | Decide to show connect as a `popup` or `page` or `content` to our connect domain. Default value is `popup`. `content` mode only used for board kit |
|
|
150
|
+
| mature `required` | `boolean` | Decide the mode of connect `normal` or `express` |
|
|
151
|
+
| board `optional` | `string` | Show/Hide board screens |
|
|
152
|
+
| open `required` | `boolean` | Open/Close the connect library |
|
|
153
|
+
| features.dialogStartTransition `optional` | `left or right or up or down` | Used to handle **auth** slide animation direction when open popup for auth kit |
|
|
154
|
+
| features.dialogEndTransition `optional` | `left or right or up or down` | Used to handle **auth** slide animation direction when close popup for auth kit |
|
|
155
|
+
| features `object` | `all values true` | Used to show or hide some fields (poweredBy, merchantLogo - Used to hide the merchant logo and it can be used only for auth kit, switchLanguage, overlay - Used to disable the background color and it can be used only for auth kit, loaderOverlay - Used to disable the loader background color and it can be used only for auth kit, tapTextLogo, closeButton - Used enable to close dialog, disableNafath - Used to hide nafath login button in **auth** kit, disablePaci - Used to hide paci login button in **auth** kit) |
|
|
156
|
+
| loaderColor `optional` | `string` | Used to change loader color and it can be used only for board kit |
|
|
157
|
+
| notification `optional` | `object: {email: boolean, mobile?: boolean}` | Express flow decide to send notification to email or mobile after finish create account |
|
|
158
|
+
| boardMaturity `optional` | `boolean` | Decide the board maturity |
|
|
159
|
+
| settingData `optional` | `boolean` | This is to get settings information. It is used board kit and other kits open from board |
|
|
160
|
+
| postURL `optional` | `string` | The POST Method URL used to push te data from our server to the merchant server and |
|
|
161
|
+
| | | it's required only if `mature` is `false` |
|
|
162
|
+
| redirectUrl `optional` | `string` | This redirect url after verify authentication go to merchant website |
|
|
163
|
+
| | | It is `required` if scope is `auth` and mode is `page` |
|
|
164
|
+
| onReady `optional` | `function` | Callback function to handle the ready state of the `TapConnect` |
|
|
165
|
+
| onCreated `optional` | `function` | Callback function to called the the account created successfully |
|
|
166
|
+
| | | it calls only if `mature` is `false` |
|
|
167
|
+
| onSuccess `optional` | `function` | Callback function to handle the success response, it will run after the user finish the flow |
|
|
168
|
+
| onError `optional` | `function` | Callback function to handle the error response, it will run if the user face any error |
|
|
169
|
+
| onClose `optional` | `function` | Callback function to called when `TapConnect` get close |
|
|
170
|
+
| onBoardCompleted `optional` | `function` | Callback function to called when you complete all flows |
|
|
171
|
+
| onSettingFetched `optional` | `function` | Callback function to called after fetch settings information. It is used board kit and other kits open from board |
|
package/build/@types/config.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface ConfigInfo {
|
|
|
10
10
|
connect?: Redirect;
|
|
11
11
|
platforms?: string[];
|
|
12
12
|
payment_provider?: PaymentProvider;
|
|
13
|
+
notification?: Notification;
|
|
13
14
|
}
|
|
14
15
|
export interface ConnectFeatures {
|
|
15
16
|
poweredBy?: boolean;
|
|
@@ -24,6 +25,10 @@ export interface ConnectFeatures {
|
|
|
24
25
|
disableNafath?: boolean;
|
|
25
26
|
disablePaci?: boolean;
|
|
26
27
|
}
|
|
28
|
+
export interface Notification {
|
|
29
|
+
email: boolean;
|
|
30
|
+
mobile?: boolean;
|
|
31
|
+
}
|
|
27
32
|
export interface PaymentProvider {
|
|
28
33
|
technology_id: string;
|
|
29
34
|
settlement_by: string;
|
package/build/@types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Language } from '../constants';
|
|
2
|
-
import { ConfigInfo, ConnectFeatures, SettingAsyncData } from './config';
|
|
2
|
+
import { ConfigInfo, ConnectFeatures, Notification, SettingAsyncData } from './config';
|
|
3
3
|
export interface ConnectProps {
|
|
4
4
|
elementId: string;
|
|
5
5
|
publicKey: string;
|
|
@@ -20,6 +20,8 @@ export interface ConnectProps {
|
|
|
20
20
|
data?: Array<string>;
|
|
21
21
|
settingData?: SettingAsyncData;
|
|
22
22
|
features?: ConnectFeatures;
|
|
23
|
+
notification?: Notification;
|
|
24
|
+
region?: string;
|
|
23
25
|
onError?: (err: Error) => void;
|
|
24
26
|
onReady?: () => void;
|
|
25
27
|
onClose?: () => void;
|
|
@@ -44,7 +46,9 @@ export interface OriginalConnectProps {
|
|
|
44
46
|
showBoard?: boolean;
|
|
45
47
|
boardMaturity?: boolean;
|
|
46
48
|
features?: ConnectFeatures;
|
|
49
|
+
notification?: Notification;
|
|
47
50
|
verifyToken?: string;
|
|
51
|
+
region?: string;
|
|
48
52
|
onFlowCompleted: (res: object, headers?: Record<string, string>) => void;
|
|
49
53
|
onError: (err: any) => void;
|
|
50
54
|
onStepCompleted?: (name: string, info: any) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CDN_LIBRARY_BASE_URL = "https://auth-jsconnect
|
|
1
|
+
export declare const CDN_LIBRARY_BASE_URL = "https://cdn.tap.company/tap-sdks/auth-jsconnect/build-2.9.1";
|
|
2
2
|
export declare const Maturity: {
|
|
3
3
|
readonly FULL: "full";
|
|
4
4
|
readonly EXPRESS: "express";
|
|
@@ -8,7 +8,10 @@ export declare const Language: {
|
|
|
8
8
|
readonly AR: "ar";
|
|
9
9
|
};
|
|
10
10
|
export declare const CONNECT_URL = "https://connect.tap.company/";
|
|
11
|
+
export declare const CONNECT_BETA_URL = "https://connect.beta.tap.company/";
|
|
12
|
+
export declare const CONNECT_SANDBOX_URL = "https://connect.sandbox.tap.company/";
|
|
11
13
|
export declare const CONNECT_DEV_URL = "https://connect.dev.tap.company/";
|
|
12
14
|
export declare const CONNECT_MW_URL = "https://connect-mw.tap.company/middleware/";
|
|
13
|
-
export declare const
|
|
15
|
+
export declare const CONNECT_MW_BETA_URL = "https://connect-mw.beta.tap.company/middleware/";
|
|
14
16
|
export declare const CONNECT_SANDBOX_MW_URL = "https://connect-mw.sandbox.tap.company/middleware/";
|
|
17
|
+
export declare const CONNECT_DEV_MW_URL = "https://connect-mw.dev.tap.company/middleware/";
|
package/build/constants/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export var CDN_LIBRARY_BASE_URL = 'https://auth-jsconnect
|
|
1
|
+
export var CDN_LIBRARY_BASE_URL = 'https://cdn.tap.company/tap-sdks/auth-jsconnect/build-2.9.1';
|
|
2
2
|
export var Maturity = {
|
|
3
3
|
FULL: 'full',
|
|
4
4
|
EXPRESS: 'express'
|
|
@@ -8,7 +8,10 @@ export var Language = {
|
|
|
8
8
|
AR: 'ar'
|
|
9
9
|
};
|
|
10
10
|
export var CONNECT_URL = 'https://connect.tap.company/';
|
|
11
|
+
export var CONNECT_BETA_URL = 'https://connect.beta.tap.company/';
|
|
12
|
+
export var CONNECT_SANDBOX_URL = 'https://connect.sandbox.tap.company/';
|
|
11
13
|
export var CONNECT_DEV_URL = 'https://connect.dev.tap.company/';
|
|
12
14
|
export var CONNECT_MW_URL = 'https://connect-mw.tap.company/middleware/';
|
|
13
|
-
export var
|
|
15
|
+
export var CONNECT_MW_BETA_URL = 'https://connect-mw.beta.tap.company/middleware/';
|
|
14
16
|
export var CONNECT_SANDBOX_MW_URL = 'https://connect-mw.sandbox.tap.company/middleware/';
|
|
17
|
+
export var CONNECT_DEV_MW_URL = 'https://connect-mw.dev.tap.company/middleware/';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConnectProps as ConnectAttrs } from '../../@types';
|
|
3
3
|
export type ConnectProps = Omit<ConnectAttrs, 'elementId'>;
|
|
4
|
-
export declare const TapConnect: React.MemoExoticComponent<(props: ConnectAttrs) => JSX.Element>;
|
|
4
|
+
export declare const TapConnect: React.MemoExoticComponent<(props: ConnectAttrs) => import("react/jsx-runtime").JSX.Element>;
|
|
5
5
|
export declare const renderTapConnect: (props: ConnectProps, elementId: string) => Promise<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConnectProps as ConnectAttrs } from '../../@types';
|
|
3
|
-
export type ConnectAuthProps = Pick<ConnectAttrs, 'open' | 'domain' | 'publicKey' | 'redirectUrl' | 'data' | 'postURL' | 'lead' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'features'>;
|
|
3
|
+
export type ConnectAuthProps = Pick<ConnectAttrs, 'open' | 'domain' | 'publicKey' | 'redirectUrl' | 'data' | 'postURL' | 'lead' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'features' | 'region'>;
|
|
4
4
|
export declare const TapConnectAuth: React.MemoExoticComponent<(props: ConnectAuthProps & {
|
|
5
5
|
id?: string;
|
|
6
|
-
}) => JSX.Element>;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
7
7
|
export declare const renderTapConnectAuth: (props: ConnectAuthProps, elementId: string) => Promise<any>;
|
|
@@ -84,7 +84,8 @@ var ConnectAuth = function (props) {
|
|
|
84
84
|
onError: props.onError,
|
|
85
85
|
onReady: props.onReady,
|
|
86
86
|
onClose: props.onClose,
|
|
87
|
-
features: props.features
|
|
87
|
+
features: props.features,
|
|
88
|
+
region: props.region
|
|
88
89
|
}, (_a = props.id) !== null && _a !== void 0 ? _a : 'tap-connect-auth-lib-id').unmount;
|
|
89
90
|
return function () {
|
|
90
91
|
unmount();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConnectProps as ConnectAttrs } from '../../@types';
|
|
3
|
-
type BankProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features'>;
|
|
3
|
+
type BankProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features' | 'region'>;
|
|
4
4
|
export type TapBankProps = BankProps & {
|
|
5
5
|
verifyToken: string;
|
|
6
6
|
onBoardButtonClick: (data: Record<string, string>) => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const TapBank: React.MemoExoticComponent<(props: TapBankProps & {
|
|
9
9
|
id?: string;
|
|
10
|
-
}) => JSX.Element>;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export declare const renderTapBank: (props: TapBankProps, elementId: string) => Promise<any>;
|
|
12
12
|
export {};
|
|
@@ -87,7 +87,8 @@ var Bank = function (props) {
|
|
|
87
87
|
onBoardButtonClick: props.onBoardButtonClick,
|
|
88
88
|
settingData: props.settingData,
|
|
89
89
|
onSettingFetched: props.onSettingFetched,
|
|
90
|
-
features: props.features
|
|
90
|
+
features: props.features,
|
|
91
|
+
region: props.region
|
|
91
92
|
}, (_a = props.id) !== null && _a !== void 0 ? _a : 'tap-connect-bank-lib-id').unmount;
|
|
92
93
|
return function () {
|
|
93
94
|
unmount();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConnectProps as ConnectAttrs } from '../../@types';
|
|
3
|
-
export type BoardProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'boardId' | 'settingData' | 'onSettingFetched' | 'features'>;
|
|
3
|
+
export type BoardProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'boardId' | 'settingData' | 'onSettingFetched' | 'features' | 'region'>;
|
|
4
4
|
export type TapBoardProps = BoardProps & {
|
|
5
5
|
onBoardButtonClick: (data: Record<string, string>) => void;
|
|
6
6
|
};
|
|
7
7
|
export declare const TapBoard: React.MemoExoticComponent<(props: TapBoardProps & {
|
|
8
8
|
id?: string;
|
|
9
|
-
}) => JSX.Element>;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
10
10
|
export declare const renderTapBoard: (props: TapBoardProps, elementId: string) => Promise<any>;
|
|
@@ -86,7 +86,8 @@ var Board = function (props) {
|
|
|
86
86
|
onBoardButtonClick: props.onBoardButtonClick,
|
|
87
87
|
settingData: props.settingData,
|
|
88
88
|
onSettingFetched: props.onSettingFetched,
|
|
89
|
-
features: props.features
|
|
89
|
+
features: props.features,
|
|
90
|
+
region: props.region
|
|
90
91
|
}, (_a = props.id) !== null && _a !== void 0 ? _a : 'tap-connect-board-lib-id').unmount;
|
|
91
92
|
return function () {
|
|
92
93
|
unmount();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConnectProps as ConnectAttrs } from '../../@types';
|
|
3
|
-
type BrandProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features'>;
|
|
3
|
+
type BrandProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features' | 'region'>;
|
|
4
4
|
export type TapBrandProps = BrandProps & {
|
|
5
5
|
verifyToken: string;
|
|
6
6
|
onBoardButtonClick: (data: Record<string, string>) => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const TapBrand: React.MemoExoticComponent<(props: TapBrandProps & {
|
|
9
9
|
id?: string;
|
|
10
|
-
}) => JSX.Element>;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export declare const renderTapBrand: (props: TapBrandProps, elementId: string) => Promise<any>;
|
|
12
12
|
export {};
|
|
@@ -87,7 +87,8 @@ var Brand = function (props) {
|
|
|
87
87
|
onBoardButtonClick: props.onBoardButtonClick,
|
|
88
88
|
settingData: props.settingData,
|
|
89
89
|
onSettingFetched: props.onSettingFetched,
|
|
90
|
-
features: props.features
|
|
90
|
+
features: props.features,
|
|
91
|
+
region: props.region
|
|
91
92
|
}, (_a = props.id) !== null && _a !== void 0 ? _a : 'tap-connect-brand-lib-id').unmount;
|
|
92
93
|
return function () {
|
|
93
94
|
unmount();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConnectProps as ConnectAttrs } from '../../@types';
|
|
3
|
-
type EntityProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features'>;
|
|
3
|
+
type EntityProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features' | 'region'>;
|
|
4
4
|
export type TapEntityProps = EntityProps & {
|
|
5
5
|
verifyToken: string;
|
|
6
6
|
onBoardButtonClick: (data: Record<string, string>) => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const TapEntity: React.MemoExoticComponent<(props: TapEntityProps & {
|
|
9
9
|
id?: string;
|
|
10
|
-
}) => JSX.Element>;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export declare const renderTapEntity: (props: TapEntityProps, elementId: string) => Promise<any>;
|
|
12
12
|
export {};
|
|
@@ -87,7 +87,8 @@ var Entity = function (props) {
|
|
|
87
87
|
onBoardButtonClick: props.onBoardButtonClick,
|
|
88
88
|
settingData: props.settingData,
|
|
89
89
|
onSettingFetched: props.onSettingFetched,
|
|
90
|
-
features: props.features
|
|
90
|
+
features: props.features,
|
|
91
|
+
region: props.region
|
|
91
92
|
}, (_a = props.id) !== null && _a !== void 0 ? _a : 'tap-connect-entity-lib-id').unmount;
|
|
92
93
|
return function () {
|
|
93
94
|
unmount();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConnectProps as ConnectAttrs } from '../../@types';
|
|
3
|
-
type IndividualProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features'>;
|
|
3
|
+
type IndividualProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features' | 'region'>;
|
|
4
4
|
export type TapIndividualProps = IndividualProps & {
|
|
5
5
|
verifyToken: string;
|
|
6
6
|
onBoardButtonClick: (data: Record<string, string>) => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const TapIndividual: React.MemoExoticComponent<(props: TapIndividualProps & {
|
|
9
9
|
id?: string;
|
|
10
|
-
}) => JSX.Element>;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export declare const renderTapIndividual: (props: TapIndividualProps, elementId: string) => Promise<any>;
|
|
12
12
|
export {};
|
|
@@ -87,7 +87,8 @@ var Individual = function (props) {
|
|
|
87
87
|
onBoardButtonClick: props.onBoardButtonClick,
|
|
88
88
|
settingData: props.settingData,
|
|
89
89
|
onSettingFetched: props.onSettingFetched,
|
|
90
|
-
features: props.features
|
|
90
|
+
features: props.features,
|
|
91
|
+
region: props.region
|
|
91
92
|
}, (_a = props.id) !== null && _a !== void 0 ? _a : 'tap-connect-individual-lib-id').unmount;
|
|
92
93
|
return function () {
|
|
93
94
|
unmount();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConnectProps as ConnectAttrs } from '../../@types';
|
|
3
|
-
type PasswordProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features'>;
|
|
3
|
+
type PasswordProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features' | 'region'>;
|
|
4
4
|
export type TapPasswordProps = PasswordProps & {
|
|
5
5
|
verifyToken: string;
|
|
6
6
|
onBoardButtonClick: (data: Record<string, string>) => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const TapPassword: React.MemoExoticComponent<(props: TapPasswordProps & {
|
|
9
9
|
id?: string;
|
|
10
|
-
}) => JSX.Element>;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export declare const renderTapPassword: (props: TapPasswordProps, elementId: string) => Promise<any>;
|
|
12
12
|
export {};
|
|
@@ -87,7 +87,8 @@ var Password = function (props) {
|
|
|
87
87
|
onBoardButtonClick: props.onBoardButtonClick,
|
|
88
88
|
settingData: props.settingData,
|
|
89
89
|
onSettingFetched: props.onSettingFetched,
|
|
90
|
-
features: props.features
|
|
90
|
+
features: props.features,
|
|
91
|
+
region: props.region
|
|
91
92
|
}, (_a = props.id) !== null && _a !== void 0 ? _a : 'tap-connect-password-lib-id').unmount;
|
|
92
93
|
return function () {
|
|
93
94
|
unmount();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConnectProps as ConnectAttrs } from '../../@types';
|
|
3
|
-
type TaxProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features'>;
|
|
3
|
+
type TaxProps = Pick<ConnectAttrs, 'open' | 'mode' | 'scope' | 'domain' | 'board' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'loaderColor' | 'settingData' | 'onSettingFetched' | 'features' | 'region'>;
|
|
4
4
|
export type TapTaxProps = TaxProps & {
|
|
5
5
|
verifyToken: string;
|
|
6
6
|
onBoardButtonClick: (data: Record<string, string>) => void;
|
|
7
7
|
};
|
|
8
8
|
export declare const TapTax: React.MemoExoticComponent<(props: TapTaxProps & {
|
|
9
9
|
id?: string;
|
|
10
|
-
}) => JSX.Element>;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export declare const renderTapTax: (props: TapTaxProps, elementId: string) => Promise<any>;
|
|
12
12
|
export {};
|
|
@@ -87,7 +87,8 @@ var Tax = function (props) {
|
|
|
87
87
|
onBoardButtonClick: props.onBoardButtonClick,
|
|
88
88
|
settingData: props.settingData,
|
|
89
89
|
onSettingFetched: props.onSettingFetched,
|
|
90
|
-
features: props.features
|
|
90
|
+
features: props.features,
|
|
91
|
+
region: props.region
|
|
91
92
|
}, (_a = props.id) !== null && _a !== void 0 ? _a : 'tap-connect-tax-lib-id').unmount;
|
|
92
93
|
return function () {
|
|
93
94
|
unmount();
|
package/build/utils/common.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getBaseUrl: (publicKey: string) => "https://connect-mw.tap.company/middleware/" | "https://connect-mw.
|
|
2
|
-
export declare const getRedirectBaseUrl: (publicKey: string) => "https://connect.tap.company/" | "https://connect.
|
|
1
|
+
export declare const getBaseUrl: (publicKey: string) => "https://connect-mw.tap.company/middleware/" | "https://connect-mw.sandbox.tap.company/middleware/";
|
|
2
|
+
export declare const getRedirectBaseUrl: (publicKey: string) => "https://connect.tap.company/" | "https://connect.sandbox.tap.company/";
|
package/build/utils/common.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CONNECT_MW_URL,
|
|
1
|
+
import { CONNECT_MW_URL, CONNECT_SANDBOX_MW_URL, CONNECT_SANDBOX_URL, CONNECT_URL } from '../constants';
|
|
2
2
|
var isProd = function (publicKey) {
|
|
3
3
|
return publicKey.includes('pk_live');
|
|
4
4
|
};
|
|
@@ -6,11 +6,11 @@ export var getBaseUrl = function (publicKey) {
|
|
|
6
6
|
if (isProd(publicKey)) {
|
|
7
7
|
return CONNECT_MW_URL;
|
|
8
8
|
}
|
|
9
|
-
return
|
|
9
|
+
return CONNECT_SANDBOX_MW_URL;
|
|
10
10
|
};
|
|
11
11
|
export var getRedirectBaseUrl = function (publicKey) {
|
|
12
12
|
if (isProd(publicKey)) {
|
|
13
13
|
return CONNECT_URL;
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return CONNECT_SANDBOX_URL;
|
|
16
16
|
};
|
package/build/utils/config.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ type ExtraProps = {
|
|
|
3
3
|
verifyToken?: string;
|
|
4
4
|
onBoardButtonClick?: (data: Record<string, string>) => void;
|
|
5
5
|
};
|
|
6
|
-
export declare const wrapLibConfig: ({ publicKey, open, mode, language, country, scope, lead, postURL, onError, onReady, onSuccess, board, verifyToken, domain, onBoardButtonClick, onClose, onCreated, onBoardCompleted, boardMaturity, data, redirectUrl, features }: ConnectProps & ExtraProps) => OriginalConnectProps;
|
|
6
|
+
export declare const wrapLibConfig: ({ publicKey, open, mode, language, country, scope, lead, postURL, onError, onReady, onSuccess, board, verifyToken, domain, onBoardButtonClick, onClose, onCreated, onBoardCompleted, boardMaturity, data, redirectUrl, features, notification, region }: ConnectProps & ExtraProps) => OriginalConnectProps;
|
|
7
7
|
export {};
|
package/build/utils/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export var wrapLibConfig = function (_a) {
|
|
2
|
-
var publicKey = _a.publicKey, open = _a.open, mode = _a.mode, language = _a.language, country = _a.country, scope = _a.scope, lead = _a.lead, postURL = _a.postURL, onError = _a.onError, onReady = _a.onReady, onSuccess = _a.onSuccess, board = _a.board, verifyToken = _a.verifyToken, domain = _a.domain, onBoardButtonClick = _a.onBoardButtonClick, onClose = _a.onClose, onCreated = _a.onCreated, onBoardCompleted = _a.onBoardCompleted, boardMaturity = _a.boardMaturity, data = _a.data, redirectUrl = _a.redirectUrl, features = _a.features;
|
|
2
|
+
var publicKey = _a.publicKey, open = _a.open, mode = _a.mode, language = _a.language, country = _a.country, scope = _a.scope, lead = _a.lead, postURL = _a.postURL, onError = _a.onError, onReady = _a.onReady, onSuccess = _a.onSuccess, board = _a.board, verifyToken = _a.verifyToken, domain = _a.domain, onBoardButtonClick = _a.onBoardButtonClick, onClose = _a.onClose, onCreated = _a.onCreated, onBoardCompleted = _a.onBoardCompleted, boardMaturity = _a.boardMaturity, data = _a.data, redirectUrl = _a.redirectUrl, features = _a.features, notification = _a.notification, region = _a.region;
|
|
3
3
|
return {
|
|
4
4
|
appInfo: {
|
|
5
5
|
name: window.location.hostname || window.location.origin
|
|
@@ -19,6 +19,8 @@ export var wrapLibConfig = function (_a) {
|
|
|
19
19
|
boardMaturity: boardMaturity,
|
|
20
20
|
verifyToken: verifyToken,
|
|
21
21
|
features: features,
|
|
22
|
+
notification: notification,
|
|
23
|
+
region: region,
|
|
22
24
|
onFlowCompleted: function (res) {
|
|
23
25
|
onSuccess && onSuccess(res);
|
|
24
26
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConnectProps } from '../@types';
|
|
2
2
|
export declare const validateConnectProps: (props: ConnectProps) => void;
|
|
3
|
-
export declare const validateConnectAuthProps: (props: Pick<ConnectProps, 'open' | 'domain' | 'publicKey' | 'redirectUrl' | 'data' | 'postURL' | 'lead' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose'>) => void;
|
|
4
|
-
export declare const validateBoardProps: (props: Pick<ConnectProps, 'open' | 'domain' | 'scope' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'boardId'>) => void;
|
|
5
|
-
export declare const validateBoardOtherKitsProps: (props: Pick<ConnectProps, "open" | "domain" | "publicKey" | "postURL" | "country" | "language" | "onSuccess" | "onError" | "onReady" | "onClose" | "scope"> & {
|
|
3
|
+
export declare const validateConnectAuthProps: (props: Pick<ConnectProps, 'open' | 'domain' | 'publicKey' | 'redirectUrl' | 'data' | 'postURL' | 'lead' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'region'>) => void;
|
|
4
|
+
export declare const validateBoardProps: (props: Pick<ConnectProps, 'open' | 'domain' | 'scope' | 'publicKey' | 'postURL' | 'country' | 'language' | 'onSuccess' | 'onError' | 'onReady' | 'onClose' | 'boardId' | 'region'>) => void;
|
|
5
|
+
export declare const validateBoardOtherKitsProps: (props: Pick<ConnectProps, "open" | "domain" | "publicKey" | "postURL" | "country" | "language" | "onSuccess" | "onError" | "onReady" | "onClose" | "region" | "scope"> & {
|
|
6
6
|
verifyToken: string;
|
|
7
7
|
onBoardButtonClick: (data: Record<string, string>) => void;
|
|
8
8
|
}) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Language } from '../constants';
|
|
2
2
|
export var validateConnectProps = function (props) {
|
|
3
|
-
var mode = props.mode, publicKey = props.publicKey, mature = props.mature, language = props.language, scope = props.scope, open = props.open, domain = props.domain, board = props.board, lead = props.lead, onClose = props.onClose, onCreated = props.onCreated, onError = props.onError, onReady = props.onReady, onSuccess = props.onSuccess, postURL = props.postURL, redirectUrl = props.redirectUrl;
|
|
3
|
+
var mode = props.mode, publicKey = props.publicKey, mature = props.mature, language = props.language, scope = props.scope, open = props.open, domain = props.domain, board = props.board, lead = props.lead, onClose = props.onClose, onCreated = props.onCreated, onError = props.onError, onReady = props.onReady, onSuccess = props.onSuccess, postURL = props.postURL, redirectUrl = props.redirectUrl, region = props.region;
|
|
4
4
|
if (!mode) {
|
|
5
5
|
throw new Error('mode is required');
|
|
6
6
|
}
|
|
@@ -40,6 +40,9 @@ export var validateConnectProps = function (props) {
|
|
|
40
40
|
if (typeof postURL !== 'undefined' && typeof postURL !== 'string') {
|
|
41
41
|
throw new Error('postURL must be a string');
|
|
42
42
|
}
|
|
43
|
+
if (typeof region !== 'undefined' && typeof region !== 'string') {
|
|
44
|
+
throw new Error('region must be a string');
|
|
45
|
+
}
|
|
43
46
|
if (typeof onClose !== 'undefined' && typeof onClose !== 'function') {
|
|
44
47
|
throw new Error('onClose must be a function');
|
|
45
48
|
}
|
|
@@ -57,7 +60,7 @@ export var validateConnectProps = function (props) {
|
|
|
57
60
|
}
|
|
58
61
|
};
|
|
59
62
|
export var validateConnectAuthProps = function (props) {
|
|
60
|
-
var publicKey = props.publicKey, country = props.country, language = props.language, open = props.open, domain = props.domain, lead = props.lead, onClose = props.onClose, onError = props.onError, onReady = props.onReady, onSuccess = props.onSuccess, postURL = props.postURL, data = props.data;
|
|
63
|
+
var publicKey = props.publicKey, country = props.country, language = props.language, open = props.open, domain = props.domain, lead = props.lead, onClose = props.onClose, onError = props.onError, onReady = props.onReady, onSuccess = props.onSuccess, postURL = props.postURL, data = props.data, region = props.region;
|
|
61
64
|
if (!data) {
|
|
62
65
|
throw new Error('data is required');
|
|
63
66
|
}
|
|
@@ -88,6 +91,9 @@ export var validateConnectAuthProps = function (props) {
|
|
|
88
91
|
if (typeof postURL !== 'undefined' && typeof postURL !== 'string') {
|
|
89
92
|
throw new Error('postURL must be a string');
|
|
90
93
|
}
|
|
94
|
+
if (typeof region !== 'undefined' && typeof region !== 'string') {
|
|
95
|
+
throw new Error('region must be a string');
|
|
96
|
+
}
|
|
91
97
|
if (typeof onClose !== 'undefined' && typeof onClose !== 'function') {
|
|
92
98
|
throw new Error('onClose must be a function');
|
|
93
99
|
}
|
|
@@ -102,7 +108,7 @@ export var validateConnectAuthProps = function (props) {
|
|
|
102
108
|
}
|
|
103
109
|
};
|
|
104
110
|
export var validateBoardProps = function (props) {
|
|
105
|
-
var publicKey = props.publicKey, country = props.country, scope = props.scope, language = props.language, open = props.open, domain = props.domain, onClose = props.onClose, onError = props.onError, onReady = props.onReady, onSuccess = props.onSuccess, postURL = props.postURL, boardId = props.boardId;
|
|
111
|
+
var publicKey = props.publicKey, country = props.country, scope = props.scope, language = props.language, open = props.open, domain = props.domain, onClose = props.onClose, onError = props.onError, onReady = props.onReady, onSuccess = props.onSuccess, postURL = props.postURL, boardId = props.boardId, region = props.region;
|
|
106
112
|
if (!publicKey) {
|
|
107
113
|
throw new Error('publicKey is required');
|
|
108
114
|
}
|
|
@@ -130,6 +136,9 @@ export var validateBoardProps = function (props) {
|
|
|
130
136
|
if (typeof postURL !== 'undefined' && typeof postURL !== 'string') {
|
|
131
137
|
throw new Error('postURL must be a string');
|
|
132
138
|
}
|
|
139
|
+
if (typeof region !== 'undefined' && typeof region !== 'string') {
|
|
140
|
+
throw new Error('region must be a string');
|
|
141
|
+
}
|
|
133
142
|
if (typeof onClose !== 'undefined' && typeof onClose !== 'function') {
|
|
134
143
|
throw new Error('onClose must be a function');
|
|
135
144
|
}
|
|
@@ -144,7 +153,7 @@ export var validateBoardProps = function (props) {
|
|
|
144
153
|
}
|
|
145
154
|
};
|
|
146
155
|
export var validateBoardOtherKitsProps = function (props) {
|
|
147
|
-
var publicKey = props.publicKey, country = props.country, scope = props.scope, language = props.language, open = props.open, domain = props.domain, onClose = props.onClose, onError = props.onError, onReady = props.onReady, onSuccess = props.onSuccess, postURL = props.postURL, verifyToken = props.verifyToken, onBoardButtonClick = props.onBoardButtonClick;
|
|
156
|
+
var publicKey = props.publicKey, country = props.country, scope = props.scope, language = props.language, open = props.open, domain = props.domain, onClose = props.onClose, onError = props.onError, onReady = props.onReady, onSuccess = props.onSuccess, postURL = props.postURL, verifyToken = props.verifyToken, onBoardButtonClick = props.onBoardButtonClick, region = props.region;
|
|
148
157
|
if (!publicKey) {
|
|
149
158
|
throw new Error('publicKey is required');
|
|
150
159
|
}
|
|
@@ -172,6 +181,9 @@ export var validateBoardOtherKitsProps = function (props) {
|
|
|
172
181
|
if (typeof postURL !== 'undefined' && typeof postURL !== 'string') {
|
|
173
182
|
throw new Error('postURL must be a string');
|
|
174
183
|
}
|
|
184
|
+
if (typeof region !== 'undefined' && typeof region !== 'string') {
|
|
185
|
+
throw new Error('region must be a string');
|
|
186
|
+
}
|
|
175
187
|
if (typeof onClose !== 'undefined' && typeof onClose !== 'function') {
|
|
176
188
|
throw new Error('onClose must be a function');
|
|
177
189
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/connect",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Tap Connect",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"module": "build/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
21
21
|
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
22
22
|
"ts:build": "rm -rf build && tsc && yarn tsc:alias && yarn copy:files",
|
|
23
|
-
"push": "npm publish --access public
|
|
23
|
+
"push": "npm publish --access public"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [],
|
|
26
26
|
"author": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"husky": "^8.0.1",
|
|
61
61
|
"lint-staged": "^13.0.3",
|
|
62
62
|
"mini-css-extract-plugin": "^2.6.1",
|
|
63
|
-
"prettier": "
|
|
63
|
+
"prettier": "2.7.1",
|
|
64
64
|
"sass": "^1.53.0",
|
|
65
65
|
"sass-loader": "^13.0.2",
|
|
66
66
|
"style-loader": "^3.3.1",
|