@fat-zebra/sdk 1.5.8 → 1.5.10-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.
Files changed (170) hide show
  1. package/.github/workflows/ci.yml +226 -0
  2. package/CHANGELOG.md +9 -0
  3. package/dist/react/VerifyExistingCard.js +4 -0
  4. package/dist/version.d.ts +1 -1
  5. package/dist/version.js +1 -1
  6. package/package.json +4 -4
  7. package/.idea/fatzebra-js.iml +0 -12
  8. package/.idea/modules.xml +0 -8
  9. package/.idea/prettier.xml +0 -6
  10. package/.idea/vcs.xml +0 -6
  11. package/dist/applepay/applepaymanager.d.ts +0 -28
  12. package/dist/applepay/applepaymanager.js +0 -115
  13. package/dist/local/fatzebra.css +0 -91
  14. package/dist/local/fatzebra.js +0 -20147
  15. package/dist/local/fatzebra.js.map +0 -1
  16. package/dist/local/index.html +0 -247
  17. package/dist/production/fatzebra.css +0 -91
  18. package/dist/production/fatzebra.js +0 -8
  19. package/dist/production/fatzebra.js.LICENSE.txt +0 -1
  20. package/dist/react/ApplePay.d.ts +0 -9
  21. package/dist/react/ApplePay.js +0 -11
  22. package/dist/react/applePayUrl.d.ts +0 -12
  23. package/dist/react/applePayUrl.js +0 -19
  24. package/dist/react/useNotification.d.ts +0 -11
  25. package/dist/react/useNotification.js +0 -26
  26. package/dist/sandbox/fatzebra.css +0 -91
  27. package/dist/sandbox/fatzebra.js +0 -8
  28. package/dist/sandbox/fatzebra.js.LICENSE.txt +0 -1
  29. package/dist/scripts/release-package.js +0 -324
  30. package/dist/scripts/release-package.js.map +0 -1
  31. package/dist/src/applepay/applepay.js +0 -198
  32. package/dist/src/applepay/applepay.js.map +0 -1
  33. package/dist/src/applepay/applepaymanager.js +0 -279
  34. package/dist/src/applepay/applepaymanager.js.map +0 -1
  35. package/dist/src/applepay/clients/apple-pay-client.js +0 -66
  36. package/dist/src/applepay/clients/apple-pay-client.js.map +0 -1
  37. package/dist/src/applepay/clients/paynow-client.js +0 -96
  38. package/dist/src/applepay/clients/paynow-client.js.map +0 -1
  39. package/dist/src/applepay/index.js +0 -6
  40. package/dist/src/applepay/index.js.map +0 -1
  41. package/dist/src/click_to_pay/clicktopay.test.js +0 -131
  42. package/dist/src/click_to_pay/clicktopay.test.js.map +0 -1
  43. package/dist/src/click_to_pay/index.js +0 -135
  44. package/dist/src/click_to_pay/index.js.map +0 -1
  45. package/dist/src/click_to_pay/types.js +0 -3
  46. package/dist/src/click_to_pay/types.js.map +0 -1
  47. package/dist/src/hpp/hpp.js +0 -230
  48. package/dist/src/hpp/hpp.js.map +0 -1
  49. package/dist/src/hpp/hpp.test.js +0 -137
  50. package/dist/src/hpp/hpp.test.js.map +0 -1
  51. package/dist/src/hpp/index.js +0 -6
  52. package/dist/src/hpp/index.js.map +0 -1
  53. package/dist/src/index.js +0 -15
  54. package/dist/src/index.js.map +0 -1
  55. package/dist/src/main.js +0 -229
  56. package/dist/src/main.js.map +0 -1
  57. package/dist/src/main.test.js +0 -236
  58. package/dist/src/main.test.js.map +0 -1
  59. package/dist/src/react/ApplePayButton.js +0 -56
  60. package/dist/src/react/ApplePayButton.js.map +0 -1
  61. package/dist/src/react/VerifyCard.js +0 -29
  62. package/dist/src/react/VerifyCard.js.map +0 -1
  63. package/dist/src/react/VerifyExistingCard.js +0 -30
  64. package/dist/src/react/VerifyExistingCard.js.map +0 -1
  65. package/dist/src/react/applePayUrl.js +0 -46
  66. package/dist/src/react/applePayUrl.js.map +0 -1
  67. package/dist/src/react/applePayUrl.test.js +0 -57
  68. package/dist/src/react/applePayUrl.test.js.map +0 -1
  69. package/dist/src/react/index.js +0 -13
  70. package/dist/src/react/index.js.map +0 -1
  71. package/dist/src/react/paymentUrl.js +0 -60
  72. package/dist/src/react/paymentUrl.js.map +0 -1
  73. package/dist/src/react/paymentUrl.test.js +0 -88
  74. package/dist/src/react/paymentUrl.test.js.map +0 -1
  75. package/dist/src/react/submitForm.js +0 -13
  76. package/dist/src/react/submitForm.js.map +0 -1
  77. package/dist/src/react/useFatZebra.js +0 -70
  78. package/dist/src/react/useFatZebra.js.map +0 -1
  79. package/dist/src/react/useMessage.js +0 -140
  80. package/dist/src/react/useMessage.js.map +0 -1
  81. package/dist/src/react/useMessage.test.js +0 -222
  82. package/dist/src/react/useMessage.test.js.map +0 -1
  83. package/dist/src/react/verifyUrl.js +0 -49
  84. package/dist/src/react/verifyUrl.js.map +0 -1
  85. package/dist/src/sca/cardinal.js +0 -145
  86. package/dist/src/sca/cardinal.js.map +0 -1
  87. package/dist/src/sca/cardinal.test.js +0 -77
  88. package/dist/src/sca/cardinal.test.js.map +0 -1
  89. package/dist/src/sca/eci-mappings.js +0 -63
  90. package/dist/src/sca/eci-mappings.js.map +0 -1
  91. package/dist/src/sca/eci-mappings.test.js +0 -31
  92. package/dist/src/sca/eci-mappings.test.js.map +0 -1
  93. package/dist/src/sca/index.js +0 -382
  94. package/dist/src/sca/index.js.map +0 -1
  95. package/dist/src/sca/index.test.js +0 -624
  96. package/dist/src/sca/index.test.js.map +0 -1
  97. package/dist/src/sca/scenarios/enrollment.js +0 -161
  98. package/dist/src/sca/scenarios/enrollment.js.map +0 -1
  99. package/dist/src/sca/scenarios/index.js +0 -8
  100. package/dist/src/sca/scenarios/index.js.map +0 -1
  101. package/dist/src/sca/scenarios/validation.js +0 -139
  102. package/dist/src/sca/scenarios/validation.js.map +0 -1
  103. package/dist/src/sca/types.js +0 -57
  104. package/dist/src/sca/types.js.map +0 -1
  105. package/dist/src/shared/api-gateway-client.js +0 -148
  106. package/dist/src/shared/api-gateway-client.js.map +0 -1
  107. package/dist/src/shared/bridge-client.js +0 -24
  108. package/dist/src/shared/bridge-client.js.map +0 -1
  109. package/dist/src/shared/constants.js +0 -19
  110. package/dist/src/shared/constants.js.map +0 -1
  111. package/dist/src/shared/env.development.js +0 -12
  112. package/dist/src/shared/env.development.js.map +0 -1
  113. package/dist/src/shared/env.js +0 -50
  114. package/dist/src/shared/env.js.map +0 -1
  115. package/dist/src/shared/envs/local.js +0 -12
  116. package/dist/src/shared/envs/local.js.map +0 -1
  117. package/dist/src/shared/envs/production.js +0 -12
  118. package/dist/src/shared/envs/production.js.map +0 -1
  119. package/dist/src/shared/envs/sandbox.js +0 -12
  120. package/dist/src/shared/envs/sandbox.js.map +0 -1
  121. package/dist/src/shared/envs/staging.js +0 -12
  122. package/dist/src/shared/envs/staging.js.map +0 -1
  123. package/dist/src/shared/event-manager.js +0 -24
  124. package/dist/src/shared/event-manager.js.map +0 -1
  125. package/dist/src/shared/post-message-client.js +0 -127
  126. package/dist/src/shared/post-message-client.js.map +0 -1
  127. package/dist/src/shared/post-message-client.test.js +0 -58
  128. package/dist/src/shared/post-message-client.test.js.map +0 -1
  129. package/dist/src/shared/types.js +0 -36
  130. package/dist/src/shared/types.js.map +0 -1
  131. package/dist/src/shared/types.test.js +0 -55
  132. package/dist/src/shared/types.test.js.map +0 -1
  133. package/dist/src/shared/util.js +0 -96
  134. package/dist/src/shared/util.js.map +0 -1
  135. package/dist/src/shared/util.test.js +0 -148
  136. package/dist/src/shared/util.test.js.map +0 -1
  137. package/dist/src/validation/index.js +0 -12
  138. package/dist/src/validation/index.js.map +0 -1
  139. package/dist/src/validation/schemas/click-to-pay/load-params.json +0 -34
  140. package/dist/src/validation/schemas/click-to-pay/options.json +0 -23
  141. package/dist/src/validation/schemas/click-to-pay/payment-intent.json +0 -42
  142. package/dist/src/validation/schemas/customer.json +0 -38
  143. package/dist/src/validation/schemas/hpp-load-params.json +0 -40
  144. package/dist/src/validation/schemas/hpp-options.json +0 -48
  145. package/dist/src/validation/schemas/payment-intent.json +0 -48
  146. package/dist/src/validation/schemas/payment-method.json +0 -83
  147. package/dist/src/validation/schemas/verify-card-options.json +0 -15
  148. package/dist/src/validation/schemas/verify-card-params.json +0 -24
  149. package/dist/src/validation/validation-helper.js +0 -10
  150. package/dist/src/validation/validation-helper.js.map +0 -1
  151. package/dist/src/validation/validation-helper.test.js +0 -34
  152. package/dist/src/validation/validation-helper.test.js.map +0 -1
  153. package/dist/src/validation/validators/apple-pay-load-params-button-validator.js +0 -19
  154. package/dist/src/validation/validators/apple-pay-load-params-button-validator.js.map +0 -1
  155. package/dist/src/validation/validators/click-to-pay-load-params-validator.js +0 -19
  156. package/dist/src/validation/validators/click-to-pay-load-params-validator.js.map +0 -1
  157. package/dist/src/validation/validators/hpp-load-params-validator.js +0 -21
  158. package/dist/src/validation/validators/hpp-load-params-validator.js.map +0 -1
  159. package/dist/src/validation/validators/hpp-load-params-validator.test.js +0 -56
  160. package/dist/src/validation/validators/hpp-load-params-validator.test.js.map +0 -1
  161. package/dist/src/validation/validators/verify-card-params-validator.js +0 -23
  162. package/dist/src/validation/validators/verify-card-params-validator.js.map +0 -1
  163. package/dist/src/version.js +0 -5
  164. package/dist/src/version.js.map +0 -1
  165. package/dist/staging/fatzebra.css +0 -91
  166. package/dist/staging/fatzebra.js +0 -20423
  167. package/dist/staging/fatzebra.js.map +0 -1
  168. package/dist/staging/index.html +0 -247
  169. package/dist/tests/helpers/api-gateway-mock.js +0 -37
  170. package/dist/tests/helpers/api-gateway-mock.js.map +0 -1
