@tap-payments/apple-pay-button 1.0.4 → 1.0.5
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 +49 -17
- package/build/features/ApplePayButton/ApplePayButton.js +2 -2
- package/build/index.d.ts +2 -2
- package/build/index.js +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,13 +24,27 @@ yarn add @tap-payments/apple-pay-button
|
|
|
24
24
|
|
|
25
25
|
```javascript
|
|
26
26
|
import React from 'react'
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
ApplePayButton,
|
|
29
|
+
ButtonStyle,
|
|
30
|
+
SupportedNetworks,
|
|
31
|
+
Scope,
|
|
32
|
+
Environment,
|
|
33
|
+
ButtonType,
|
|
34
|
+
Locale
|
|
35
|
+
} from '@tap-payments/apple-pay-button'
|
|
28
36
|
|
|
29
37
|
const App = () => {
|
|
30
38
|
return (
|
|
31
39
|
<ApplePayButton
|
|
32
40
|
// required (The public Key provided by Tap)
|
|
33
41
|
publicKey={'pk_test_xxxxxxxxxxxxxxxzh'}
|
|
42
|
+
// optional (The environment of the SDK and it can be one of these Environment)
|
|
43
|
+
environment={Environment.Development}
|
|
44
|
+
// optional (to enable the debug mode)
|
|
45
|
+
debug
|
|
46
|
+
// required (The merchant identifier provided by Tap)
|
|
47
|
+
merchantIdentifier='merchant.tap.applepay.test'
|
|
34
48
|
// required
|
|
35
49
|
merchant={{
|
|
36
50
|
// required (The merchant domain name)
|
|
@@ -55,6 +69,10 @@ const App = () => {
|
|
|
55
69
|
// optional (The style of the Apple Pay button and it can be one of
|
|
56
70
|
// these styles: [White,WhiteOutline,Black], by default it is WhiteOutline)
|
|
57
71
|
buttonStyle={ButtonStyle.WhiteOutline}
|
|
72
|
+
// optional (The locale of the Apple Pay button and it can be one of these locales)
|
|
73
|
+
locale={Locale.EN}
|
|
74
|
+
// optional (The type of the Apple Pay button and it can be one of these types)
|
|
75
|
+
type={ButtonType.PLAIN}
|
|
58
76
|
// optional (The billing contact information)
|
|
59
77
|
billingContact={{
|
|
60
78
|
// required
|
|
@@ -109,12 +127,17 @@ const App = () => {
|
|
|
109
127
|
<body>
|
|
110
128
|
<div id="apple-pay-button"></div>
|
|
111
129
|
<script type="text/javascript">
|
|
112
|
-
const { renderApplePayButton, ButtonStyle, Scope, SupportedNetworks } = window.TapSDKs
|
|
130
|
+
const { renderApplePayButton, ButtonStyle, Scope, SupportedNetworks, Locale, ButtonType } = window.TapSDKs
|
|
113
131
|
renderApplePayButton(
|
|
114
132
|
{
|
|
115
133
|
// required
|
|
116
134
|
publicKey: 'pk_test_xxxxxxxxxxxxxxxzh',
|
|
117
|
-
//
|
|
135
|
+
// optional (The environment of the SDK and it can be one of these Environment)
|
|
136
|
+
environment: Environment.Development,
|
|
137
|
+
// optional (to enable the debug mode)
|
|
138
|
+
debug: true,
|
|
139
|
+
// required (The merchant identifier provided by Tap)
|
|
140
|
+
merchantIdentifier: 'merchant.tap.applepay.test',
|
|
118
141
|
merchant: {
|
|
119
142
|
// required
|
|
120
143
|
domain: 'example.com'
|
|
@@ -132,6 +155,10 @@ const App = () => {
|
|
|
132
155
|
scope: Scope.TapToken,
|
|
133
156
|
// optional
|
|
134
157
|
buttonStyle: ButtonStyle.WhiteOutline,
|
|
158
|
+
// optional (The locale of the Apple Pay button and it can be one of these locales)
|
|
159
|
+
locale: Locale.EN,
|
|
160
|
+
// optional (The type of the Apple Pay button and it can be one of these types)
|
|
161
|
+
type: ButtonType.PLAIN,
|
|
135
162
|
// optional
|
|
136
163
|
supportedNetworks: [SupportedNetworks.Visa, SupportedNetworks.MasterCard],
|
|
137
164
|
// optional (The billing contact information)
|
|
@@ -178,17 +205,22 @@ const App = () => {
|
|
|
178
205
|
|
|
179
206
|
## Configurations
|
|
180
207
|
|
|
181
|
-
| Name | Type | R/O | Description
|
|
182
|
-
| -------------------- | --------------------- | ---------- |
|
|
183
|
-
| publicKey | `string` | `required` | The public Key provided by Tap
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
|
208
|
+
| Name | Type | R/O | Description |
|
|
209
|
+
| -------------------- | --------------------- | ---------- | -------------------------------------------------------------------------------- |
|
|
210
|
+
| publicKey | `string` | `required` | The public Key provided by Tap |
|
|
211
|
+
| environment | `Environment` | `optional` | The environment of the SDK and it can be one of these environments `Environment` |
|
|
212
|
+
| debug | `boolean` | `optional` | To enable the debug mode |
|
|
213
|
+
| merchantIdentifier | `string` | `required` | The merchant identifier provided by Tap |
|
|
214
|
+
| merchant.id | `string` | `optional` | The merchant identifier provided by Tap |
|
|
215
|
+
| merchant.domain | `string` | `required` | The merchant domain name |
|
|
216
|
+
| transaction.amount | `string` | `required` | The amount to be charged |
|
|
217
|
+
| transaction.currency | `string` | `required` | The currency of the amount |
|
|
218
|
+
| scope | `Scope` | `optional` | The scope of the SDK |
|
|
219
|
+
| supportedNetworks | `SupportedNetworks[]` | `optional` | The supported networks for the Apple Pay button |
|
|
220
|
+
| buttonStyle | `ButtonStyle` | `optional` | The style of the Apple Pay button |
|
|
221
|
+
| locale | `Locale` | `optional` | The locale of the Apple Pay button |
|
|
222
|
+
| type | `ButtonType` | `optional` | The type of the Apple Pay button |
|
|
223
|
+
| billingContact | `BillingContact` | `optional` | The billing contact information |
|
|
224
|
+
| onCancel | `function` | `optional` | A callback function that will be called when you cancel the process |
|
|
225
|
+
| onError | `function` | `optional` | A callback function that will be called when you have an error |
|
|
226
|
+
| onSuccess | `function` | `optional` | A async function that will be called after creating the token successfully |
|
|
@@ -53,8 +53,8 @@ var ApplePay = React.memo(function (_a) {
|
|
|
53
53
|
}
|
|
54
54
|
}, []);
|
|
55
55
|
return (_jsx("button", { className: 'button-applepay-tap', style: {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
ApplePayButtonType: type,
|
|
57
|
+
ApplePayButtonStyle: buttonStyle
|
|
58
58
|
}, onClick: function () {
|
|
59
59
|
onApplePayButtonClicked();
|
|
60
60
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ApplePayButtonProps, ApplePayButton } from './features/ApplePayButton';
|
|
2
|
-
import { ButtonStyle, Scope, SupportedNetworks, Environment } from './constants';
|
|
2
|
+
import { ButtonStyle, Scope, SupportedNetworks, Environment, Locale, ButtonType } from './constants';
|
|
3
3
|
export type { ApplePayButtonProps };
|
|
4
|
-
export { ApplePayButton, ButtonStyle, Scope, SupportedNetworks, Environment };
|
|
4
|
+
export { ApplePayButton, ButtonStyle, Scope, SupportedNetworks, Environment, Locale, ButtonType };
|
package/build/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ApplePayButton, renderApplePayButton } from './features/ApplePayButton';
|
|
2
|
-
import { ButtonStyle, Scope, SupportedNetworks, Environment } from './constants';
|
|
3
|
-
export { ApplePayButton, ButtonStyle, Scope, SupportedNetworks, Environment };
|
|
2
|
+
import { ButtonStyle, Scope, SupportedNetworks, Environment, Locale, ButtonType } from './constants';
|
|
3
|
+
export { ApplePayButton, ButtonStyle, Scope, SupportedNetworks, Environment, Locale, ButtonType };
|
|
4
4
|
window['TapSDKs'] = {
|
|
5
5
|
renderApplePayButton: renderApplePayButton,
|
|
6
6
|
ButtonStyle: ButtonStyle,
|
|
7
7
|
Scope: Scope,
|
|
8
8
|
SupportedNetworks: SupportedNetworks,
|
|
9
|
-
Environment: Environment
|
|
9
|
+
Environment: Environment,
|
|
10
|
+
Locale: Locale,
|
|
11
|
+
ButtonType: ButtonType
|
|
10
12
|
};
|