@tap-payments/connect 0.0.12-test → 0.0.13-test
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 +24 -20
- package/build/@types/index.d.ts +2 -0
- package/build/constants/index.d.ts +1 -1
- package/build/constants/index.js +1 -1
- package/build/utils/config.d.ts +1 -1
- package/build/utils/config.js +4 -1
- package/package.json +103 -103
package/README.md
CHANGED
|
@@ -60,6 +60,8 @@ const ConnectExpressComponent = () => {
|
|
|
60
60
|
onClose={() => console.log('onClose')}
|
|
61
61
|
// optional (Callback function to handle the error)
|
|
62
62
|
onError={(err) => console.log('onError', err)}
|
|
63
|
+
// optional (Callback function runs after finishing all the flows)
|
|
64
|
+
onBoardCompleted={() => console.log('onBoardCompleted')}
|
|
63
65
|
/>
|
|
64
66
|
)
|
|
65
67
|
}
|
|
@@ -106,7 +108,7 @@ const ConnectFullComponent = () => {
|
|
|
106
108
|
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no"
|
|
107
109
|
/>
|
|
108
110
|
<title>Auth-JsConnect</title>
|
|
109
|
-
<script src="https://connect-auth.b-cdn.net/build-0.0.
|
|
111
|
+
<script src="https://connect-auth.b-cdn.net/build-0.0.13-test/main.js"></script>
|
|
110
112
|
</head>
|
|
111
113
|
<body>
|
|
112
114
|
<div id="root"></div>
|
|
@@ -131,6 +133,7 @@ const ConnectFullComponent = () => {
|
|
|
131
133
|
onCreated: (data) => console.log('onCreated', data),
|
|
132
134
|
onError: (err) => console.log('onError', err),
|
|
133
135
|
onClose: () => console.log('onClose'),
|
|
136
|
+
onBoardCompleted: () => console.log('onBoardCompleted'),
|
|
134
137
|
|
|
135
138
|
},
|
|
136
139
|
'root'
|
|
@@ -153,22 +156,23 @@ const ConnectFullComponent = () => {
|
|
|
153
156
|
|
|
154
157
|
## Properties
|
|
155
158
|
|
|
156
|
-
| name
|
|
157
|
-
|
|
|
158
|
-
| publicKey `required`
|
|
159
|
-
| domain `required`
|
|
160
|
-
| language `required`
|
|
161
|
-
| country `required`
|
|
162
|
-
| scope `required`
|
|
163
|
-
| lead `optional`
|
|
164
|
-
| mature `required`
|
|
165
|
-
| board `optional`
|
|
166
|
-
| open `required`
|
|
167
|
-
| postURL `optional`
|
|
168
|
-
|
|
|
169
|
-
| onReady `optional`
|
|
170
|
-
| onCreated `optional`
|
|
171
|
-
|
|
|
172
|
-
| onSuccess `optional`
|
|
173
|
-
| onError `optional`
|
|
174
|
-
| onClose `optional`
|
|
159
|
+
| name | type | description |
|
|
160
|
+
| --------------------------- | ----------- | -------------------------------------------------------------------------------------------- |
|
|
161
|
+
| publicKey `required` | `string` | Public key of the merchant account provided by Tap Payments |
|
|
162
|
+
| domain `required` | `string` | Domain of the merchant |
|
|
163
|
+
| language `required` | `Languages` | language flag to control the language of the connect element and only accept [ar,en] |
|
|
164
|
+
| country `required` | `string` | Country ISO2 of the merchant |
|
|
165
|
+
| scope `required` | `string` | the scope of the merchant |
|
|
166
|
+
| lead `optional` | `string` | Lead Id can be passed in case of you already created a lead using our API |
|
|
167
|
+
| mature `required` | `boolean` | Decide the mode of connect |
|
|
168
|
+
| board `optional` | `string` | Show/Hide board screens |
|
|
169
|
+
| open `required` | `boolean` | Open/Close the connect library |
|
|
170
|
+
| postURL `optional` | `string` | The POST Method URL used to push te data from our server to the merchant server and |
|
|
171
|
+
| | | it's required only if `mature` is `false` |
|
|
172
|
+
| onReady `optional` | `function` | Callback function to handle the ready state of the `TapConnect` |
|
|
173
|
+
| onCreated `optional` | `function` | Callback function to called the the account created successfully |
|
|
174
|
+
| | | it calls only if `mature` is `false` |
|
|
175
|
+
| onSuccess `optional` | `function` | Callback function to handle the success response, it will run after the user finish the flow |
|
|
176
|
+
| onError `optional` | `function` | Callback function to handle the error response, it will run if the user face any error |
|
|
177
|
+
| onClose `optional` | `function` | Callback function to called when `TapConnect` get close |
|
|
178
|
+
| onBoardCompleted `optional` | `function` | Callback function to called when you complete all flows |
|
package/build/@types/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface ConnectProps {
|
|
|
16
16
|
onClose?: () => void;
|
|
17
17
|
onCreated?: (res: object) => void;
|
|
18
18
|
onSuccess?: (res: object) => void;
|
|
19
|
+
onBoardCompleted?: () => void;
|
|
19
20
|
}
|
|
20
21
|
export interface OriginalConnectProps {
|
|
21
22
|
publicKey: string;
|
|
@@ -37,4 +38,5 @@ export interface OriginalConnectProps {
|
|
|
37
38
|
onBoardButtonClick?: (data: Record<string, any>) => void;
|
|
38
39
|
onCreated?: (res: Record<string, any>) => void;
|
|
39
40
|
onClose?: () => void;
|
|
41
|
+
onBoardCompleted?: () => void;
|
|
40
42
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CDN_LIBRARY_BASE_URL = "https://auth-jsconnect.b-cdn.net/build-2.1.
|
|
1
|
+
export declare const CDN_LIBRARY_BASE_URL = "https://auth-jsconnect.b-cdn.net/build-2.1.97-test";
|
|
2
2
|
export declare const Maturity: {
|
|
3
3
|
readonly FULL: "full";
|
|
4
4
|
readonly EXPRESS: "express";
|
package/build/constants/index.js
CHANGED
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, language, country, scope, lead, postURL, onError, onReady, onSuccess, board, verifyToken, domain, onBoardButtonClick, onClose, onCreated }: ConnectProps & ExtraProps) => OriginalConnectProps;
|
|
6
|
+
export declare const wrapLibConfig: ({ publicKey, open, language, country, scope, lead, postURL, onError, onReady, onSuccess, board, verifyToken, domain, onBoardButtonClick, onClose, onCreated, onBoardCompleted }: 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, 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;
|
|
2
|
+
var publicKey = _a.publicKey, open = _a.open, 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;
|
|
3
3
|
return {
|
|
4
4
|
appInfo: {
|
|
5
5
|
name: window.location.hostname || window.location.origin
|
|
@@ -32,6 +32,9 @@ export var wrapLibConfig = function (_a) {
|
|
|
32
32
|
onClose: function () {
|
|
33
33
|
onClose && onClose();
|
|
34
34
|
},
|
|
35
|
+
onBoardCompleted: function () {
|
|
36
|
+
onBoardCompleted && onBoardCompleted();
|
|
37
|
+
},
|
|
35
38
|
onStepCompleted: function (name, info) { },
|
|
36
39
|
onStepStarted: function (name) { }
|
|
37
40
|
};
|
package/package.json
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/connect",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Tap Connect",
|
|
5
|
-
"main": "build/index.js",
|
|
6
|
-
"module": "build/index.js",
|
|
7
|
-
"types": "build/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"build",
|
|
10
|
-
"README.md"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"husky:setup": "npx husky install",
|
|
14
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
|
|
15
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
|
|
16
|
-
"lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
|
|
17
|
-
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
|
|
18
|
-
"start": "cross-env NODE_ENV=development webpack serve",
|
|
19
|
-
"build": "cross-env NODE_ENV=production webpack",
|
|
20
|
-
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
21
|
-
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
22
|
-
"ts:build": "rm -rf build && tsc && yarn tsc:alias && yarn copy:files",
|
|
23
|
-
"push": "npm publish --access public"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [],
|
|
26
|
-
"author": {
|
|
27
|
-
"name": "Ahmed Elsharkawy",
|
|
28
|
-
"email": "a.elsharkawy@tap.company"
|
|
29
|
-
},
|
|
30
|
-
"license": "ISC",
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@babel/core": "^7.18.6",
|
|
33
|
-
"@babel/preset-env": "^7.18.6",
|
|
34
|
-
"@babel/preset-react": "^7.18.6",
|
|
35
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
36
|
-
"@types/crypto-js": "^4.1.1",
|
|
37
|
-
"@types/react": "^18.0.15",
|
|
38
|
-
"@types/react-dom": "^18.0.6",
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
40
|
-
"@typescript-eslint/parser": "^5.30.5",
|
|
41
|
-
"babel-loader": "^8.2.5",
|
|
42
|
-
"copyfiles": "^2.4.1",
|
|
43
|
-
"cross-env": "^7.0.3",
|
|
44
|
-
"css-loader": "^6.7.1",
|
|
45
|
-
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
46
|
-
"eslint": "^8.19.0",
|
|
47
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
48
|
-
"eslint-config-prettier": "^8.5.0",
|
|
49
|
-
"eslint-plugin-import": "^2.26.0",
|
|
50
|
-
"eslint-plugin-jsx-a11y": "^6.6.0",
|
|
51
|
-
"eslint-plugin-node": "^11.1.0",
|
|
52
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
53
|
-
"eslint-plugin-react": "^7.30.1",
|
|
54
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
55
|
-
"file-loader": "^6.2.0",
|
|
56
|
-
"fork-ts-checker-webpack-plugin": "^7.2.12",
|
|
57
|
-
"html-loader": "^3.1.2",
|
|
58
|
-
"html-webpack-plugin": "^5.5.0",
|
|
59
|
-
"husky": "^8.0.1",
|
|
60
|
-
"lint-staged": "^13.0.3",
|
|
61
|
-
"mini-css-extract-plugin": "^2.6.1",
|
|
62
|
-
"prettier": "^2.7.1",
|
|
63
|
-
"sass": "^1.53.0",
|
|
64
|
-
"sass-loader": "^13.0.2",
|
|
65
|
-
"style-loader": "^3.3.1",
|
|
66
|
-
"terser-webpack-plugin": "^5.3.3",
|
|
67
|
-
"tsc-alias": "^1.6.11",
|
|
68
|
-
"typescript": "^4.7.4",
|
|
69
|
-
"webpack": "^5.73.0",
|
|
70
|
-
"webpack-cli": "^4.10.0",
|
|
71
|
-
"webpack-dev-server": "^4.9.3",
|
|
72
|
-
"webpack-merge": "^5.8.0"
|
|
73
|
-
},
|
|
74
|
-
"dependencies": {
|
|
75
|
-
"react": "^18.2.0",
|
|
76
|
-
"react-dom": "^18.2.0"
|
|
77
|
-
},
|
|
78
|
-
"peerDependencies": {
|
|
79
|
-
"@types/react": ">=18.0.15",
|
|
80
|
-
"@types/react-dom": ">=18.0.6",
|
|
81
|
-
"react": ">=18.2.0",
|
|
82
|
-
"react-dom": ">=18.2.0"
|
|
83
|
-
},
|
|
84
|
-
"lint-staged": {
|
|
85
|
-
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
86
|
-
"yarn run prettier:fix",
|
|
87
|
-
"yarn run lint",
|
|
88
|
-
"git add ."
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
"browserslist": {
|
|
92
|
-
"production": [
|
|
93
|
-
">0.2%",
|
|
94
|
-
"not dead",
|
|
95
|
-
"not op_mini all"
|
|
96
|
-
],
|
|
97
|
-
"development": [
|
|
98
|
-
"last 1 chrome version",
|
|
99
|
-
"last 1 firefox version",
|
|
100
|
-
"last 1 safari version"
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/connect",
|
|
3
|
+
"version": "0.0.13-test",
|
|
4
|
+
"description": "Tap Connect",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"module": "build/index.js",
|
|
7
|
+
"types": "build/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"build",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"husky:setup": "npx husky install",
|
|
14
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
|
|
15
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
|
|
16
|
+
"lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
|
|
17
|
+
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
|
|
18
|
+
"start": "cross-env NODE_ENV=development webpack serve",
|
|
19
|
+
"build": "cross-env NODE_ENV=production webpack",
|
|
20
|
+
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
21
|
+
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
22
|
+
"ts:build": "rm -rf build && tsc && yarn tsc:alias && yarn copy:files",
|
|
23
|
+
"push": "npm publish --access public"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [],
|
|
26
|
+
"author": {
|
|
27
|
+
"name": "Ahmed Elsharkawy",
|
|
28
|
+
"email": "a.elsharkawy@tap.company"
|
|
29
|
+
},
|
|
30
|
+
"license": "ISC",
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@babel/core": "^7.18.6",
|
|
33
|
+
"@babel/preset-env": "^7.18.6",
|
|
34
|
+
"@babel/preset-react": "^7.18.6",
|
|
35
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
36
|
+
"@types/crypto-js": "^4.1.1",
|
|
37
|
+
"@types/react": "^18.0.15",
|
|
38
|
+
"@types/react-dom": "^18.0.6",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
40
|
+
"@typescript-eslint/parser": "^5.30.5",
|
|
41
|
+
"babel-loader": "^8.2.5",
|
|
42
|
+
"copyfiles": "^2.4.1",
|
|
43
|
+
"cross-env": "^7.0.3",
|
|
44
|
+
"css-loader": "^6.7.1",
|
|
45
|
+
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
46
|
+
"eslint": "^8.19.0",
|
|
47
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
48
|
+
"eslint-config-prettier": "^8.5.0",
|
|
49
|
+
"eslint-plugin-import": "^2.26.0",
|
|
50
|
+
"eslint-plugin-jsx-a11y": "^6.6.0",
|
|
51
|
+
"eslint-plugin-node": "^11.1.0",
|
|
52
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
53
|
+
"eslint-plugin-react": "^7.30.1",
|
|
54
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
55
|
+
"file-loader": "^6.2.0",
|
|
56
|
+
"fork-ts-checker-webpack-plugin": "^7.2.12",
|
|
57
|
+
"html-loader": "^3.1.2",
|
|
58
|
+
"html-webpack-plugin": "^5.5.0",
|
|
59
|
+
"husky": "^8.0.1",
|
|
60
|
+
"lint-staged": "^13.0.3",
|
|
61
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
62
|
+
"prettier": "^2.7.1",
|
|
63
|
+
"sass": "^1.53.0",
|
|
64
|
+
"sass-loader": "^13.0.2",
|
|
65
|
+
"style-loader": "^3.3.1",
|
|
66
|
+
"terser-webpack-plugin": "^5.3.3",
|
|
67
|
+
"tsc-alias": "^1.6.11",
|
|
68
|
+
"typescript": "^4.7.4",
|
|
69
|
+
"webpack": "^5.73.0",
|
|
70
|
+
"webpack-cli": "^4.10.0",
|
|
71
|
+
"webpack-dev-server": "^4.9.3",
|
|
72
|
+
"webpack-merge": "^5.8.0"
|
|
73
|
+
},
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"react": "^18.2.0",
|
|
76
|
+
"react-dom": "^18.2.0"
|
|
77
|
+
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"@types/react": ">=18.0.15",
|
|
80
|
+
"@types/react-dom": ">=18.0.6",
|
|
81
|
+
"react": ">=18.2.0",
|
|
82
|
+
"react-dom": ">=18.2.0"
|
|
83
|
+
},
|
|
84
|
+
"lint-staged": {
|
|
85
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
86
|
+
"yarn run prettier:fix",
|
|
87
|
+
"yarn run lint",
|
|
88
|
+
"git add ."
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"browserslist": {
|
|
92
|
+
"production": [
|
|
93
|
+
">0.2%",
|
|
94
|
+
"not dead",
|
|
95
|
+
"not op_mini all"
|
|
96
|
+
],
|
|
97
|
+
"development": [
|
|
98
|
+
"last 1 chrome version",
|
|
99
|
+
"last 1 firefox version",
|
|
100
|
+
"last 1 safari version"
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
}
|