@paydock/client-sdk 1.118.0 → 1.119.2-beta

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 (42) hide show
  1. package/README.md +70 -19
  2. package/bundles/index.cjs +335 -72
  3. package/bundles/index.cjs.d.ts +2060 -2050
  4. package/bundles/index.mjs +329 -65
  5. package/bundles/index.mjs.d.ts +2060 -2050
  6. package/bundles/types/api/api-base.d.ts.map +1 -1
  7. package/bundles/types/checkout/helpers/resource-helper.d.ts +4 -3
  8. package/bundles/types/checkout/helpers/resource-helper.d.ts.map +1 -1
  9. package/bundles/types/checkout/helpers/session-helper.d.ts +3 -0
  10. package/bundles/types/checkout/helpers/session-helper.d.ts.map +1 -1
  11. package/bundles/types/checkout/instructions/v1/instruction.afterpay_checkout_form.show.d.ts.map +1 -1
  12. package/bundles/types/checkout/instructions/v1/instruction.card_form.show.d.ts.map +1 -1
  13. package/bundles/types/checkout/instructions/v1/instruction.zip_checkout_form.show.d.ts.map +1 -1
  14. package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts.map +1 -1
  15. package/bundles/types/components/iframe-event.d.ts +39 -29
  16. package/bundles/types/components/iframe-event.d.ts.map +1 -1
  17. package/bundles/types/helper/custom-error.d.ts +8 -0
  18. package/bundles/types/helper/custom-error.d.ts.map +1 -0
  19. package/bundles/types/secure-remote-commerce/index.d.ts +1 -0
  20. package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
  21. package/bundles/types/secure-remote-commerce/interfaces.d.ts +1 -0
  22. package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
  23. package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts +1 -1
  24. package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts.map +1 -1
  25. package/bundles/types/widget/configuration.d.ts +7 -7
  26. package/bundles/types/widget/configuration.d.ts.map +1 -1
  27. package/bundles/types/widget/html-multi-widget.d.ts +1 -2
  28. package/bundles/types/widget/html-multi-widget.d.ts.map +1 -1
  29. package/bundles/types/widget/html-widget.d.ts +2 -1
  30. package/bundles/types/widget/html-widget.d.ts.map +1 -1
  31. package/bundles/types/widget/multi-widget.d.ts +4 -1
  32. package/bundles/types/widget/multi-widget.d.ts.map +1 -1
  33. package/bundles/widget.umd.js +335 -72
  34. package/bundles/widget.umd.js.d.ts +2060 -2050
  35. package/bundles/widget.umd.js.min.d.ts +2060 -2050
  36. package/bundles/widget.umd.min.js +1 -1
  37. package/docs/api-widget.md +21 -16
  38. package/docs/click-to-pay.md +1 -0
  39. package/docs/widget-examples.md +48 -3
  40. package/examples/multi-html-widget/extend.html +5 -0
  41. package/package.json +1 -1
  42. package/slate.md +48 -3
package/README.md CHANGED
@@ -199,6 +199,20 @@ widget.setSupportedCardIcons(['mastercard', 'visa']); // add icons of supported
199
199
 
200
200
  This example shows how you can use a lot of other methods to settings your form
201
201
 
202
+
203
+ ### Error handling
204
+
205
+ ```javascript
206
+ widget.on('error', (error) => {
207
+ const errorDiv = document.getElementById('error');
208
+ const errorMessage = document.getElementById('error-message');
209
+
210
+ errorMessage.textContent = error.data.message;
211
+ errorDiv.style.display = 'block';
212
+ });
213
+ ```
214
+
215
+
202
216
  ### Full example
203
217
 
204
218
  ```html
@@ -214,7 +228,34 @@ This example shows how you can use a lot of other methods to settings your form
214
228
  <div id="widget"
215
229
  widget-style="text-color: #FFFFAA; border-color: #yellow"
216
230
  title="Payment form"
217
- finish-text="Payment resource was successfully accepted"></div>
231
+ finish-text="Payment resource was successfully accepted">
232
+ </div>
233
+
234
+ <div
235
+ id="error"
236
+ style="
237
+ display: none;
238
+ max-width: 600px;
239
+ margin: 16px auto;
240
+ padding: 16px 20px;
241
+ border-radius: 8px;
242
+ background-color: #FEF2F2;
243
+ border: 1px solid #FEE2E2;
244
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
245
+ font-family: system-ui, -apple-system, sans-serif;
246
+ color: #991B1B;
247
+ line-height: 1.5;
248
+ font-size: 14px;
249
+ "
250
+ title="error"
251
+ >
252
+ <div style="display: flex; align-items: flex-start; gap: 12px;">
253
+ <div>
254
+ <h4 style="margin: 0 0 4px 0; font-size: 14px; font-weight: 600;">Access Error</h4>
255
+ <div id="error-message"></div>
256
+ </div>
257
+ </div>
258
+ </div>
218
259
  </form>
219
260
 
220
261
  <script src="https://widget.paydock.com/sdk/latest/widget.umd.js" ></script>
@@ -224,11 +265,15 @@ This example shows how you can use a lot of other methods to settings your form
224
265
  widget.setSupportedCardIcons(['mastercard', 'visa']);
225
266
  widget.setFormFields(['phone', 'email']);
226
267
  widget.setRefId('custom-ref-id');
227
- widget.onFinishInsert('input[name="payment_source_token"]', 'payment_source');z
268
+ widget.onFinishInsert('input[name="payment_source_token"]', 'payment_source');
228
269
 
270
+ widget.on('error', (error) => {
271
+ document.getElementById('error-message').textContent = error.data.message;
272
+ document.getElementById('error').style.display = 'block';
273
+ });
229
274
  widget.load();
230
275
  </script>
231
- </script>
276
+
232
277
  </body>
233
278
  </html>
234
279
  ```
