@fat-zebra/sdk 1.5.5 → 1.5.7-beta.0
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/.idea/fatzebra-js.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/dist/applepay/applepay.d.ts +22 -7
- package/dist/applepay/applepay.js +99 -21
- package/dist/applepay/applepaymanager.d.ts +28 -0
- package/dist/applepay/applepaymanager.js +115 -0
- package/dist/applepay/clients/apple-pay-client.d.ts +9 -5
- package/dist/applepay/clients/apple-pay-client.js +10 -4
- package/dist/applepay/clients/paynow-client.d.ts +4 -2
- package/dist/applepay/clients/paynow-client.js +2 -7
- package/dist/applepay/types.d.ts +15 -0
- package/dist/applepay/types.js +1 -0
- package/dist/click_to_pay/index.d.ts +1 -0
- package/dist/click_to_pay/index.js +42 -6
- package/dist/click_to_pay/types.d.ts +12 -2
- package/dist/fatzebra.css +91 -0
- package/dist/hpp/hpp.d.ts +4 -0
- package/dist/hpp/hpp.js +26 -5
- package/dist/local/fatzebra.js +19684 -0
- package/dist/local/fatzebra.js.map +1 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.js +24 -2
- package/dist/production/fatzebra.css +91 -0
- package/dist/production/fatzebra.js +2 -0
- package/dist/react/ApplePay.d.ts +9 -0
- package/dist/react/ApplePay.js +11 -0
- package/dist/react/ApplePayButton.d.ts +8 -0
- package/dist/react/ApplePayButton.js +18 -0
- package/dist/react/{url.d.ts → applePayUrl.d.ts} +2 -2
- package/dist/react/applePayUrl.js +19 -0
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +2 -1
- package/dist/react/useFatZebra.js +8 -57
- package/dist/react/useMessage.d.ts +10 -0
- package/dist/react/useMessage.js +70 -0
- package/dist/sandbox/fatzebra.css +91 -0
- package/dist/sandbox/fatzebra.js +2 -0
- package/dist/sandbox/fatzebra.js.LICENSE.txt +1 -0
- package/dist/sca/cardinal.d.ts +2 -11
- package/dist/sca/cardinal.js +4 -10
- package/dist/sca/index.d.ts +11 -1
- package/dist/sca/index.js +3 -38
- package/dist/sca/scenarios/enrollment.js +12 -0
- package/dist/sca/types/cardinal_types.d.ts +61 -0
- package/dist/sca/types/cardinal_types.js +11 -0
- package/dist/sca/types.d.ts +4 -1
- package/dist/sca/types.js +1 -0
- package/dist/sca/utility/index.d.ts +7 -0
- package/dist/sca/utility/index.js +39 -0
- package/dist/shared/bridge-client.d.ts +5 -1
- package/dist/shared/bridge-client.js +19 -1
- package/dist/shared/env.development.d.ts +3 -3
- package/dist/shared/env.development.js +3 -3
- package/dist/shared/envs/local.d.ts +3 -3
- package/dist/shared/envs/local.js +3 -3
- package/dist/shared/event-manager.d.ts +1 -1
- package/dist/shared/post-message-client.d.ts +2 -0
- package/dist/shared/post-message-client.js +1 -1
- package/dist/shared/types.d.ts +28 -13
- package/dist/shared/types.js +11 -1
- package/dist/src/applepay/applepaymanager.js +279 -0
- package/dist/src/applepay/applepaymanager.js.map +1 -0
- package/dist/src/react/ApplePayButton.js +56 -0
- package/dist/src/react/ApplePayButton.js.map +1 -0
- package/dist/src/react/{url.js → applePayUrl.js} +7 -21
- package/dist/src/react/applePayUrl.js.map +1 -0
- package/dist/src/react/applePayUrl.test.js +57 -0
- package/dist/src/react/applePayUrl.test.js.map +1 -0
- package/dist/src/react/useFatZebra.js +7 -56
- package/dist/src/react/useFatZebra.js.map +1 -1
- package/dist/src/react/useMessage.js +140 -0
- package/dist/src/react/useMessage.js.map +1 -0
- package/dist/src/react/useMessage.test.js +222 -0
- package/dist/src/react/useMessage.test.js.map +1 -0
- package/dist/src/validation/validators/apple-pay-load-params-button-validator.js +19 -0
- package/dist/src/validation/validators/apple-pay-load-params-button-validator.js.map +1 -0
- package/dist/staging/fatzebra.css +91 -0
- package/dist/staging/fatzebra.js +19684 -0
- package/dist/staging/fatzebra.js.map +1 -0
- package/dist/staging/index.html +247 -0
- package/dist/validation/schemas/applepay/load-params.json +31 -0
- package/dist/validation/schemas/applepay/options.json +115 -0
- package/dist/validation/schemas/applepay/payment-intent.json +42 -0
- package/dist/validation/schemas/click-to-pay/options.json +33 -3
- package/dist/validation/validators/apple-pay-load-params-button-validator.d.ts +3 -0
- package/dist/validation/validators/apple-pay-load-params-button-validator.js +12 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -3
- package/tsconfig.json +1 -1
- package/dist/paypal/paypal-button.d.ts +0 -31
- package/dist/paypal/paypal-button.js +0 -199
- package/dist/paypal/paypal-checkout.d.ts +0 -21
- package/dist/paypal/paypal-checkout.js +0 -100
- package/dist/paypal/types.d.ts +0 -188
- package/dist/paypal/types.js +0 -5
- package/dist/paypal/validation.d.ts +0 -4
- package/dist/paypal/validation.js +0 -65
- package/dist/react/url.js +0 -33
- package/dist/src/paypal/paypal-button.js +0 -311
- package/dist/src/paypal/paypal-button.js.map +0 -1
- package/dist/src/paypal/paypal-button.test.js +0 -41
- package/dist/src/paypal/paypal-button.test.js.map +0 -1
- package/dist/src/paypal/paypal-checkout.js +0 -111
- package/dist/src/paypal/paypal-checkout.js.map +0 -1
- package/dist/src/paypal/paypal-checkout.test.js +0 -167
- package/dist/src/paypal/paypal-checkout.test.js.map +0 -1
- package/dist/src/paypal/types.js +0 -9
- package/dist/src/paypal/types.js.map +0 -1
- package/dist/src/paypal/validation.js +0 -73
- package/dist/src/paypal/validation.js.map +0 -1
- package/dist/src/react/url.js.map +0 -1
- package/dist/src/react/url.test.js +0 -88
- package/dist/src/react/url.test.js.map +0 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<title>Merchant XYZ Checkout Page</title>
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
|
|
7
|
+
<style type="text/css">
|
|
8
|
+
iframe {
|
|
9
|
+
height: 600px;
|
|
10
|
+
width: 700px;
|
|
11
|
+
}
|
|
12
|
+
</style>
|
|
13
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
|
14
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/hmac-md5.js"></script>
|
|
15
|
+
<script>
|
|
16
|
+
window.localStorage.setItem('fz-access-token', "")
|
|
17
|
+
// card tokens will be filled out
|
|
18
|
+
var actionItems = {
|
|
19
|
+
tokens: [
|
|
20
|
+
{
|
|
21
|
+
token: 'whatever',
|
|
22
|
+
number: '4000000000001000',
|
|
23
|
+
description: 'Successful Frictionless Authentication'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
token: '',
|
|
27
|
+
number: '4000000000001026',
|
|
28
|
+
description: 'Attempts Stand-In Frictionless'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
token: '',
|
|
32
|
+
number: '4000000000001034',
|
|
33
|
+
description: 'Unavailable Frictionless'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
token: '',
|
|
37
|
+
number: '4000000000001059',
|
|
38
|
+
description: 'Authentication Not Available on Lookup'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
token: '',
|
|
42
|
+
number: '4000000000001067',
|
|
43
|
+
description: 'Error on Lookup'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
token: '',
|
|
47
|
+
number: '4000000000001075',
|
|
48
|
+
description: 'Timeout on cmpi_lookup'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
token: '',
|
|
52
|
+
number: '4000000000001083',
|
|
53
|
+
description: 'Bypassed Authentication'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
token: '',
|
|
57
|
+
number: '4000000000001018',
|
|
58
|
+
description: 'Failed Frictionless'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
token: '',
|
|
62
|
+
number: '4000000000001042',
|
|
63
|
+
description: 'Rejected Frictionless'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
token: 'ahq94qb60fs0xaruga3h',
|
|
67
|
+
number: '4000000000001091',
|
|
68
|
+
description: 'Challenge'
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
cards: [
|
|
72
|
+
{
|
|
73
|
+
number: '4000000000001000',
|
|
74
|
+
description: 'Successful Frictionless Authentication'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
number: '4000000000001026',
|
|
78
|
+
description: 'Attempts Stand-In Frictionless'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
number: '4000000000001034',
|
|
82
|
+
description: 'Unavailable Frictionless'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
number: '4000000000001059',
|
|
86
|
+
description: 'Authentication Not Available on Lookup'
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
number: '4000000000001067',
|
|
90
|
+
description: 'Error on Lookup'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
number: '4000000000001075',
|
|
94
|
+
description: 'Timeout on cmpi_lookup'
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
number: '4000000000001083',
|
|
98
|
+
description: 'Bypassed Authentication'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
number: '4000000000001018',
|
|
102
|
+
description: 'Failed Frictionless'
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
number: '4000000000001042',
|
|
106
|
+
description: 'Rejected Frictionless'
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
number: '4000000000001091',
|
|
110
|
+
description: 'Challenge'
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
</script>
|
|
115
|
+
<script src="fatzebra.js"></script></head>
|
|
116
|
+
<body>
|
|
117
|
+
<table id="options" class="table table-bordered">
|
|
118
|
+
<thead>
|
|
119
|
+
<tr>
|
|
120
|
+
<th scope="col">Card Token</th>
|
|
121
|
+
<th scope="col">New Card</th>
|
|
122
|
+
<th scope="col">Description</th>
|
|
123
|
+
</tr>
|
|
124
|
+
</thead>
|
|
125
|
+
<tbody>
|
|
126
|
+
</tbody>
|
|
127
|
+
</table>
|
|
128
|
+
<button type="button" class="btn btn-primary" id='doCheckout'>Primary</button>
|
|
129
|
+
|
|
130
|
+
<script>
|
|
131
|
+
var selectedMode = undefined
|
|
132
|
+
var selectedValue = undefined
|
|
133
|
+
|
|
134
|
+
$(document).ready(function() {
|
|
135
|
+
|
|
136
|
+
for (var i = 0; i < actionItems.tokens.length; i ++ ) {
|
|
137
|
+
const row = "<tr><td><input type='checkbox' class='option' data-mode='token' value='" + actionItems.tokens[i].token + "'><label>token for " + actionItems.tokens[i].number + "</label></td>" +
|
|
138
|
+
"<td><input type='checkbox' class='option' data-mode='card' value='" + actionItems.cards[i].number + "'><label>" + actionItems.cards[i].number + "</label></td>" +
|
|
139
|
+
"<td><label>" + actionItems.cards[i].description + "</label></td></tr>";
|
|
140
|
+
$('#options').append(row)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
$('.option').change(function() {
|
|
144
|
+
|
|
145
|
+
if ($(this).prop("checked") == true) {
|
|
146
|
+
if (selectedValue === undefined) {
|
|
147
|
+
selectedMode = $(this).data('mode');
|
|
148
|
+
selectedValue = $(this).val();
|
|
149
|
+
} else {
|
|
150
|
+
$(this).prop("checked", false)
|
|
151
|
+
alert("There can only be one checkbox selected!");
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
selectedMode = undefined;
|
|
155
|
+
selectedValue = undefined;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
console.log('selectedMode: ' + selectedMode);
|
|
159
|
+
console.log('selectedValue: ' + selectedValue);
|
|
160
|
+
})
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
</script>
|
|
164
|
+
</body>
|
|
165
|
+
<footer>
|
|
166
|
+
|
|
167
|
+
<script>
|
|
168
|
+
var fz = new FatZebra({
|
|
169
|
+
username: 'TEST'
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
$('#doCheckout').click(function() {
|
|
173
|
+
if (selectedMode === undefined || selectedValue == undefined) {
|
|
174
|
+
alert('Please select an option.');
|
|
175
|
+
return
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
var paymentMethod = undefined;
|
|
179
|
+
|
|
180
|
+
if (selectedMode === 'card') {
|
|
181
|
+
paymentMethod = {
|
|
182
|
+
type: 'card',
|
|
183
|
+
data: {
|
|
184
|
+
number: selectedValue,
|
|
185
|
+
holder: 'John Doe',
|
|
186
|
+
expiryMonth: '01',
|
|
187
|
+
expiryYear: '2022',
|
|
188
|
+
cvv: '123'
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
paymentMethod = {
|
|
193
|
+
type: 'card_on_file',
|
|
194
|
+
data: {
|
|
195
|
+
token: selectedValue
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function randomString(length) {
|
|
201
|
+
return Math.round((Math.pow(36, length + 1) - Math.random() * Math.pow(36, length))).toString(36).slice(1);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const reference = randomString(16);
|
|
205
|
+
const amount = 1200000;
|
|
206
|
+
const currency = 'AUD';
|
|
207
|
+
const message = [reference, amount, currency].join(':')
|
|
208
|
+
const verification = CryptoJS.HmacMD5(message, "033bd94b11").toString();
|
|
209
|
+
|
|
210
|
+
fz.verifyCard({
|
|
211
|
+
customer: {
|
|
212
|
+
firstName: 'Captain',
|
|
213
|
+
lastName: 'America',
|
|
214
|
+
email: 'sos@fatzebra.com.au',
|
|
215
|
+
address: '123 Get High Blvd.',
|
|
216
|
+
city: 'Red Light District',
|
|
217
|
+
postcode: '6666',
|
|
218
|
+
state: 'NSW',
|
|
219
|
+
country: 'Australia'
|
|
220
|
+
},
|
|
221
|
+
paymentIntent: {
|
|
222
|
+
payment: {
|
|
223
|
+
amount: amount,
|
|
224
|
+
currency: currency,
|
|
225
|
+
reference: reference
|
|
226
|
+
},
|
|
227
|
+
verification: verification
|
|
228
|
+
},
|
|
229
|
+
paymentMethod: paymentMethod
|
|
230
|
+
})
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
fz.on('fz.sca.error', function(event) {
|
|
234
|
+
console.log(JSON.stringify(event.detail))
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
fz.on('fz.sca.success', function(event) {
|
|
238
|
+
console.log(JSON.stringify(event.detail))
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
fz.on('fz.validation.error', function(event) {
|
|
242
|
+
console.log(JSON.stringify(event.detail))
|
|
243
|
+
})
|
|
244
|
+
</script>
|
|
245
|
+
|
|
246
|
+
</footer>
|
|
247
|
+
</html>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://www.fatzebra.com/schemas/applepay/load-params.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"additionalProperties": false,
|
|
5
|
+
"required": [
|
|
6
|
+
"containerId",
|
|
7
|
+
"paymentIntent"
|
|
8
|
+
],
|
|
9
|
+
"properties": {
|
|
10
|
+
"containerId": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"environment": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": [
|
|
16
|
+
"local",
|
|
17
|
+
"test",
|
|
18
|
+
"development",
|
|
19
|
+
"staging",
|
|
20
|
+
"sandbox",
|
|
21
|
+
"production"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"paymentIntent": {
|
|
25
|
+
"$ref": "payment-intent.json#/definitions/PaymentIntent"
|
|
26
|
+
},
|
|
27
|
+
"options": {
|
|
28
|
+
"$ref": "options.json#/definitions/Options"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://www.fatzebra.com/schemas/applepay/options.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"Options": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"allowed_card_networks": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"enum": [
|
|
13
|
+
"amex",
|
|
14
|
+
"chinaUnionPay",
|
|
15
|
+
"discover",
|
|
16
|
+
"jcb",
|
|
17
|
+
"maestro",
|
|
18
|
+
"masterCard",
|
|
19
|
+
"visa"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"allowed_card_types": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": [
|
|
28
|
+
"supports3DS",
|
|
29
|
+
"supportsCredit",
|
|
30
|
+
"supportsDebit",
|
|
31
|
+
"supportsEMV"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"apple_button_type": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"enum": [
|
|
38
|
+
"buy",
|
|
39
|
+
"donate",
|
|
40
|
+
"plain",
|
|
41
|
+
"set-up",
|
|
42
|
+
"book",
|
|
43
|
+
"check-out",
|
|
44
|
+
"subscribe",
|
|
45
|
+
"add-money",
|
|
46
|
+
"contribute",
|
|
47
|
+
"order",
|
|
48
|
+
"reload",
|
|
49
|
+
"rent",
|
|
50
|
+
"support",
|
|
51
|
+
"tip",
|
|
52
|
+
"top-up",
|
|
53
|
+
"continue"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"apple_button_style": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"enum": [
|
|
59
|
+
"black",
|
|
60
|
+
"white",
|
|
61
|
+
"white-outline"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"apple_button_locale": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"enum": [
|
|
67
|
+
"ar-AB",
|
|
68
|
+
"ca-ES",
|
|
69
|
+
"cs-CZ",
|
|
70
|
+
"da-DK",
|
|
71
|
+
"de-DE",
|
|
72
|
+
"el-GR",
|
|
73
|
+
"en-AU",
|
|
74
|
+
"en-GB",
|
|
75
|
+
"en-US",
|
|
76
|
+
"es-ES",
|
|
77
|
+
"es-MX",
|
|
78
|
+
"fi-FI",
|
|
79
|
+
"fr-CA",
|
|
80
|
+
"fr-FR",
|
|
81
|
+
"he-IL",
|
|
82
|
+
"hi-IN",
|
|
83
|
+
"hr-HR",
|
|
84
|
+
"hu-HU",
|
|
85
|
+
"id-ID",
|
|
86
|
+
"it-IT",
|
|
87
|
+
"ja-JP",
|
|
88
|
+
"ko-KR",
|
|
89
|
+
"ms-MY",
|
|
90
|
+
"nb-NO",
|
|
91
|
+
"nl-NL",
|
|
92
|
+
"pl-PL",
|
|
93
|
+
"pt-BR",
|
|
94
|
+
"pt-PT",
|
|
95
|
+
"ro-RO",
|
|
96
|
+
"ru-RU",
|
|
97
|
+
"sk-SK",
|
|
98
|
+
"sv-SE",
|
|
99
|
+
"th-TH",
|
|
100
|
+
"tr-TR",
|
|
101
|
+
"uk-UA",
|
|
102
|
+
"vi-VN",
|
|
103
|
+
"zh-CN",
|
|
104
|
+
"zh-HK",
|
|
105
|
+
"zh-TW"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"domain_name": {
|
|
109
|
+
"type": "string"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"additionalProperties": false
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://www.fatzebra.com/schemas/applepay/payment-intent.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"additionalProperties": false,
|
|
5
|
+
"definitions": {
|
|
6
|
+
"PaymentIntent": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"payment": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"required": [
|
|
14
|
+
"amount",
|
|
15
|
+
"currency",
|
|
16
|
+
"reference"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"amount": {
|
|
20
|
+
"type": "number",
|
|
21
|
+
"minimum": 0
|
|
22
|
+
},
|
|
23
|
+
"currency": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"reference": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"verification": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 5
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"required": [
|
|
37
|
+
"payment",
|
|
38
|
+
"verification"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -5,17 +5,47 @@
|
|
|
5
5
|
"Options": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"auth": {
|
|
9
9
|
"type": "boolean"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
"type": "
|
|
11
|
+
"cardListButtonText": {
|
|
12
|
+
"type": "string"
|
|
13
13
|
},
|
|
14
14
|
"css": {
|
|
15
15
|
"type": "string"
|
|
16
16
|
},
|
|
17
17
|
"cssSignature": {
|
|
18
18
|
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"displayName": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"hideConfirmButton": {
|
|
24
|
+
"type": "boolean"
|
|
25
|
+
},
|
|
26
|
+
"hideManualEntryLink": {
|
|
27
|
+
"type": "boolean"
|
|
28
|
+
},
|
|
29
|
+
"mrt": {
|
|
30
|
+
"type": "string"
|
|
31
|
+
},
|
|
32
|
+
"returnPath": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"returnTarget": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"saveCard": {
|
|
39
|
+
"type": "boolean"
|
|
40
|
+
},
|
|
41
|
+
"sharedData": {
|
|
42
|
+
"type": "string"
|
|
43
|
+
},
|
|
44
|
+
"submitPaymentButtonText": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"tokenizeOnly": {
|
|
48
|
+
"type": "boolean"
|
|
19
49
|
}
|
|
20
50
|
}
|
|
21
51
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Ajv from 'ajv';
|
|
2
|
+
import paymentIntentSchema from '../schemas/applepay/payment-intent.json';
|
|
3
|
+
import optionsSchema from '../schemas/applepay/options.json';
|
|
4
|
+
import loadParams from '../schemas/applepay/load-params.json';
|
|
5
|
+
const validator = new Ajv({
|
|
6
|
+
allErrors: true,
|
|
7
|
+
jsonPointers: true,
|
|
8
|
+
})
|
|
9
|
+
.addSchema(paymentIntentSchema)
|
|
10
|
+
.addSchema(optionsSchema)
|
|
11
|
+
.compile(loadParams);
|
|
12
|
+
export { validator as validateApplePayLoadParams };
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.5.
|
|
1
|
+
export declare const version = "1.5.5";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.5.
|
|
1
|
+
export const version = '1.5.5';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fat-zebra/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.7-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"author": "",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"devDependencies": {
|
|
26
|
+
"@inquirer/prompts": "^5.3.8",
|
|
26
27
|
"@testing-library/dom": "^10.4.0",
|
|
27
28
|
"@testing-library/react": "^16.0.0",
|
|
28
29
|
"@testing-library/react-hooks": "^8.0.1",
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
"@types/ajv": "^1.0.0",
|
|
31
32
|
"@types/axios": "^0.14.0",
|
|
32
33
|
"@types/dotenv": "^8.2.0",
|
|
34
|
+
"@types/inquirer": "^9.0.7",
|
|
33
35
|
"@types/jest": "^24.0.23",
|
|
34
36
|
"@types/jsdom": "^21.1.1",
|
|
35
37
|
"@types/nock": "^11.1.0",
|
|
@@ -40,7 +42,6 @@
|
|
|
40
42
|
"dotenv-webpack": "^8.0.0",
|
|
41
43
|
"ejs": "^3.0.1",
|
|
42
44
|
"html-webpack-plugin": "^5.3.1",
|
|
43
|
-
"inquirer": "^10.0.1",
|
|
44
45
|
"jest": "^29.6.1",
|
|
45
46
|
"jest-environment-jsdom": "^29.6.1",
|
|
46
47
|
"jest-localstorage-mock": "^2.4.22",
|
|
@@ -71,4 +72,4 @@
|
|
|
71
72
|
"react": ">= 16",
|
|
72
73
|
"react-dom": ">= 16"
|
|
73
74
|
}
|
|
74
|
-
}
|
|
75
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { PayPalPaymentMethod } from './types';
|
|
2
|
-
import { PaymentIntent } from '../shared/types';
|
|
3
|
-
interface PayPal {
|
|
4
|
-
render(containerId: string): void;
|
|
5
|
-
}
|
|
6
|
-
interface PayPalButtonStyle {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
}
|
|
9
|
-
export default class PayPalButton {
|
|
10
|
-
private validationErrorRaised;
|
|
11
|
-
private _paypalButtons;
|
|
12
|
-
private paymentMethod;
|
|
13
|
-
private paymentIntent;
|
|
14
|
-
private buttonStyle;
|
|
15
|
-
private billingAgreement;
|
|
16
|
-
private client;
|
|
17
|
-
private actions;
|
|
18
|
-
constructor(paymentMethod?: PayPalPaymentMethod, paymentIntent?: PaymentIntent, billingAgreement?: boolean, buttonStyle?: PayPalButtonStyle);
|
|
19
|
-
get paypalButtons(): any;
|
|
20
|
-
get paypalActions(): any;
|
|
21
|
-
render(containerId: string): void;
|
|
22
|
-
getContainer(containerId: string): any;
|
|
23
|
-
private createButton;
|
|
24
|
-
private createOrder;
|
|
25
|
-
private approveOrder;
|
|
26
|
-
private createBillingAgreement;
|
|
27
|
-
private approveBillingAgreement;
|
|
28
|
-
private formatError;
|
|
29
|
-
}
|
|
30
|
-
export { PayPalButton };
|
|
31
|
-
export type { PayPal, PayPalButtonStyle, };
|