@@ -1,247 +0,0 @@
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', "<DO NOT USE>")
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>
@@ -1,91 +0,0 @@
1
- .checkout-button-wrapper {
2
- display: flex;
3
- justify-content: center;
4
- align-items: center;
5
- height: 200px;
6
- }
7
-
8
- .iframe-checkout {
9
- flex: 1;
10
- border: none;
11
- width: 100%;
12
- height: 100%;
13
- min-height: 0;
14
- overflow: auto;
15
- -webkit-overflow-scrolling: touch;
16
- }
17
-
18
- .iframe-foreground,
19
- .iframe-background {
20
- top: 0;
21
- left: 0;
22
- right: 0;
23
- bottom: 0;
24
- flex-direction: column;
25
- }
26
-
27
- .iframe-foreground,
28
- .iframe-background {
29
- position: fixed;
30
- }
31
-
32
- .iframe-foreground {
33
- z-index: -1;
34
- }
35
-
36
- .iframe-background {
37
- background: rgba(0, 0, 0, 0.5);
38
- }
39
-
40
- .iframe-foreground {
41
- flex-grow: 1;
42
- top: auto;
43
- width: 100%;
44
- max-width: 480px;
45
- height: 80vh;
46
- background-color: #ffffff;
47
- border-radius: 25px 25px 0 0;
48
- }
49
-
50
- .slide-in .iframe-foreground {
51
- transform: translateY(100vh);
52
- transition: transform 0.4s ease, z-index 0.3s ease 0.4s;
53
- z-index: -1;
54
- }
55
-
56
- .slide-in .iframe-background {
57
- opacity: 0;
58
- z-index: -1;
59
- transition: opacity 0.3s ease, z-index 0.3s ease 0.3s;
60
- }
61
-
62
- .slide-in.show .iframe-foreground {
63
- transform: none;
64
- transition: transform 0.4s ease;
65
- z-index: 100;
66
- }
67
-
68
- .slide-in.show .iframe-background {
69
- opacity: 1;
70
- z-index: 0;
71
- transition: opacity 0.3s ease;
72
- }
73
-
74
- @media only screen and (min-width: 480px) {
75
- .iframe-foreground {
76
- margin: 0 auto;
77
- }
78
- }
79
-
80
- @media only screen and (min-width: 768px) {
81
- .iframe-foreground {
82
- margin: 0;
83
- width: 400px;
84
- height: 100vh;
85
- left: 0;
86
- }
87
-
88
- .slide-in .iframe-foreground {
89
- transform: translateX(-400px);
90
- }
91
- }