@@ -250,6 +295,14 @@ This example shows how you can use a lot of other methods to settings your form
250
295
  </dd>
251
296
  </dl>
252
297
 
298
+ ## Members
299
+
300
+ <dl>
301
+ <dt><a href="#user-content-w_PURPOSE">PURPOSE</a> : <code>object</code></dt>
302
+ <dd><p>Purposes</p>
303
+ </dd>
304
+ </dl>
305
+
253
306
  ## Constants
254
307
 
255
308
  <dl>
@@ -262,9 +315,6 @@ This example shows how you can use a lot of other methods to settings your form
262
315
  <dt><a href="#user-content-w_PAYMENT_TYPE">PAYMENT_TYPE</a> : <code>object</code></dt>
263
316
  <dd><p>List of available payment source types</p>
264
317
  </dd>
265
- <dt><a href="#user-content-w_PURPOSE">PURPOSE</a> : <code>object</code></dt>
266
- <dd><p>Purposes</p>
267
- </dd>
268
318
  <dt><a href="#user-content-w_FORM_FIELD">FORM_FIELD</a> : <code>object</code></dt>
269
319
  <dd><p>Current constant include available type of fields which can be included to widget</p>
270
320
  </dd>
@@ -2502,6 +2552,19 @@ Method for setting a custom language code
2502
2552
  ```javascript
2503
2553
  config.setLanguage('en');
2504
2554
  ```
2555
+ <a name="w_PURPOSE" id="w_PURPOSE" href="#user-content-w_PURPOSE">&nbsp;</a>
2556
+
2557
+ ## PURPOSE : <code>object</code>
2558
+ Purposes
2559
+
2560
+ **Kind**: global variable
2561
+
2562
+ | Param | Type | Default |
2563
+ | --- | --- | --- |
2564
+ | PAYMENT_SOURCE | <code>string</code> | <code>&quot;payment_source&quot;</code> |
2565
+ | CARD_PAYMENT_SOURCE_WITH_CVV | <code>string</code> | <code>&quot;card_payment_source_with_cvv&quot;</code> |
2566
+ | CARD_PAYMENT_SOURCE_WITHOUT_CVV | <code>string</code> | <code>&quot;card_payment_source_without_cvv&quot;</code> |
2567
+
2505
2568
  <a name="w_EVENT" id="w_EVENT" href="#user-content-w_EVENT">&nbsp;</a>
2506
2569
 
2507
2570
  ## EVENT : <code>object</code>
@@ -2551,19 +2614,6 @@ List of available payment source types
2551
2614
  | BANK_ACCOUNT | <code>string</code> | <code>&quot;bank_account&quot;</code> |
2552
2615
  | CHECKOUT | <code>string</code> | <code>&quot;checkout&quot;</code> |
2553
2616
 
2554
- <a name="w_PURPOSE" id="w_PURPOSE" href="#user-content-w_PURPOSE">&nbsp;</a>
2555
-
2556
- ## PURPOSE : <code>object</code>
2557
- Purposes
2558
-
2559
- **Kind**: global constant
2560
-
2561
- | Param | Type | Default |
2562
- | --- | --- | --- |
2563
- | PAYMENT_SOURCE | <code>string</code> | <code>&quot;payment_source&quot;</code> |
2564
- | CARD_PAYMENT_SOURCE_WITH_CVV | <code>string</code> | <code>&quot;card_payment_source_with_cvv&quot;</code> |
2565
- | CARD_PAYMENT_SOURCE_WITHOUT_CVV | <code>string</code> | <code>&quot;card_payment_source_without_cvv&quot;</code> |
2566
-
2567
2617
  <a name="w_FORM_FIELD" id="w_FORM_FIELD" href="#user-content-w_FORM_FIELD">&nbsp;</a>
2568
2618
 
2569
2619
  ## FORM\_FIELD : <code>object</code>
@@ -7736,6 +7786,7 @@ When the flow type is src, masked checkoutData available is also returned
7736
7786
  | --- | --- | --- |
7737
7787
  | type | <code>string</code> | type of the checkout, can be `src` or `manual`. |
7738
7788
  | token | <code>string</code> | one time token value. |
7789
+ | token_type | <code>string</code> | one time token type value, can be `card` or `card_scheme_token`. |
7739
7790
  | [checkoutData] | <code>object</code> | Optional checkout data related to the checkout information. Only available on src flow. |
7740
7791
  | [checkoutData.card_number_bin] | <code>string</code> | The BIN of the card used for the transaction. |
7741
7792
  | [checkoutData.card_number_last4] | <code>string</code> | The last four digits of the card number. |