@tap-payments/apple-pay-button 1.0.0 → 1.0.1-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/LICENSE +21 -21
- package/README.md +240 -194
- package/build/@types/ApplePaySession.d.ts +67 -0
- package/build/@types/ApplePaySession.js +1 -0
- package/build/@types/index.d.ts +118 -73
- package/build/@types/index.js +1 -1
- package/build/api/app.service.d.ts +23 -11
- package/build/api/app.service.js +253 -217
- package/build/api/base.d.ts +9 -9
- package/build/api/base.js +45 -45
- package/build/api/httpClient.d.ts +8 -2
- package/build/api/httpClient.js +33 -16
- package/build/constants/index.d.ts +59 -26
- package/build/constants/index.js +59 -26
- package/build/features/ApplePayButton/ApplePayButton.css +21 -51
- package/build/features/ApplePayButton/ApplePayButton.d.ts +7 -6
- package/build/features/ApplePayButton/ApplePayButton.js +65 -51
- package/build/features/ApplePayButton/index.d.ts +3 -3
- package/build/features/ApplePayButton/index.js +2 -2
- package/build/hooks/index.d.ts +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/useApplePay.d.ts +10 -9
- package/build/hooks/useApplePay.js +342 -206
- package/build/hooks/useGetEvents.d.ts +4 -0
- package/build/hooks/useGetEvents.js +15 -0
- package/build/hooks/useScript.d.ts +1 -1
- package/build/hooks/useScript.js +39 -39
- package/build/index.d.ts +4 -4
- package/build/index.js +15 -9
- package/build/utils/config.d.ts +13 -9
- package/build/utils/config.js +76 -54
- package/build/utils/defaultValues.d.ts +32 -0
- package/build/utils/defaultValues.js +48 -0
- package/build/utils/html.d.ts +1 -1
- package/build/utils/html.js +9 -9
- package/build/utils/index.d.ts +1 -1
- package/build/utils/index.js +1 -1
- package/package.json +104 -102
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Tap Payments
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Tap Payments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,194 +1,240 @@
|
|
|
1
|
-
# apple-pay-button
|
|
2
|
-
|
|
3
|
-
Handling Apple Pay button in React and vanilla JS
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
This is a [React](https://reactjs.org/) module available through the
|
|
8
|
-
[npm registry](https://www.npmjs.com/). Installation is done using the
|
|
9
|
-
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
|
10
|
-
|
|
11
|
-
```console
|
|
12
|
-
npm install @tap-payments/apple-pay-button
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
---------------------------- OR -------------------------
|
|
16
|
-
|
|
17
|
-
```console
|
|
18
|
-
yarn add @tap-payments/apple-pay-button
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Examples
|
|
22
|
-
|
|
23
|
-
### ES6
|
|
24
|
-
|
|
25
|
-
```javascript
|
|
26
|
-
import React from 'react'
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
1
|
+
# apple-pay-button
|
|
2
|
+
|
|
3
|
+
Handling Apple Pay button in React and vanilla JS
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
This is a [React](https://reactjs.org/) module available through the
|
|
8
|
+
[npm registry](https://www.npmjs.com/). Installation is done using the
|
|
9
|
+
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
|
10
|
+
|
|
11
|
+
```console
|
|
12
|
+
npm install @tap-payments/apple-pay-button
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---------------------------- OR -------------------------
|
|
16
|
+
|
|
17
|
+
```console
|
|
18
|
+
yarn add @tap-payments/apple-pay-button
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
### ES6
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
import React from 'react'
|
|
27
|
+
import {
|
|
28
|
+
ApplePayButton,
|
|
29
|
+
ThemeMode,
|
|
30
|
+
SupportedNetworks,
|
|
31
|
+
Scope,
|
|
32
|
+
Environment,
|
|
33
|
+
Locale,
|
|
34
|
+
ButtonType,
|
|
35
|
+
Edges
|
|
36
|
+
} from '@tap-payments/apple-pay-button'
|
|
37
|
+
|
|
38
|
+
const App = () => {
|
|
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
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Vanilla JS
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<!DOCTYPE html>
|
|
138
|
+
<html lang="en">
|
|
139
|
+
<head>
|
|
140
|
+
<meta charset="UTF-8" />
|
|
141
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
142
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
143
|
+
<title>apple pay button</title>
|
|
144
|
+
<link rel="stylesheet" href="https://tap-sdks.b-cdn.net/apple-pay/build-1.0.19/main.css" />
|
|
145
|
+
<script src="https://tap-sdks.b-cdn.net/apple-pay/build-1.0.19/main.js"></script>
|
|
146
|
+
</head>
|
|
147
|
+
|
|
148
|
+
<body>
|
|
149
|
+
<div id="apple-pay-button"></div>
|
|
150
|
+
<script type="text/javascript">
|
|
151
|
+
const { render, ThemeMode, SupportedNetworks, Scope, Environment, Locale, ButtonType, Edges } =
|
|
152
|
+
window.TapApplepaySDK
|
|
153
|
+
render(
|
|
154
|
+
{
|
|
155
|
+
publicKey: 'pk_test_7xxxxxxxxx',
|
|
156
|
+
environment: Environment.Development,
|
|
157
|
+
scope: Scope.TapToken,
|
|
158
|
+
merchant: {
|
|
159
|
+
domain: window.location.hostname,
|
|
160
|
+
id: 'merchant_xxxxxxxxxx'
|
|
161
|
+
},
|
|
162
|
+
transaction: {
|
|
163
|
+
currency: 'SAR',
|
|
164
|
+
amount: '3'
|
|
165
|
+
},
|
|
166
|
+
acceptance: {
|
|
167
|
+
supportedBrands: [SupportedNetworks.Mada, SupportedNetworks.Visa, SupportedNetworks.MasterCard],
|
|
168
|
+
supportedCards: ['DEBIT', 'CREDIT'],
|
|
169
|
+
supportedCardsWithAuthentications: ['3DS', 'EMV']
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
customer: {
|
|
173
|
+
id: 'cus_xxx',
|
|
174
|
+
name: [
|
|
175
|
+
{
|
|
176
|
+
locale: 'en',
|
|
177
|
+
first: 'test',
|
|
178
|
+
last: 'tester',
|
|
179
|
+
middle: 'test'
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
contact: {
|
|
183
|
+
email: 'test@gmail.com',
|
|
184
|
+
phone: {
|
|
185
|
+
number: '10XXXXXX56',
|
|
186
|
+
countryCode: '+20'
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
interface: {
|
|
191
|
+
locale: Locale.EN,
|
|
192
|
+
theme: ThemeMode.DARK,
|
|
193
|
+
type: ButtonType.BUY,
|
|
194
|
+
edges: Edges.CURVED
|
|
195
|
+
},
|
|
196
|
+
onCancel: async () => {
|
|
197
|
+
console.log('onCancel')
|
|
198
|
+
},
|
|
199
|
+
onError: async (error) => {
|
|
200
|
+
console.log('onError', error)
|
|
201
|
+
},
|
|
202
|
+
onSuccess: async (data) => {
|
|
203
|
+
console.log('onSuccess', data)
|
|
204
|
+
},
|
|
205
|
+
onReady: async () => {
|
|
206
|
+
console.log('onReady')
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
'apple-pay-button'
|
|
210
|
+
)
|
|
211
|
+
</script>
|
|
212
|
+
</body>
|
|
213
|
+
</html>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Configurations
|
|
217
|
+
|
|
218
|
+
| Name | Type | R/O | Description |
|
|
219
|
+
| -------------------------------------------- | ------------ | ---------- | ---------------------------------------------------------------------------------------------------------- |
|
|
220
|
+
| publicKey | `string` | `required` | The public Key provided by Tap |
|
|
221
|
+
| environment | `enum` | `optional` | The environment of the SDK and it can be one of these environments `Environment`: [Development,Production] |
|
|
222
|
+
| debug | `boolean` | `optional` | To enable the debug mode |
|
|
223
|
+
| merchant.id | `string` | `required` | The merchant identifier provided by Tap |
|
|
224
|
+
| merchant.domain | `string` | `required` | The merchant domain name |
|
|
225
|
+
| transaction.amount | `string` | `required` | The amount to be charged |
|
|
226
|
+
| transaction.currency | `string` | `required` | The currency of the amount |
|
|
227
|
+
| scope | `enum` | `optional` | The scope of the SDK |
|
|
228
|
+
| acceptance.supportedBrands | `array` | `optional` | The supported networks for the Apple Pay button |
|
|
229
|
+
| acceptance.supportedCards | `array` | `optional` | The supported cards for the Apple Pay button |
|
|
230
|
+
| acceptance.supportedCardsWithAuthentications | `array` | `optional` | The supported cards with authentications for the Apple Pay button |
|
|
231
|
+
| interface.theme | `enum` | `optional` | The theme of the Apple Pay button |
|
|
232
|
+
| interface.locale | `Locale` | `optional` | The locale of the Apple Pay button |
|
|
233
|
+
| interface.type | `ButtonType` | `optional` | The type of the Apple Pay button |
|
|
234
|
+
| interface.edges | `ButtonType` | `optional` | The border of the Apple Pay button |
|
|
235
|
+
| customer | `object` | `optional` | The Customer details information |
|
|
236
|
+
| onCancel | `function` | `optional` | A callback function that will be called when you cancel the process |
|
|
237
|
+
| onError | `function` | `optional` | A callback function that will be called when you have an error |
|
|
238
|
+
| onSuccess | `function` | `optional` | A async function that will be called after creating the token successfully |
|
|
239
|
+
| onClick | `function` | `optional` | A callback function that will be called when the button clicked |
|
|
240
|
+
| onReady | `function` | `optional` | A callback function that will be called when you button is clickable |
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { MerchantCapabilities, SupportedNetworks } from '../constants';
|
|
2
|
+
export declare type RequiredShippingContactField = 'postalAddress' | 'name' | 'phoneticName' | 'phone' | 'email';
|
|
3
|
+
export declare type ApplePayPaymentMethodType = 'debit' | 'credit' | 'prepaid' | 'store';
|
|
4
|
+
export interface ApplePayShippingMethod {
|
|
5
|
+
label: string;
|
|
6
|
+
detail: string;
|
|
7
|
+
amount: string;
|
|
8
|
+
identifier: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ApplePayPaymentContact {
|
|
11
|
+
phoneNumber?: string;
|
|
12
|
+
emailAddress?: string;
|
|
13
|
+
givenName?: string;
|
|
14
|
+
familyName?: string;
|
|
15
|
+
phoneticGivenName?: string;
|
|
16
|
+
phoneticFamilyName?: string;
|
|
17
|
+
addressLines?: string[];
|
|
18
|
+
subLocality?: string;
|
|
19
|
+
locality?: string;
|
|
20
|
+
postalCode?: string;
|
|
21
|
+
subAdministrativeArea?: string;
|
|
22
|
+
administrativeArea?: string;
|
|
23
|
+
country?: string;
|
|
24
|
+
countryCode?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ApplePayPaymentMethod {
|
|
27
|
+
displayName?: string;
|
|
28
|
+
network?: string;
|
|
29
|
+
type?: ApplePayPaymentMethodType;
|
|
30
|
+
billingContact?: ApplePayPaymentContact;
|
|
31
|
+
}
|
|
32
|
+
export interface ApplePayLineItem {
|
|
33
|
+
type?: 'final' | 'pending';
|
|
34
|
+
label?: string;
|
|
35
|
+
amount?: string;
|
|
36
|
+
paymentTiming?: 'immediate' | 'recurring' | 'deferred' | 'automaticReload';
|
|
37
|
+
recurringPaymentStartDate?: Date;
|
|
38
|
+
recurringPaymentIntervalUnit?: 'year' | 'month' | 'day' | 'hour' | 'minute';
|
|
39
|
+
recurringPaymentIntervalCount?: number;
|
|
40
|
+
recurringPaymentEndDate?: Date;
|
|
41
|
+
deferredPaymentDate?: Date;
|
|
42
|
+
automaticReloadPaymentThresholdAmount?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ApplePayUpdateData {
|
|
45
|
+
newTotal: ApplePayLineItem;
|
|
46
|
+
newLineItems?: ApplePayLineItem[];
|
|
47
|
+
}
|
|
48
|
+
export interface ApplePayRequestData {
|
|
49
|
+
countryCode: string;
|
|
50
|
+
currencyCode: string;
|
|
51
|
+
merchantCapabilities: Array<typeof MerchantCapabilities[keyof typeof MerchantCapabilities]>;
|
|
52
|
+
supportedNetworks: Array<typeof SupportedNetworks[keyof typeof SupportedNetworks]>;
|
|
53
|
+
billingContact?: {
|
|
54
|
+
phoneNumber?: string;
|
|
55
|
+
emailAddress?: string;
|
|
56
|
+
givenName: string;
|
|
57
|
+
familyName: string;
|
|
58
|
+
};
|
|
59
|
+
total: {
|
|
60
|
+
label: string;
|
|
61
|
+
amount: number;
|
|
62
|
+
};
|
|
63
|
+
requiredShippingContactFields?: Array<RequiredShippingContactField>;
|
|
64
|
+
supportsCouponCode?: boolean;
|
|
65
|
+
couponCode?: string;
|
|
66
|
+
shippingMethods?: ApplePayShippingMethod[];
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|