@tap-payments/connect 0.0.4-test → 0.0.6-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
CHANGED
|
@@ -28,67 +28,67 @@ yarn add @tap-payments/connect
|
|
|
28
28
|
import { TapConnect, Language } from '@tap-payments/connect'
|
|
29
29
|
|
|
30
30
|
// we have two ways to use the connect element
|
|
31
|
-
// 1-
|
|
31
|
+
// 1- express flow
|
|
32
32
|
const ConnectExpressComponent = () => {
|
|
33
33
|
return (
|
|
34
34
|
<TapConnect
|
|
35
35
|
// required (the public key of the merchant account provided by Tap Payments)
|
|
36
36
|
publicKey={'pk_test_XXXXXXXXXXXXXXXXXXXXXXX'}
|
|
37
|
-
// required (boolean to open/close the connect element)
|
|
38
|
-
open={true}
|
|
39
|
-
// required (the country ISO2 of the merchant)
|
|
40
|
-
country={'SA'}
|
|
41
|
-
// required (Language flag to control the language of the connect element and only we support [en,ar])
|
|
42
|
-
language={Language.EN}
|
|
43
|
-
// required (Decide the maturity of the TapConnect library)
|
|
44
|
-
mature={true}
|
|
45
37
|
// required (the domain of the merchant)
|
|
46
38
|
domain={'https://example.com'}
|
|
39
|
+
// required (Language flag to control the language of the connect element and only we support [en,ar])
|
|
40
|
+
language={Language.EN}
|
|
41
|
+
// required (the country ISO2 of the merchant)
|
|
42
|
+
country={'SA'}
|
|
47
43
|
// required (the scope of the merchant)
|
|
48
44
|
scope={'merchant'}
|
|
49
45
|
// optional (Lead Id can be passed in case of you already created a lead using our API )
|
|
50
46
|
lead={'led_xxxxxxxxxxxxxxxxxxxxxx'}
|
|
51
|
-
//
|
|
52
|
-
|
|
47
|
+
// required (Decide the maturity of the TapConnect library)
|
|
48
|
+
mature={false}
|
|
53
49
|
// optional (show/hide board screen after creating an account)
|
|
54
50
|
board={true}
|
|
55
|
-
//
|
|
56
|
-
|
|
51
|
+
// required (boolean to open/close the connect element)
|
|
52
|
+
open={true}
|
|
53
|
+
// optional (The POST Method URL used to push te data from our server to the merchant server)
|
|
54
|
+
postURL={'https://api.example.com/post'}
|
|
57
55
|
//optional (Callback function to handle the ready state of the TapConnect )
|
|
58
56
|
onReady={() => console.log('onReady')}
|
|
59
|
-
// optional (Callback function runs when the user close TaConnect)
|
|
60
|
-
onClose={() => console.log('onClose')}
|
|
61
57
|
// optional (Callback function runs after creating an account)
|
|
62
58
|
onCreated={(data) => console.log('onCreated', data)}
|
|
59
|
+
// optional (Callback function runs when the user close TaConnect)
|
|
60
|
+
onClose={() => console.log('onClose')}
|
|
61
|
+
// optional (Callback function to handle the error)
|
|
62
|
+
onError={(err) => console.log('onError', err)}
|
|
63
63
|
/>
|
|
64
64
|
)
|
|
65
65
|
}
|
|
66
|
-
// 2-
|
|
66
|
+
// 2- full flow
|
|
67
67
|
const ConnectFullComponent = () => {
|
|
68
68
|
return (
|
|
69
69
|
<TapConnect
|
|
70
70
|
// required (the public key of the merchant account provided by Tap Payments)
|
|
71
71
|
publicKey={'pk_test_XXXXXXXXXXXXXXXXXXXXXXX'}
|
|
72
|
-
// required (boolean to open/close the connect element)
|
|
73
|
-
open={true}
|
|
74
|
-
// required (the country ISO2 of the merchant)
|
|
75
|
-
country={'SA'}
|
|
76
|
-
// required (Language flag to control the language of the connect element and only we support [en,ar])
|
|
77
|
-
language={Language.EN}
|
|
78
|
-
// required (Decide the maturity of the TapConnect library)
|
|
79
|
-
mature={false}
|
|
80
72
|
// required (the domain of the merchant)
|
|
81
73
|
domain={'https://example.com'}
|
|
74
|
+
// required (Language flag to control the language of the connect element and only we support [en,ar])
|
|
75
|
+
language={Language.EN}
|
|
76
|
+
// required (the country ISO2 of the merchant)
|
|
77
|
+
country={'SA'}
|
|
82
78
|
// required (the scope of the merchant)
|
|
83
79
|
scope={'merchant'}
|
|
84
|
-
//
|
|
85
|
-
|
|
80
|
+
// required (Decide the maturity of the TapConnect library)
|
|
81
|
+
mature={true}
|
|
82
|
+
// required (boolean to open/close the connect element)
|
|
83
|
+
open={true}
|
|
86
84
|
//optional (Callback function to handle the ready state of the TapConnect )
|
|
87
85
|
onReady={() => console.log('onReady')}
|
|
88
|
-
// optional (Callback function runs when the user close TaConnect)
|
|
89
|
-
onClose={() => console.log('onClose')}
|
|
90
86
|
// optional (Callback function runs after finishing the flow)
|
|
91
87
|
onSuccess={(data) => console.log('onSuccess', data)}
|
|
88
|
+
// optional (Callback function runs when the user close TaConnect)
|
|
89
|
+
onClose={() => console.log('onClose')}
|
|
90
|
+
// optional (Callback function to handle the error)
|
|
91
|
+
onError={(err) => console.log('onError', err)}
|
|
92
92
|
/>
|
|
93
93
|
)
|
|
94
94
|
}
|
|
@@ -106,7 +106,7 @@ const ConnectFullComponent = () => {
|
|
|
106
106
|
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no"
|
|
107
107
|
/>
|
|
108
108
|
<title>Auth-JsConnect</title>
|
|
109
|
-
<script src="https://connect-auth.b-cdn.net/build-0.0.
|
|
109
|
+
<script src="https://connect-auth.b-cdn.net/build-0.0.5-test/main.js"></script>
|
|
110
110
|
</head>
|
|
111
111
|
<body>
|
|
112
112
|
<div id="root"></div>
|
|
@@ -117,21 +117,21 @@ const ConnectFullComponent = () => {
|
|
|
117
117
|
const startConnectAuth = () => {
|
|
118
118
|
const { unmount } = renderTapConnect(
|
|
119
119
|
{
|
|
120
|
-
publicKey: '
|
|
121
|
-
open: true,
|
|
122
|
-
country: 'SA',
|
|
120
|
+
publicKey: 'pk_test_xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
123
121
|
language: Language.EN,
|
|
124
|
-
mature: true,
|
|
125
122
|
domain: 'https://example.com',
|
|
123
|
+
country: 'SA',
|
|
126
124
|
scope: 'merchant',
|
|
127
|
-
lead: '
|
|
128
|
-
|
|
125
|
+
lead: 'led_xxxxxxxxxxxxxxxxxxxxxx',
|
|
126
|
+
mature: false,
|
|
129
127
|
board: true,
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
open: true,
|
|
129
|
+
postURL: 'https://api.example.com/post',
|
|
132
130
|
onReady: () => console.log('onReady'),
|
|
131
|
+
onCreated: (data) => console.log('onCreated', data),
|
|
132
|
+
onError: (err) => console.log('onError', err),
|
|
133
133
|
onClose: () => console.log('onClose'),
|
|
134
|
-
|
|
134
|
+
|
|
135
135
|
},
|
|
136
136
|
'root'
|
|
137
137
|
)
|
|
@@ -165,10 +165,10 @@ const ConnectFullComponent = () => {
|
|
|
165
165
|
| board `optional` | `string` | Show/Hide board screens |
|
|
166
166
|
| open `required` | `boolean` | Open/Close the connect library |
|
|
167
167
|
| postURL `optional` | `string` | The POST Method URL used to push te data from our server to the merchant server and |
|
|
168
|
-
| | | it's required only if `mature` is `
|
|
169
|
-
| onError `optional` | `function` | Callback function to handle the error response, it will run if the user face any error |
|
|
168
|
+
| | | it's required only if `mature` is `false` |
|
|
170
169
|
| onReady `optional` | `function` | Callback function to handle the ready state of the `TapConnect` |
|
|
171
|
-
| onClose `optional` | `function` | Callback function to called when `TapConnect` get close |
|
|
172
170
|
| onCreated `optional` | `function` | Callback function to called the the account created successfully |
|
|
173
|
-
| | | it calls only if `mature` is `
|
|
171
|
+
| | | it calls only if `mature` is `false` |
|
|
174
172
|
| onSuccess `optional` | `function` | Callback function to handle the success response, it will run after the user finish the flow |
|
|
173
|
+
| onError `optional` | `function` | Callback function to handle the error response, it will run if the user face any error |
|
|
174
|
+
| onClose `optional` | `function` | Callback function to called when `TapConnect` get close |
|