@tap-payments/apple-pay-button 0.0.29-test → 0.0.31-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 +158 -155
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -25,109 +25,109 @@ yarn add @tap-payments/apple-pay-button
|
|
|
25
25
|
```javascript
|
|
26
26
|
import React from 'react'
|
|
27
27
|
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
ApplePayButton,
|
|
29
|
+
ThemeMode,
|
|
30
|
+
SupportedNetworks,
|
|
31
|
+
Scope,
|
|
32
|
+
Environment,
|
|
33
|
+
Locale,
|
|
34
|
+
ButtonType,
|
|
35
|
+
Edges
|
|
36
36
|
} from '@tap-payments/apple-pay-button'
|
|
37
37
|
|
|
38
38
|
const App = () => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
39
|
+
return (
|
|
40
|
+
<ApplePayButton
|
|
41
|
+
// The public Key provided by Tap
|
|
42
|
+
publicKey={'pk_test_xxxxxxxxxxxxxxxzh'}
|
|
43
|
+
//The environment of the SDK and it can be one of these environments
|
|
44
|
+
environment={Environment.Development}
|
|
45
|
+
//to enable the debug mode
|
|
46
|
+
debug
|
|
47
|
+
merchant={{
|
|
48
|
+
// The merchant domain name
|
|
49
|
+
domain: 'example.com',
|
|
50
|
+
// The merchant identifier provided by Tap
|
|
51
|
+
id: '1xxxxx8'
|
|
52
|
+
}}
|
|
53
|
+
transaction={{
|
|
54
|
+
// The amount to be charged
|
|
55
|
+
amount: '12',
|
|
56
|
+
// The currency of the amount
|
|
57
|
+
currency: 'KWD'
|
|
58
|
+
}}
|
|
59
|
+
// The scope of the SDK and it can be one of these scopes:
|
|
60
|
+
// [TapToken,AppleToken], by default it is TapToken)
|
|
61
|
+
scope={Scope.TapToken}
|
|
62
|
+
acceptance={{
|
|
63
|
+
// The supported networks for the Apple Pay button and it
|
|
64
|
+
// can be one of these networks: [Mada,Visa,MasterCard], by default
|
|
65
|
+
// we bring all the supported networks from tap merchant configuration
|
|
66
|
+
supportedBrands: [SupportedNetworks.Mada, SupportedNetworks.Visa, SupportedNetworks.MasterCard]
|
|
67
|
+
supportedCards : ["DEBIT","CREDIT"],
|
|
68
|
+
supportedCardsWithAuthentications : ["3DS","EMV"]
|
|
69
|
+
}}
|
|
70
|
+
// The billing contact information
|
|
71
|
+
customer={{
|
|
72
|
+
id: 'cus_xxx',
|
|
73
|
+
name: [
|
|
74
|
+
{
|
|
75
|
+
//"en or ar",
|
|
76
|
+
lang: Locale.EN,
|
|
77
|
+
// "First name of the customer.",
|
|
78
|
+
first: 'test',
|
|
79
|
+
//"Last name of the customer.",
|
|
80
|
+
last: 'tester',
|
|
81
|
+
// "Middle name of the customer.",
|
|
82
|
+
middle: 'test'
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
// Defines the contact details for the customer & to be used in creating the billing contact info in Apple pay request
|
|
86
|
+
contact: {
|
|
87
|
+
//"The customer's email",
|
|
88
|
+
email: 'test@gmail.com',
|
|
89
|
+
//"The customer's phone number"
|
|
90
|
+
phone: {
|
|
91
|
+
//"The customer's country code",
|
|
92
|
+
countryCode: '+20',
|
|
93
|
+
//"The customer's phone number
|
|
94
|
+
number: '10XXXXXX56'
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}}
|
|
98
|
+
//for styling button
|
|
99
|
+
interface={{
|
|
100
|
+
//The locale of the Apple Pay button and it can be one of these locales:[EN,AR]
|
|
101
|
+
locale: Locale.EN,
|
|
102
|
+
// The theme of the Apple Pay button and it can be one of
|
|
103
|
+
// these values : [light,Dark], by default it is detected from user device
|
|
104
|
+
theme: ThemeMode.DARK,
|
|
105
|
+
// The type of the Apple Pay
|
|
106
|
+
type: ButtonType.BUY,
|
|
107
|
+
// The border of the Apple Pay button and it can be one of these values:[curved,straight]
|
|
108
|
+
edges: Edges.CURVED
|
|
109
|
+
}}
|
|
110
|
+
// optional (A callback function that will be called when you cancel
|
|
111
|
+
// the payment process)
|
|
112
|
+
onCancel={() => console.log('cancelled')}
|
|
113
|
+
// optional (A callback function that will be called when you have an error)
|
|
114
|
+
onError={(err) => console.error(err)}
|
|
115
|
+
// optional (A async function that will be called after creating the token
|
|
116
|
+
// successfully)
|
|
117
|
+
onSuccess={async (token) => {
|
|
118
|
+
// do your stuff here...
|
|
119
|
+
console.log(token)
|
|
120
|
+
}}
|
|
121
|
+
// optional (A callback function that will be called when you button is clickable)
|
|
122
|
+
onReady={() => {
|
|
123
|
+
console.log('Ready')
|
|
124
|
+
}}
|
|
125
|
+
// optional (A callback function that will be called when the button clicked)
|
|
126
|
+
onClick={() => {
|
|
127
|
+
console.log('Clicked')
|
|
128
|
+
}}
|
|
129
|
+
/>
|
|
130
|
+
)
|
|
131
131
|
}
|
|
132
132
|
```
|
|
133
133
|
|
|
@@ -141,8 +141,8 @@ const App = () => {
|
|
|
141
141
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
142
142
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
143
143
|
<title>apple pay button</title>
|
|
144
|
-
<link rel="stylesheet" href="https://tap-sdks.b-cdn.net/apple-pay/build-
|
|
145
|
-
<script src="https://tap-sdks.b-cdn.net/apple-pay/build-
|
|
144
|
+
<link rel="stylesheet" href="https://tap-sdks.b-cdn.net/apple-pay/build-0.0.30-test//main.css" />
|
|
145
|
+
<script src="https://tap-sdks.b-cdn.net/apple-pay/build-0.0.30-test//main.js"></script>
|
|
146
146
|
</head>
|
|
147
147
|
|
|
148
148
|
<body>
|
|
@@ -150,59 +150,62 @@ const App = () => {
|
|
|
150
150
|
<script type="text/javascript">
|
|
151
151
|
const { renderApplePayButton, ButtonStyle, Scope, SupportedNetworks, Locale, ButtonType } = window.TapSDKs
|
|
152
152
|
renderApplePayButton(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
supportedCards
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
153
|
+
{
|
|
154
|
+
publicKey: 'pk_test_7xxxxxxxxx',
|
|
155
|
+
environment: Environment.Sandbox,
|
|
156
|
+
scope: Scope.TapToken,
|
|
157
|
+
merchant: {
|
|
158
|
+
domain: 'tp-txxxxxxxx',
|
|
159
|
+
id: 'merchant_xxxxxxxxxx'
|
|
160
|
+
},
|
|
161
|
+
transaction: {
|
|
162
|
+
currency: 'SAR',
|
|
163
|
+
amount: '3'
|
|
164
|
+
},
|
|
165
|
+
acceptance: {
|
|
166
|
+
supportedBrands: [SupportedNetworks.Mada, SupportedNetworks.Visa, SupportedNetworks.MasterCard],
|
|
167
|
+
supportedCards: ['DEBIT', 'CREDIT'],
|
|
168
|
+
supportedCardsWithAuthentications: ['3DS', 'EMV']
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
customer: {
|
|
172
|
+
id: 'cus_xxx',
|
|
173
|
+
name: [
|
|
174
|
+
{
|
|
175
|
+
locale: 'en',
|
|
176
|
+
first: 'test',
|
|
177
|
+
last: 'tester',
|
|
178
|
+
middle: 'test'
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
contact: {
|
|
182
|
+
email: 'test@gmail.com',
|
|
183
|
+
phone: {
|
|
181
184
|
number: '10XXXXXX56',
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
185
|
+
countryCode: '+20'
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
interface: {
|
|
190
|
+
locale: Locale.EN,
|
|
191
|
+
theme: ThemeMode.DARK,
|
|
192
|
+
type: ButtonType.BUY,
|
|
193
|
+
edges: Edges.CURVED
|
|
194
|
+
},
|
|
195
|
+
onCancel: async () => {
|
|
196
|
+
console.log('onCancel')
|
|
197
|
+
},
|
|
198
|
+
onError: async (error) => {
|
|
199
|
+
console.log('onError', error)
|
|
200
|
+
},
|
|
201
|
+
onSuccess: async (data) => {
|
|
202
|
+
console.log('onSuccess', data)
|
|
203
|
+
},
|
|
204
|
+
onReady: async () => {
|
|
205
|
+
console.log('onReady')
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
'apple-pay-button'
|
|
206
209
|
)
|
|
207
210
|
</script>
|
|
208
211
|
</body>
|
|
@@ -228,7 +231,7 @@ const App = () => {
|
|
|
228
231
|
| interface.locale | `Locale` | `optional` | The locale of the Apple Pay button |
|
|
229
232
|
| interface.type | `ButtonType` | `optional` | The type of the Apple Pay button |
|
|
230
233
|
| interface.edges | `ButtonType` | `optional` | The border of the Apple Pay button |
|
|
231
|
-
| customer | `object` | `optional` | The Customer details information
|
|
234
|
+
| customer | `object` | `optional` | The Customer details information |
|
|
232
235
|
| onCancel | `function` | `optional` | A callback function that will be called when you cancel the process |
|
|
233
236
|
| onError | `function` | `optional` | A callback function that will be called when you have an error |
|
|
234
237
|
| onSuccess | `function` | `optional` | A async function that will be called after creating the token successfully |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/apple-pay-button",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31-test",
|
|
4
4
|
"description": "Apple Pay Button React Component",
|
|
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 --tag test"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [],
|
|
26
26
|
"author": {
|