@paydock/client-sdk 1.108.2 → 1.110.3-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 (102) hide show
  1. package/README.md +990 -1
  2. package/bundles/index.cjs +3859 -3036
  3. package/bundles/index.cjs.d.ts +465 -47
  4. package/bundles/index.mjs +3857 -3036
  5. package/bundles/index.mjs.d.ts +465 -47
  6. package/bundles/types/api/api-gateway-internal.d.ts +12 -0
  7. package/bundles/types/api/api-gateway-internal.d.ts.map +1 -0
  8. package/bundles/types/api/api-internal.d.ts +2 -0
  9. package/bundles/types/api/api-internal.d.ts.map +1 -1
  10. package/bundles/types/helper/event-emitter.d.ts +1 -0
  11. package/bundles/types/helper/event-emitter.d.ts.map +1 -1
  12. package/bundles/types/index.d.ts +1 -0
  13. package/bundles/types/index.d.ts.map +1 -1
  14. package/bundles/types/secure-remote-commerce/index.d.ts +1 -1
  15. package/bundles/types/wallet-buttons/wallet-buttons.d.ts +4 -4
  16. package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -1
  17. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +4 -4
  18. package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -1
  19. package/bundles/types/wallet-buttons/{afterpay.wallet-service.d.ts → wallet-services/afterpay.wallet-service.d.ts} +1 -1
  20. package/bundles/types/wallet-buttons/wallet-services/afterpay.wallet-service.d.ts.map +1 -0
  21. package/bundles/types/wallet-buttons/{apple.wallet-service.d.ts → wallet-services/apple.wallet-service.d.ts} +3 -3
  22. package/bundles/types/wallet-buttons/wallet-services/apple.wallet-service.d.ts.map +1 -0
  23. package/bundles/types/wallet-buttons/{flypay-v2.wallet-service.d.ts → wallet-services/flypay-v2.wallet-service.d.ts} +3 -3
  24. package/bundles/types/wallet-buttons/wallet-services/flypay-v2.wallet-service.d.ts.map +1 -0
  25. package/bundles/types/wallet-buttons/{flypay.wallet-service.d.ts → wallet-services/flypay.wallet-service.d.ts} +6 -6
  26. package/bundles/types/wallet-buttons/wallet-services/flypay.wallet-service.d.ts.map +1 -0
  27. package/bundles/types/wallet-buttons/{google.wallet-service.d.ts → wallet-services/google.wallet-service.d.ts} +4 -4
  28. package/bundles/types/wallet-buttons/wallet-services/google.wallet-service.d.ts.map +1 -0
  29. package/bundles/types/wallet-buttons/wallet-services/mastercard.wallet-service.d.ts.map +1 -0
  30. package/bundles/types/wallet-buttons/{paypal.wallet-service.d.ts → wallet-services/paypal.wallet-service.d.ts} +1 -1
  31. package/bundles/types/wallet-buttons/wallet-services/paypal.wallet-service.d.ts.map +1 -0
  32. package/bundles/types/wallet-buttons/{stripe.wallet-service.d.ts → wallet-services/stripe.wallet-service.d.ts} +1 -1
  33. package/bundles/types/wallet-buttons/wallet-services/stripe.wallet-service.d.ts.map +1 -0
  34. package/bundles/types/wallet-buttons/{wallet-service.d.ts → wallet-services/wallet-service.d.ts} +3 -3
  35. package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts.map +1 -0
  36. package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts +195 -0
  37. package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts.map +1 -0
  38. package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts +10 -0
  39. package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts.map +1 -0
  40. package/bundles/types/wallet-buttons-express/index.d.ts +131 -0
  41. package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -0
  42. package/bundles/types/wallet-buttons-express/interfaces/base-event-data.interface.d.ts +6 -0
  43. package/bundles/types/wallet-buttons-express/interfaces/base-event-data.interface.d.ts.map +1 -0
  44. package/bundles/types/wallet-buttons-express/interfaces/base-gateway-config.interface.d.ts +6 -0
  45. package/bundles/types/wallet-buttons-express/interfaces/base-gateway-config.interface.d.ts.map +1 -0
  46. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts +5 -0
  47. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts.map +1 -0
  48. package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts +14 -0
  49. package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts.map +1 -0
  50. package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts +6 -0
  51. package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts.map +1 -0
  52. package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts +6 -0
  53. package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts.map +1 -0
  54. package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts +6 -0
  55. package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts.map +1 -0
  56. package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts +9 -0
  57. package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts.map +1 -0
  58. package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts +6 -0
  59. package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts.map +1 -0
  60. package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts +11 -0
  61. package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts.map +1 -0
  62. package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts +6 -0
  63. package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts.map +1 -0
  64. package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts +21 -0
  65. package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts.map +1 -0
  66. package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts +50 -0
  67. package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts.map +1 -0
  68. package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-button-style.constant.d.ts +3 -0
  69. package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-button-style.constant.d.ts.map +1 -0
  70. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-gateway-config.interface.d.ts +6 -0
  71. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-gateway-config.interface.d.ts.map +1 -0
  72. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +17 -0
  73. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -0
  74. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-style.type.d.ts +2 -0
  75. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-style.type.d.ts.map +1 -0
  76. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-type.type.d.ts +2 -0
  77. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-button-type.type.d.ts.map +1 -0
  78. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-gateway-config.interface.d.ts +4 -0
  79. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-gateway-config.interface.d.ts.map +1 -0
  80. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +31 -0
  81. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -0
  82. package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts +47 -0
  83. package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts.map +1 -0
  84. package/bundles/widget.umd.js +3859 -3036
  85. package/bundles/widget.umd.js.d.ts +465 -47
  86. package/bundles/widget.umd.js.min.d.ts +465 -47
  87. package/bundles/widget.umd.min.js +6 -6
  88. package/docs/click-to-pay.md +1 -1
  89. package/docs/html/layout.html +1 -0
  90. package/docs/wallet-buttons-express-examples.md +201 -0
  91. package/docs/wallet-buttons-express.md +786 -0
  92. package/package.json +4 -3
  93. package/bundles/types/wallet-buttons/afterpay.wallet-service.d.ts.map +0 -1
  94. package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +0 -1
  95. package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +0 -1
  96. package/bundles/types/wallet-buttons/flypay.wallet-service.d.ts.map +0 -1
  97. package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +0 -1
  98. package/bundles/types/wallet-buttons/mastercard.wallet-service.d.ts.map +0 -1
  99. package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +0 -1
  100. package/bundles/types/wallet-buttons/stripe.wallet-service.d.ts.map +0 -1
  101. package/bundles/types/wallet-buttons/wallet-service.d.ts.map +0 -1
  102. /package/bundles/types/wallet-buttons/{mastercard.wallet-service.d.ts → wallet-services/mastercard.wallet-service.d.ts} +0 -0
package/README.md CHANGED
@@ -6406,6 +6406,995 @@ List of available event's name in the wallet button lifecycle
6406
6406
  | ON_CLICK | <code>string</code> | <code>&quot;onClick&quot;</code> |
6407
6407
 
6408
6408
 
6409
+ ## Express Wallet Buttons
6410
+
6411
+ Express Wallet Buttons allow to integrate with E-Wallets in an "express" operational mode, allowing to show the respective button in product or cart pages.
6412
+
6413
+ The general flow to use the widgets is:
6414
+ 1. Configure your gateway and connect it using Paydock API or Dashboard.
6415
+ 2. Create a container in your site
6416
+ ```html
6417
+ <div id="widget"></div>
6418
+ ```
6419
+ 3. Initialize the specific WalletButtonExpress, providing your Access Token (preferred) or Public Key, plus required and optional meta parameters for the wallet in use. The general format is:
6420
+ ```js
6421
+ new paydock.{Provider}WalletButtonExpress(
6422
+ "#widget",
6423
+ accessTokenOrPublicKey,
6424
+ gatewayId,
6425
+ gatewaySpecificMeta,
6426
+ );
6427
+ ```
6428
+ 4. (optional) If the screen where the button is rendered allows for cart/amount changes, call `setMeta` method to update the meta information.
6429
+ 5. Handle the `onClick` callback, where you should call your server, initialize the wallet charge via `POST v1/charges/wallet` and return the wallet token.
6430
+ 6. Handle the `onPaymentSuccessful`, `onPaymentError` and `onPaymentInReview` (if fraud is applicable) for payment results.
6431
+
6432
+ ### Supported Providers
6433
+ 1. [Apple Pay](#apple-pay-wallet-button-express)
6434
+ 2. [Paypal](#paypal-wallet-button-express)
6435
+
6436
+ ### Apple Pay Wallet Button Express
6437
+
6438
+ A full description of the meta parameters for [ApplePayWalletButtonExpress](#ApplePayWalletButtonExpress) meta parameters can be found [here](#ApplePayWalletMeta). Below you will find a fully working html example.
6439
+
6440
+ ```html
6441
+ <!DOCTYPE html>
6442
+ <html lang="en">
6443
+ <head>
6444
+ <meta charset="UTF-8">
6445
+ <title>Title</title>
6446
+ </head>
6447
+ <body>
6448
+ <h2>Payment using PayDock ApplePayWalletButtonExpress!</h2>
6449
+ <div id="widget"></div>
6450
+ </body>
6451
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
6452
+ <script>
6453
+ let button = new paydock.ApplePayWalletButtonExpress(
6454
+ "#widget",
6455
+ accessTokenOrPublicKey,
6456
+ gatewayId,
6457
+ {
6458
+ amount_label: 'TOTAL',
6459
+ country: 'AU',
6460
+ currency: 'AUD',
6461
+ amount: 15.5,
6462
+ // merchant_capabilities: ['supports3DS', 'supportsEMV', 'supportsCredit', 'supportsDebit'],
6463
+ // supported_networks: ['visa', 'masterCard', 'amex', 'chinaUnionPay', 'discover', 'interac', 'jcb', 'privateLabel'],
6464
+ // required_billing_contact_fields: ['email', 'name', 'phone', 'postalAddress'], // phone and email do not work according to relevant testing
6465
+ // required_shipping_contact_fields: ['email', 'phone'], // Workaround to pull phone and email from shipping contact instead - does not require additional shipping address information
6466
+ // supported_countries: ["AU"],
6467
+ // style: {
6468
+ // button_type: "buy",
6469
+ // button_style: "black",
6470
+ // },
6471
+ }
6472
+ );
6473
+
6474
+ button.setEnv(sandbox);
6475
+
6476
+ button.onUnavailable(function() {
6477
+ console.log("Button not available");
6478
+ });
6479
+
6480
+ button.onError(function(error) {
6481
+ console.log("On Error Callback", error);
6482
+ });
6483
+
6484
+ button.onPaymentSuccessful(function(data) {
6485
+ console.log("Payment successful");
6486
+ console.log(data);
6487
+ });
6488
+
6489
+ button.onPaymentError(function(err) {
6490
+ console.log("Payment error");
6491
+ console.log(err);
6492
+ });
6493
+
6494
+ button.onPaymentInReview(function(data) {
6495
+ console.log("The payment is on fraud review");
6496
+ console.log(data);
6497
+ });
6498
+
6499
+ button.onClick(async (data) => {
6500
+ console.log("Button clicked", data);
6501
+
6502
+ const responseData = await fetch('https://your-server-url/initialize-wallet-charge');
6503
+ const parsedData = await responseData.json();
6504
+ return parsedData.resource.data.token;
6505
+ });
6506
+
6507
+ button.onCheckoutClose(() => {
6508
+ console.log("Checkout closed");
6509
+ });
6510
+
6511
+ button.load();
6512
+ </script>
6513
+ </html>
6514
+ ```
6515
+
6516
+ ### Paypal Wallet Button Express
6517
+ A full description of the meta parameters for [PaypalWalletButtonExpress](#PaypalWalletButtonExpress) meta parameters can be found [here](#PaypalWalletMeta). Below you will find a fully working html example.
6518
+
6519
+ ```html
6520
+ <!DOCTYPE html>
6521
+ <html lang="en">
6522
+ <head>
6523
+ <meta charset="UTF-8">
6524
+ <title>Title</title>
6525
+ </head>
6526
+ <body>
6527
+ <h2>Payment using PayDock PaypalWalletButtonExpress!</h2>
6528
+ <div id="widget"></div>
6529
+ </body>
6530
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
6531
+ <script>
6532
+ let button = new paydock.PaypalWalletButtonExpress(
6533
+ "#widget",
6534
+ accessTokenOrPublicKey,
6535
+ gatewayId,
6536
+ {
6537
+ amount: 15.5,
6538
+ currency: 'AUD',
6539
+ pay_later: false,
6540
+ standalone: false,
6541
+ capture: true,
6542
+ // style: {
6543
+ // layout: 'horizontal', // or 'vertical'
6544
+ // color: 'gold', // or 'blue', 'silver', 'black', 'white'
6545
+ // shape: 'rect', // or 'pill', 'sharp'
6546
+ // borderRadius: 5,
6547
+ // height: 40,
6548
+ // disableMaxWidth: false,
6549
+ // label: 'paypal', // or 'checkout', 'buynow', 'pay', 'installment'
6550
+ // tagline: true,
6551
+ // messages: {
6552
+ // layout: 'text', // or 'flex'
6553
+ // logo: {
6554
+ // type: 'primary', // or 'alternative', 'inline', 'none'
6555
+ // position: 'left', // or 'right', 'top'
6556
+ // },
6557
+ // text: {
6558
+ // color: 'black', // or 'white', 'monochrome', 'grayscale'
6559
+ // size: 10, // or 11, 12, 13, 14, 15, 16
6560
+ // align: 'left', // or 'center', 'right'
6561
+ // },
6562
+ // color: 'blue', // or 'black', 'white', 'white-no-border', 'gray', 'monochrome', 'grayscale'
6563
+ // ratio: '1x1', // or '1x4', '8x1', '20x1'
6564
+ // },
6565
+ // }
6566
+ }
6567
+ );
6568
+
6569
+ button.setEnv('sandbox');
6570
+
6571
+ button.onUnavailable(function() {
6572
+ console.log("Button not available");
6573
+ });
6574
+
6575
+ button.onError(function(error) {
6576
+ console.log("On Error Callback", error);
6577
+ });
6578
+
6579
+ button.onPaymentSuccessful(function(data) {
6580
+ console.log("Payment successful");
6581
+ console.log(data);
6582
+ });
6583
+
6584
+ button.onPaymentError(function(err) {
6585
+ console.log("Payment error");
6586
+ console.log(err);
6587
+ });
6588
+
6589
+ button.onPaymentInReview(function(data) {
6590
+ console.log("The payment is on fraud review");
6591
+ console.log(data);
6592
+ });
6593
+
6594
+ button.onClick(async (data) => {
6595
+ console.log("Button clicked", data);
6596
+
6597
+ const responseData = await fetch('https://your-server-url/initialize-wallet-charge');
6598
+ const parsedData = await responseData.json();
6599
+ return parsedData.resource.data.token;
6600
+ });
6601
+
6602
+ button.onCheckoutClose(() => {
6603
+ console.log("Checkout closed");
6604
+ });
6605
+
6606
+ button.load();
6607
+ </script>
6608
+ </html>
6609
+ ```
6610
+
6611
+ ## Classes
6612
+
6613
+ <dl>
6614
+ <dt><a href="#ApplePayWalletButtonExpress">ApplePayWalletButtonExpress</a> ⇐ <code>BaseWalletButton</code></dt>
6615
+ <dd><p>Class ApplePayWalletButtonExpress to work with Apple Pay Wallet.</p>
6616
+ </dd>
6617
+ <dt><a href="#PaypalWalletButtonExpress">PaypalWalletButtonExpress</a> ⇐ <code>BaseWalletButton</code></dt>
6618
+ <dd><p>Class PaypalWalletButtonExpress to work with Paypal Wallet.</p>
6619
+ </dd>
6620
+ </dl>
6621
+
6622
+ ## Constants
6623
+
6624
+ <dl>
6625
+ <dt><a href="#EVENT">EVENT</a> : <code>object</code></dt>
6626
+ <dd><p>List of available event&#39;s name in the wallet button lifecycle</p>
6627
+ </dd>
6628
+ </dl>
6629
+
6630
+ ## Typedefs
6631
+
6632
+ <dl>
6633
+ <dt><a href="#OnClickCallback">OnClickCallback</a> ⇒ <code>Promise.&lt;string&gt;</code></dt>
6634
+ <dd><p>Callback for onClick method.</p>
6635
+ </dd>
6636
+ <dt><a href="#OnPaymentSuccessfulCallback">OnPaymentSuccessfulCallback</a> : <code>function</code></dt>
6637
+ <dd><p>Callback for onPaymentSuccessful method.</p>
6638
+ </dd>
6639
+ <dt><a href="#OnPaymentInReviewCallback">OnPaymentInReviewCallback</a> : <code>function</code></dt>
6640
+ <dd><p>Callback for onPaymentInReview method.</p>
6641
+ </dd>
6642
+ <dt><a href="#OnPaymentErrorCallback">OnPaymentErrorCallback</a> : <code>function</code></dt>
6643
+ <dd><p>Callback for onPaymentError method.</p>
6644
+ </dd>
6645
+ <dt><a href="#OnCheckoutCloseCallback">OnCheckoutCloseCallback</a> : <code>function</code></dt>
6646
+ <dd><p>Callback for onCheckoutClose method.</p>
6647
+ </dd>
6648
+ <dt><a href="#OnUnavailableCallback">OnUnavailableCallback</a> : <code>function</code></dt>
6649
+ <dd><p>Callback for onUnavailable method.</p>
6650
+ </dd>
6651
+ <dt><a href="#OnErrorCallback">OnErrorCallback</a> : <code>function</code></dt>
6652
+ <dd><p>Callback for onError method.</p>
6653
+ </dd>
6654
+ </dl>
6655
+
6656
+ ## Interfaces
6657
+
6658
+ <dl>
6659
+ <dt><a href="#ApplePayWalletMeta">ApplePayWalletMeta</a> : <code>object</code></dt>
6660
+ <dd><p>Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process.</p>
6661
+ </dd>
6662
+ <dt><a href="#PaypalWalletMeta">PaypalWalletMeta</a> : <code>object</code></dt>
6663
+ <dd><p>Interface for configuration metadata specific to PayPal integration in the wallet checkout and payment process.
6664
+ For in-depth information, please refer to the <a href="https://developer.paypal.com/docs/multiparty/checkout/standard/customize/buttons-style-guide/">Paypal documentation</a>.</p>
6665
+ </dd>
6666
+ <dt><a href="#OnClickEventData">OnClickEventData</a> : <code>object</code></dt>
6667
+ <dd><p>Interface for OnClickEventData</p>
6668
+ </dd>
6669
+ <dt><a href="#OnCloseEventData">OnCloseEventData</a> : <code>object</code></dt>
6670
+ <dd><p>Interface for OnCloseEventData</p>
6671
+ </dd>
6672
+ <dt><a href="#OnPaymentSuccessfulEventData">OnPaymentSuccessfulEventData</a> : <code>object</code></dt>
6673
+ <dd><p>Interface for OnPaymentSuccessfulEventData. For final secure results, fetch backend to backend data.</p>
6674
+ </dd>
6675
+ <dt><a href="#OnPaymentInReviewEventData">OnPaymentInReviewEventData</a> : <code>object</code></dt>
6676
+ <dd><p>Interface for OnPaymentInReviewEventData. For final secure results, fetch backend to backend data.</p>
6677
+ </dd>
6678
+ <dt><a href="#OnPaymentErrorEventData">OnPaymentErrorEventData</a> : <code>object</code></dt>
6679
+ <dd><p>Interface for OnPaymentErrorEventData. For final secure results, fetch backend to backend data.</p>
6680
+ </dd>
6681
+ <dt><a href="#OnUnavailableEventData">OnUnavailableEventData</a> : <code>object</code></dt>
6682
+ <dd><p>Interface for OnUnavailableEventData</p>
6683
+ </dd>
6684
+ <dt><a href="#OnErrorEventData">OnErrorEventData</a> : <code>object</code></dt>
6685
+ <dd><p>Interface for OnErrorEventData</p>
6686
+ </dd>
6687
+ </dl>
6688
+
6689
+ <a name="ApplePayWalletMeta" id="ApplePayWalletMeta" href="#ApplePayWalletMeta">&nbsp;</a>
6690
+
6691
+ ## ApplePayWalletMeta : <code>object</code>
6692
+ Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process.
6693
+
6694
+ **Kind**: global interface
6695
+
6696
+ | Param | Type | Description |
6697
+ | --- | --- | --- |
6698
+ | amount_label | <code>string</code> | Label shown next to the total amount to be paid, used in ApplePay popups. |
6699
+ | country | <code>string</code> | Country of the user in 2 letter ISO code format, required for ApplePay. |
6700
+ | currency | <code>string</code> | Currency of the transaction. ISO 4217 currency code format. |
6701
+ | amount | <code>number</code> | Total transaction amount number. **Note:** this amount will be presented in the payment sheet regardless of amount sent in the Wallet Initialization Backend to Backend call. Use `setMeta` method to keep it up to date. |
6702
+ | [merchant_capabilities] | <code>Array.&lt;(&#x27;supports3DS&#x27;\|&#x27;supportsEMV&#x27;\|&#x27;supportsCredit&#x27;\|&#x27;supportsDebit&#x27;)&gt;</code> | Array of capabilities that the merchant supports, influencing the transaction processing features available. |
6703
+ | [supported_networks] | <code>Array.&lt;(&#x27;visa&#x27;\|&#x27;masterCard&#x27;\|&#x27;amex&#x27;\|&#x27;chinaUnionPay&#x27;\|&#x27;discover&#x27;\|&#x27;interac&#x27;\|&#x27;jcb&#x27;\|&#x27;privateLabel&#x27;)&gt;</code> | List of payment networks supported by the merchant for ApplePay transactions. |
6704
+ | [required_billing_contact_fields] | <code>Array.&lt;(&#x27;email&#x27;\|&#x27;name&#x27;\|&#x27;phone&#x27;\|&#x27;postalAddress&#x27;)&gt;</code> | Contact fields required from the user for billing purposes, improving transaction verification and fraud prevention. Phone and email are currently not returned by Apple. |
6705
+ | [required_shipping_contact_fields] | <code>Array.&lt;(&#x27;email&#x27;\|&#x27;phone&#x27;)&gt;</code> | Shipping contact fields that are mandatory to complete the transaction. Use email and phone to collect from customer wallet in the abscense of billing one. |
6706
+ | [supported_countries] | <code>Array.&lt;string&gt;</code> | List of countries where ApplePay is supported by the merchant, restricting usage to specified regions. |
6707
+ | [style] | <code>object</code> | Styling configuration for ApplePay buttons displayed during checkout. |
6708
+ | [style.button_type] | <code>ApplePayButtonType</code> | Enum type to select the type of ApplePay button (e.g., 'buy', 'donate', etc.), providing user interface customization. |
6709
+ | [style.button_style] | <code>ApplePayButtonStyle</code> | Style applied to the ApplePay button, which can include color and form factor adjustments according to the brand's visual guidelines. |
6710
+
6711
+ <a name="PaypalWalletMeta" id="PaypalWalletMeta" href="#PaypalWalletMeta">&nbsp;</a>
6712
+
6713
+ ## PaypalWalletMeta : <code>object</code>
6714
+ Interface for configuration metadata specific to PayPal integration in the wallet checkout and payment process.
6715
+ For in-depth information, please refer to the [Paypal documentation](https://developer.paypal.com/docs/multiparty/checkout/standard/customize/buttons-style-guide/).
6716
+
6717
+ **Kind**: global interface
6718
+
6719
+ | Param | Type | Description |
6720
+ | --- | --- | --- |
6721
+ | amount | <code>number</code> | Total amount of the transaction. Represents the money to be charged. |
6722
+ | currency | <code>string</code> | Currency of the transaction in ISO 4217 currency code format. |
6723
+ | [pay_later] | <code>boolean</code> | Flag to enable Pay Later feature of PayPal, allowing Pay in 4. Default false. |
6724
+ | [standalone] | <code>boolean</code> | Flag to specify if the PayPal standalone button should be used. Default false. |
6725
+ | [capture] | <code>boolean</code> | Flag to specify if the transaction amount should be captured immediately or authorized for later capture. Default false. |
6726
+ | [style] | <code>object</code> | Styling configurations for the PayPal widget. |
6727
+ | [style.layout] | <code>&#x27;vertical&#x27;</code> \| <code>&#x27;horizontal&#x27;</code> | Layout orientation of the PayPal button. |
6728
+ | [style.color] | <code>&#x27;gold&#x27;</code> \| <code>&#x27;blue&#x27;</code> \| <code>&#x27;silver&#x27;</code> \| <code>&#x27;black&#x27;</code> \| <code>&#x27;white&#x27;</code> | Color theme of the PayPal button. |
6729
+ | [style.shape] | <code>&#x27;rect&#x27;</code> \| <code>&#x27;pill&#x27;</code> \| <code>&#x27;sharp&#x27;</code> | Shape of the PayPal button. |
6730
+ | [style.borderRadius] | <code>number</code> | Border radius for the button, allowing customization of corner roundness. |
6731
+ | [style.height] | <code>number</code> | Height of the PayPal button, allowing for size customization. |
6732
+ | [style.disableMaxWidth] | <code>boolean</code> | Flag to disable the maximum width constraint of the button. |
6733
+ | [style.label] | <code>&#x27;paypal&#x27;</code> \| <code>&#x27;checkout&#x27;</code> \| <code>&#x27;buynow&#x27;</code> \| <code>&#x27;pay&#x27;</code> \| <code>&#x27;installment&#x27;</code> | Label text displayed on the PayPal button. |
6734
+ | [style.tagline] | <code>boolean</code> | Flag to include or exclude a tagline beneath the button text. |
6735
+ | [style.messages] | <code>object</code> | Messaging options related to the PayPal button to enhance user interaction. |
6736
+ | [style.messages.layout] | <code>&#x27;text&#x27;</code> \| <code>&#x27;flex&#x27;</code> | Layout type for the messages displayed near the PayPal button. |
6737
+ | [style.messages.logo] | <code>object</code> | Configuration for the logo to be displayed with the PayPal button. |
6738
+ | [style.messages.logo.type] | <code>&#x27;primary&#x27;</code> \| <code>&#x27;alternative&#x27;</code> \| <code>&#x27;inline&#x27;</code> \| <code>&#x27;none&#x27;</code> | Type of logo to display. |
6739
+ | [style.messages.logo.position] | <code>&#x27;left&#x27;</code> \| <code>&#x27;right&#x27;</code> \| <code>&#x27;top&#x27;</code> | Position of the logo relative to the button or message. |
6740
+ | [style.messages.text] | <code>object</code> | Text styling within the message component. |
6741
+ | [style.messages.text.color] | <code>&#x27;black&#x27;</code> \| <code>&#x27;white&#x27;</code> \| <code>&#x27;monochrome&#x27;</code> \| <code>&#x27;grayscale&#x27;</code> | Color of the message text. |
6742
+ | [style.messages.text.size] | <code>10</code> \| <code>11</code> \| <code>12</code> \| <code>13</code> \| <code>14</code> \| <code>15</code> \| <code>16</code> | Font size of the message text. |
6743
+ | [style.messages.text.align] | <code>&#x27;left&#x27;</code> \| <code>&#x27;center&#x27;</code> \| <code>&#x27;right&#x27;</code> | Text alignment within the message area. |
6744
+ | [style.messages.color] | <code>&#x27;blue&#x27;</code> \| <code>&#x27;black&#x27;</code> \| <code>&#x27;white&#x27;</code> \| <code>&#x27;white-no-border&#x27;</code> \| <code>&#x27;gray&#x27;</code> \| <code>&#x27;monochrome&#x27;</code> \| <code>&#x27;grayscale&#x27;</code> | Background color of the message area. |
6745
+ | [style.messages.ratio] | <code>&#x27;1x1&#x27;</code> \| <code>&#x27;1x4&#x27;</code> \| <code>&#x27;8x1&#x27;</code> \| <code>&#x27;20x1&#x27;</code> | Aspect ratio of the message area, affecting its layout and display. |
6746
+
6747
+ <a name="OnClickEventData" id="OnClickEventData" href="#OnClickEventData">&nbsp;</a>
6748
+
6749
+ ## OnClickEventData : <code>object</code>
6750
+ Interface for OnClickEventData
6751
+
6752
+ **Kind**: global interface
6753
+
6754
+ | Param | Type | Description |
6755
+ | --- | --- | --- |
6756
+ | event | <code>string</code> | Event Name is 'onClick' |
6757
+
6758
+ <a name="OnCloseEventData" id="OnCloseEventData" href="#OnCloseEventData">&nbsp;</a>
6759
+
6760
+ ## OnCloseEventData : <code>object</code>
6761
+ Interface for OnCloseEventData
6762
+
6763
+ **Kind**: global interface
6764
+
6765
+ | Param | Type | Description |
6766
+ | --- | --- | --- |
6767
+ | event | <code>string</code> | Event Name is 'onCheckoutClose' |
6768
+ | [chargeId] | <code>string</code> | chargeId in case it's already set after onClick event |
6769
+
6770
+ <a name="OnPaymentSuccessfulEventData" id="OnPaymentSuccessfulEventData" href="#OnPaymentSuccessfulEventData">&nbsp;</a>
6771
+
6772
+ ## OnPaymentSuccessfulEventData : <code>object</code>
6773
+ Interface for OnPaymentSuccessfulEventData. For final secure results, fetch backend to backend data.
6774
+
6775
+ **Kind**: global interface
6776
+
6777
+ | Param | Type | Description |
6778
+ | --- | --- | --- |
6779
+ | event | <code>string</code> | Event Name is 'paymentSuccessful' |
6780
+ | chargeId | <code>string</code> | chargeId set after onClick event |
6781
+ | data.id | <code>string</code> | Charge ID returned by server |
6782
+ | data.amount | <code>string</code> | Charge amount returned by server |
6783
+ | data.currency | <code>string</code> | Charge currency returned by server |
6784
+ | data.status | <code>string</code> | Charge status returned by server |
6785
+
6786
+ <a name="OnPaymentInReviewEventData" id="OnPaymentInReviewEventData" href="#OnPaymentInReviewEventData">&nbsp;</a>
6787
+
6788
+ ## OnPaymentInReviewEventData : <code>object</code>
6789
+ Interface for OnPaymentInReviewEventData. For final secure results, fetch backend to backend data.
6790
+
6791
+ **Kind**: global interface
6792
+
6793
+ | Param | Type | Description |
6794
+ | --- | --- | --- |
6795
+ | event | <code>string</code> | Event Name is 'paymentInReview' |
6796
+ | chargeId | <code>string</code> | chargeId set after onClick event |
6797
+ | data.id | <code>string</code> | Charge ID returned by server |
6798
+ | data.amount | <code>string</code> | Charge amount returned by server |
6799
+ | data.currency | <code>string</code> | Charge currency returned by server |
6800
+ | data.status | <code>string</code> | Charge status returned by server |
6801
+
6802
+ <a name="OnPaymentErrorEventData" id="OnPaymentErrorEventData" href="#OnPaymentErrorEventData">&nbsp;</a>
6803
+
6804
+ ## OnPaymentErrorEventData : <code>object</code>
6805
+ Interface for OnPaymentErrorEventData. For final secure results, fetch backend to backend data.
6806
+
6807
+ **Kind**: global interface
6808
+
6809
+ | Param | Type | Description |
6810
+ | --- | --- | --- |
6811
+ | event | <code>string</code> | Event Name is 'paymentError' |
6812
+ | chargeId | <code>string</code> | chargeId set after onClick event |
6813
+ | [data.message] | <code>string</code> | Error message |
6814
+ | [data.code] | <code>string</code> | Error code |
6815
+
6816
+ <a name="OnUnavailableEventData" id="OnUnavailableEventData" href="#OnUnavailableEventData">&nbsp;</a>
6817
+
6818
+ ## OnUnavailableEventData : <code>object</code>
6819
+ Interface for OnUnavailableEventData
6820
+
6821
+ **Kind**: global interface
6822
+
6823
+ | Param | Type | Description |
6824
+ | --- | --- | --- |
6825
+ | event | <code>string</code> | Event Name is 'unavailable' |
6826
+
6827
+ <a name="OnErrorEventData" id="OnErrorEventData" href="#OnErrorEventData">&nbsp;</a>
6828
+
6829
+ ## OnErrorEventData : <code>object</code>
6830
+ Interface for OnErrorEventData
6831
+
6832
+ **Kind**: global interface
6833
+
6834
+ | Param | Type | Description |
6835
+ | --- | --- | --- |
6836
+ | event | <code>string</code> | Event Name is 'error' |
6837
+ | [chargeId] | <code>string</code> | chargeId in case it's already set after onClick event |
6838
+ | [data] | <code>Error</code> | Error object if present |
6839
+
6840
+ <a name="ApplePayWalletButtonExpress" id="ApplePayWalletButtonExpress" href="#ApplePayWalletButtonExpress">&nbsp;</a>
6841
+
6842
+ ## ApplePayWalletButtonExpress ⇐ <code>BaseWalletButton</code>
6843
+ Class ApplePayWalletButtonExpress to work with Apple Pay Wallet.
6844
+
6845
+ **Kind**: global class
6846
+ **Extends**: <code>BaseWalletButton</code>
6847
+
6848
+ * [ApplePayWalletButtonExpress](#ApplePayWalletButtonExpress) ⇐ <code>BaseWalletButton</code>
6849
+ * [new ApplePayWalletButtonExpress(selector, publicKeyOrAccessToken, gatewayId, meta)](#new_ApplePayWalletButtonExpress_new)
6850
+ * [.load()](#ApplePayWalletButtonExpress+load)
6851
+ * [.setMeta(meta)](#ApplePayWalletButtonExpress+setMeta)
6852
+ * [.setEnv(env, [alias])](#BaseWalletButton+setEnv)
6853
+ * [.onClick(handler)](#BaseWalletButton+onClick)
6854
+ * [.onPaymentSuccessful([handler])](#BaseWalletButton+onPaymentSuccessful)
6855
+ * [.onPaymentInReview([handler])](#BaseWalletButton+onPaymentInReview)
6856
+ * [.onPaymentError([handler])](#BaseWalletButton+onPaymentError)
6857
+ * [.onCheckoutClose(handler)](#BaseWalletButton+onCheckoutClose)
6858
+ * [.onUnavailable(handler)](#BaseWalletButton+onUnavailable)
6859
+ * [.onError(handler)](#BaseWalletButton+onError)
6860
+
6861
+ <a name="new_ApplePayWalletButtonExpress_new" id="new_ApplePayWalletButtonExpress_new" href="#new_ApplePayWalletButtonExpress_new">&nbsp;</a>
6862
+
6863
+ ### new ApplePayWalletButtonExpress(selector, publicKeyOrAccessToken, gatewayId, meta)
6864
+
6865
+ | Param | Type | Description |
6866
+ | --- | --- | --- |
6867
+ | selector | <code>string</code> | Selector of html element. Container for the ApplePayWalletButtonExpress. |
6868
+ | publicKeyOrAccessToken | <code>string</code> | Public key or Access token for the ApplePayWalletButtonExpress. |
6869
+ | gatewayId | <code>string</code> | Gateway ID for the ApplePayWalletButtonExpress. |
6870
+ | meta | [<code>ApplePayWalletMeta</code>](#ApplePayWalletMeta) | data that configures the Apple Pay Wallet. |
6871
+
6872
+ **Example**
6873
+ ```js
6874
+ var button = new ApplePayWalletButtonExpress('#wallet-buttons', 'publicKeyOrAccessToken', 'gatewayId', meta);
6875
+ ```
6876
+ <a name="ApplePayWalletButtonExpress+load" id="ApplePayWalletButtonExpress+load" href="#ApplePayWalletButtonExpress+load">&nbsp;</a>
6877
+
6878
+ ### applePayWalletButtonExpress.load()
6879
+ Initializes the availability checks and inserts the button if possible.
6880
+ Otherwise function onUnavailable(handler: VoidFunction) will be called.
6881
+ **Important**: Is required to invoke this method to render the wallet button.
6882
+
6883
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6884
+ **Example**
6885
+ ```js
6886
+ button.load();
6887
+ ```
6888
+ <a name="ApplePayWalletButtonExpress+setMeta" id="ApplePayWalletButtonExpress+setMeta" href="#ApplePayWalletButtonExpress+setMeta">&nbsp;</a>
6889
+
6890
+ ### applePayWalletButtonExpress.setMeta(meta)
6891
+ Call this method if updating the originally-provided meta object after order information changed.
6892
+ For example, if the order amount has changed from the time where the button was originally rendered.
6893
+
6894
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6895
+
6896
+ | Param | Type | Description |
6897
+ | --- | --- | --- |
6898
+ | meta | [<code>ApplePayWalletMeta</code>](#ApplePayWalletMeta) | // data that configures the Apple Pay Wallet. |
6899
+
6900
+ **Example**
6901
+ ```js
6902
+ button.setMeta(meta);
6903
+ ```
6904
+ <a name="BaseWalletButton+setEnv" id="BaseWalletButton+setEnv" href="#BaseWalletButton+setEnv">&nbsp;</a>
6905
+
6906
+ ### applePayWalletButtonExpress.setEnv(env, [alias])
6907
+ Current method can change environment. By default environment = sandbox.
6908
+ Also we can change domain alias for this environment. By default domain_alias = paydock.com
6909
+ Bear in mind that you must set an environment before calling `button.load()`.
6910
+
6911
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6912
+ **Overrides**: [<code>setEnv</code>](#BaseWalletButton+setEnv)
6913
+
6914
+ | Param | Type | Description |
6915
+ | --- | --- | --- |
6916
+ | env | <code>string</code> | sandbox, production |
6917
+ | [alias] | <code>string</code> | Own domain alias |
6918
+
6919
+ **Example**
6920
+ ```js
6921
+ button.setEnv('production', 'paydock.com');
6922
+ ```
6923
+ <a name="BaseWalletButton+onClick" id="BaseWalletButton+onClick" href="#BaseWalletButton+onClick">&nbsp;</a>
6924
+
6925
+ ### applePayWalletButtonExpress.onClick(handler)
6926
+ Registers a callback function to be invoked when the wallet button gets clicked.
6927
+ **Note:** is mandatory to handle this event to perform the wallet initialization (and optionally any validation logic).
6928
+ The event handler needs to return the wallet token string in order for the Wallet charge processing to proceed, or throw an error in case of failure or validation errors.
6929
+ **Note:** this callback may be called multiple times as the customer closes the payment checkout and re-clicks the button.
6930
+ It's the merchant's responsibility to handle this situation and evaluate in each case if generating a new WalletCharge Token is required or the previous one can be used in each case, depending on order data and updates.
6931
+ In case a new one needs to be generated, remember it will need to be preceded by a `setMeta` call.
6932
+
6933
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6934
+ **Overrides**: [<code>onClick</code>](#BaseWalletButton+onClick)
6935
+
6936
+ | Param | Type | Description |
6937
+ | --- | --- | --- |
6938
+ | handler | [<code>OnClickCallback</code>](#OnClickCallback) | Function to be called when the wallet button is clicked. |
6939
+
6940
+ **Example**
6941
+ ```js
6942
+ button.onClick(async (data) => {
6943
+ const responseData = await fetch('https://your-server.com/init-wallet-charge');
6944
+ return responseData.walletToken;
6945
+ });
6946
+ ```
6947
+ <a name="BaseWalletButton+onPaymentSuccessful" id="BaseWalletButton+onPaymentSuccessful" href="#BaseWalletButton+onPaymentSuccessful">&nbsp;</a>
6948
+
6949
+ ### applePayWalletButtonExpress.onPaymentSuccessful([handler])
6950
+ If the payment was successful, the function passed as parameter will be called.
6951
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
6952
+
6953
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6954
+ **Overrides**: [<code>onPaymentSuccessful</code>](#BaseWalletButton+onPaymentSuccessful)
6955
+
6956
+ | Param | Type | Description |
6957
+ | --- | --- | --- |
6958
+ | [handler] | [<code>OnPaymentSuccessfulCallback</code>](#OnPaymentSuccessfulCallback) | Function to be called when the payment was successful. |
6959
+
6960
+ **Example**
6961
+ ```js
6962
+ button.onPaymentSuccessful((data) => {
6963
+ console.log('Payment successful!');
6964
+ });
6965
+ ```
6966
+ **Example**
6967
+ ```js
6968
+ button.onPaymentSuccessful().then((data) => console.log('Payment successful!'));
6969
+ ```
6970
+ <a name="BaseWalletButton+onPaymentInReview" id="BaseWalletButton+onPaymentInReview" href="#BaseWalletButton+onPaymentInReview">&nbsp;</a>
6971
+
6972
+ ### applePayWalletButtonExpress.onPaymentInReview([handler])
6973
+ If the payment was left in fraud review, the function passed as parameter will be called.
6974
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
6975
+
6976
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
6977
+ **Overrides**: [<code>onPaymentInReview</code>](#BaseWalletButton+onPaymentInReview)
6978
+
6979
+ | Param | Type | Description |
6980
+ | --- | --- | --- |
6981
+ | [handler] | [<code>OnPaymentInReviewCallback</code>](#OnPaymentInReviewCallback) | Function to be called when the payment was left in fraud review status. |
6982
+
6983
+ **Example**
6984
+ ```js
6985
+ button.onPaymentInReview((data) => {
6986
+ console.log('Payment in fraud review');
6987
+ });
6988
+ ```
6989
+ **Example**
6990
+ ```js
6991
+ button.onPaymentInReview().then((data) => console.log('Payment in fraud review'));
6992
+ ```
6993
+ <a name="BaseWalletButton+onPaymentError" id="BaseWalletButton+onPaymentError" href="#BaseWalletButton+onPaymentError">&nbsp;</a>
6994
+
6995
+ ### applePayWalletButtonExpress.onPaymentError([handler])
6996
+ If the payment was not successful, the function passed as parameter will be called.
6997
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
6998
+
6999
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
7000
+ **Overrides**: [<code>onPaymentError</code>](#BaseWalletButton+onPaymentError)
7001
+
7002
+ | Param | Type | Description |
7003
+ | --- | --- | --- |
7004
+ | [handler] | [<code>OnPaymentErrorCallback</code>](#OnPaymentErrorCallback) | Function to be called when the payment was not successful. |
7005
+
7006
+ **Example**
7007
+ ```js
7008
+ button.onPaymentError((err) => {
7009
+ console.log('Payment not successful');
7010
+ });
7011
+ ```
7012
+ **Example**
7013
+ ```js
7014
+ button.onPaymentError().then((err) => console.log('Payment not successful'));
7015
+ ```
7016
+ <a name="BaseWalletButton+onCheckoutClose" id="BaseWalletButton+onCheckoutClose" href="#BaseWalletButton+onCheckoutClose">&nbsp;</a>
7017
+
7018
+ ### applePayWalletButtonExpress.onCheckoutClose(handler)
7019
+ Registers a callback function to be invoked when the wallet checkout closes.
7020
+
7021
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
7022
+ **Overrides**: [<code>onCheckoutClose</code>](#BaseWalletButton+onCheckoutClose)
7023
+
7024
+ | Param | Type | Description |
7025
+ | --- | --- | --- |
7026
+ | handler | [<code>OnCheckoutCloseCallback</code>](#OnCheckoutCloseCallback) | Function to be called when the wallet checkout closes. |
7027
+
7028
+ **Example**
7029
+ ```js
7030
+ button.onCheckoutClose(() => {
7031
+ console.log('Wallet checkout closes');
7032
+ });
7033
+ ```
7034
+ <a name="BaseWalletButton+onUnavailable" id="BaseWalletButton+onUnavailable" href="#BaseWalletButton+onUnavailable">&nbsp;</a>
7035
+
7036
+ ### applePayWalletButtonExpress.onUnavailable(handler)
7037
+ Registers a callback function to be invoked when the wallet is not available in the current context.
7038
+
7039
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
7040
+ **Overrides**: [<code>onUnavailable</code>](#BaseWalletButton+onUnavailable)
7041
+
7042
+ | Param | Type | Description |
7043
+ | --- | --- | --- |
7044
+ | handler | [<code>OnUnavailableCallback</code>](#OnUnavailableCallback) | Function to be called when the wallet is not available in the current context. |
7045
+
7046
+ **Example**
7047
+ ```js
7048
+ button.onUnavailable(() => {
7049
+ console.log('Wallet not available');
7050
+ });
7051
+ ```
7052
+ <a name="BaseWalletButton+onError" id="BaseWalletButton+onError" href="#BaseWalletButton+onError">&nbsp;</a>
7053
+
7054
+ ### applePayWalletButtonExpress.onError(handler)
7055
+ Registers a callback function to be invoked when an error that is not related to payment execution occurs.
7056
+ For example, if the amount of the wallet token injected via the `onClick` event handler does not match the amount provided via the initial `meta` or `setMeta` method.
7057
+
7058
+ **Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
7059
+ **Overrides**: [<code>onError</code>](#BaseWalletButton+onError)
7060
+
7061
+ | Param | Type | Description |
7062
+ | --- | --- | --- |
7063
+ | handler | [<code>OnErrorCallback</code>](#OnErrorCallback) | Function to be called when the WalletButton has an error. |
7064
+
7065
+ **Example**
7066
+ ```js
7067
+ button.onError((error) => {
7068
+ console.log('WalletButtonExpress error', error);
7069
+ });
7070
+ ```
7071
+ <a name="PaypalWalletButtonExpress" id="PaypalWalletButtonExpress" href="#PaypalWalletButtonExpress">&nbsp;</a>
7072
+
7073
+ ## PaypalWalletButtonExpress ⇐ <code>BaseWalletButton</code>
7074
+ Class PaypalWalletButtonExpress to work with Paypal Wallet.
7075
+
7076
+ **Kind**: global class
7077
+ **Extends**: <code>BaseWalletButton</code>
7078
+
7079
+ * [PaypalWalletButtonExpress](#PaypalWalletButtonExpress) ⇐ <code>BaseWalletButton</code>
7080
+ * [new PaypalWalletButtonExpress(selector, publicKeyOrAccessToken, gatewayId, meta)](#new_PaypalWalletButtonExpress_new)
7081
+ * [.load()](#PaypalWalletButtonExpress+load)
7082
+ * [.setMeta(meta)](#PaypalWalletButtonExpress+setMeta)
7083
+ * [.setEnv(env, [alias])](#BaseWalletButton+setEnv)
7084
+ * [.onClick(handler)](#BaseWalletButton+onClick)
7085
+ * [.onPaymentSuccessful([handler])](#BaseWalletButton+onPaymentSuccessful)
7086
+ * [.onPaymentInReview([handler])](#BaseWalletButton+onPaymentInReview)
7087
+ * [.onPaymentError([handler])](#BaseWalletButton+onPaymentError)
7088
+ * [.onCheckoutClose(handler)](#BaseWalletButton+onCheckoutClose)
7089
+ * [.onUnavailable(handler)](#BaseWalletButton+onUnavailable)
7090
+ * [.onError(handler)](#BaseWalletButton+onError)
7091
+
7092
+ <a name="new_PaypalWalletButtonExpress_new" id="new_PaypalWalletButtonExpress_new" href="#new_PaypalWalletButtonExpress_new">&nbsp;</a>
7093
+
7094
+ ### new PaypalWalletButtonExpress(selector, publicKeyOrAccessToken, gatewayId, meta)
7095
+
7096
+ | Param | Type | Description |
7097
+ | --- | --- | --- |
7098
+ | selector | <code>string</code> | Selector of html element. Container for the PaypalWalletButtonExpress. |
7099
+ | publicKeyOrAccessToken | <code>string</code> | Public key or Access token for the PaypalWalletButtonExpress. |
7100
+ | gatewayId | <code>string</code> | Gateway ID for the PaypalWalletButtonExpress. |
7101
+ | meta | [<code>PaypalWalletMeta</code>](#PaypalWalletMeta) | data that configures the Paypal Wallet. |
7102
+
7103
+ **Example**
7104
+ ```js
7105
+ var button = new PaypalWalletButtonExpress('#wallet-buttons', 'publicKeyOrAccessToken', 'gatewayId', meta);
7106
+ ```
7107
+ <a name="PaypalWalletButtonExpress+load" id="PaypalWalletButtonExpress+load" href="#PaypalWalletButtonExpress+load">&nbsp;</a>
7108
+
7109
+ ### paypalWalletButtonExpress.load()
7110
+ Initializes the availability checks and inserts the button if possible.
7111
+ Otherwise function onUnavailable(handler: VoidFunction) will be called.
7112
+ **Important**: Is required to invoke this method to render the wallet button.
7113
+
7114
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7115
+ **Example**
7116
+ ```js
7117
+ button.load();
7118
+ ```
7119
+ <a name="PaypalWalletButtonExpress+setMeta" id="PaypalWalletButtonExpress+setMeta" href="#PaypalWalletButtonExpress+setMeta">&nbsp;</a>
7120
+
7121
+ ### paypalWalletButtonExpress.setMeta(meta)
7122
+ Call this method if updating the originally-provided meta object after order information changed.
7123
+ For example, if the order amount has changed from the time where the button was originally rendered.
7124
+
7125
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7126
+
7127
+ | Param | Type | Description |
7128
+ | --- | --- | --- |
7129
+ | meta | [<code>PaypalWalletMeta</code>](#PaypalWalletMeta) | // data that configures the Paypal Wallet. |
7130
+
7131
+ **Example**
7132
+ ```js
7133
+ button.setMeta(meta);
7134
+ ```
7135
+ <a name="BaseWalletButton+setEnv" id="BaseWalletButton+setEnv" href="#BaseWalletButton+setEnv">&nbsp;</a>
7136
+
7137
+ ### paypalWalletButtonExpress.setEnv(env, [alias])
7138
+ Current method can change environment. By default environment = sandbox.
7139
+ Also we can change domain alias for this environment. By default domain_alias = paydock.com
7140
+ Bear in mind that you must set an environment before calling `button.load()`.
7141
+
7142
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7143
+ **Overrides**: [<code>setEnv</code>](#BaseWalletButton+setEnv)
7144
+
7145
+ | Param | Type | Description |
7146
+ | --- | --- | --- |
7147
+ | env | <code>string</code> | sandbox, production |
7148
+ | [alias] | <code>string</code> | Own domain alias |
7149
+
7150
+ **Example**
7151
+ ```js
7152
+ button.setEnv('production', 'paydock.com');
7153
+ ```
7154
+ <a name="BaseWalletButton+onClick" id="BaseWalletButton+onClick" href="#BaseWalletButton+onClick">&nbsp;</a>
7155
+
7156
+ ### paypalWalletButtonExpress.onClick(handler)
7157
+ Registers a callback function to be invoked when the wallet button gets clicked.
7158
+ **Note:** is mandatory to handle this event to perform the wallet initialization (and optionally any validation logic).
7159
+ The event handler needs to return the wallet token string in order for the Wallet charge processing to proceed, or throw an error in case of failure or validation errors.
7160
+ **Note:** this callback may be called multiple times as the customer closes the payment checkout and re-clicks the button.
7161
+ It's the merchant's responsibility to handle this situation and evaluate in each case if generating a new WalletCharge Token is required or the previous one can be used in each case, depending on order data and updates.
7162
+ In case a new one needs to be generated, remember it will need to be preceded by a `setMeta` call.
7163
+
7164
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7165
+ **Overrides**: [<code>onClick</code>](#BaseWalletButton+onClick)
7166
+
7167
+ | Param | Type | Description |
7168
+ | --- | --- | --- |
7169
+ | handler | [<code>OnClickCallback</code>](#OnClickCallback) | Function to be called when the wallet button is clicked. |
7170
+
7171
+ **Example**
7172
+ ```js
7173
+ button.onClick(async (data) => {
7174
+ const responseData = await fetch('https://your-server.com/init-wallet-charge');
7175
+ return responseData.walletToken;
7176
+ });
7177
+ ```
7178
+ <a name="BaseWalletButton+onPaymentSuccessful" id="BaseWalletButton+onPaymentSuccessful" href="#BaseWalletButton+onPaymentSuccessful">&nbsp;</a>
7179
+
7180
+ ### paypalWalletButtonExpress.onPaymentSuccessful([handler])
7181
+ If the payment was successful, the function passed as parameter will be called.
7182
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
7183
+
7184
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7185
+ **Overrides**: [<code>onPaymentSuccessful</code>](#BaseWalletButton+onPaymentSuccessful)
7186
+
7187
+ | Param | Type | Description |
7188
+ | --- | --- | --- |
7189
+ | [handler] | [<code>OnPaymentSuccessfulCallback</code>](#OnPaymentSuccessfulCallback) | Function to be called when the payment was successful. |
7190
+
7191
+ **Example**
7192
+ ```js
7193
+ button.onPaymentSuccessful((data) => {
7194
+ console.log('Payment successful!');
7195
+ });
7196
+ ```
7197
+ **Example**
7198
+ ```js
7199
+ button.onPaymentSuccessful().then((data) => console.log('Payment successful!'));
7200
+ ```
7201
+ <a name="BaseWalletButton+onPaymentInReview" id="BaseWalletButton+onPaymentInReview" href="#BaseWalletButton+onPaymentInReview">&nbsp;</a>
7202
+
7203
+ ### paypalWalletButtonExpress.onPaymentInReview([handler])
7204
+ If the payment was left in fraud review, the function passed as parameter will be called.
7205
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
7206
+
7207
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7208
+ **Overrides**: [<code>onPaymentInReview</code>](#BaseWalletButton+onPaymentInReview)
7209
+
7210
+ | Param | Type | Description |
7211
+ | --- | --- | --- |
7212
+ | [handler] | [<code>OnPaymentInReviewCallback</code>](#OnPaymentInReviewCallback) | Function to be called when the payment was left in fraud review status. |
7213
+
7214
+ **Example**
7215
+ ```js
7216
+ button.onPaymentInReview((data) => {
7217
+ console.log('Payment in fraud review');
7218
+ });
7219
+ ```
7220
+ **Example**
7221
+ ```js
7222
+ button.onPaymentInReview().then((data) => console.log('Payment in fraud review'));
7223
+ ```
7224
+ <a name="BaseWalletButton+onPaymentError" id="BaseWalletButton+onPaymentError" href="#BaseWalletButton+onPaymentError">&nbsp;</a>
7225
+
7226
+ ### paypalWalletButtonExpress.onPaymentError([handler])
7227
+ If the payment was not successful, the function passed as parameter will be called.
7228
+ Important: Do not perform thread blocking operations in callback such as window.alert() calls.
7229
+
7230
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7231
+ **Overrides**: [<code>onPaymentError</code>](#BaseWalletButton+onPaymentError)
7232
+
7233
+ | Param | Type | Description |
7234
+ | --- | --- | --- |
7235
+ | [handler] | [<code>OnPaymentErrorCallback</code>](#OnPaymentErrorCallback) | Function to be called when the payment was not successful. |
7236
+
7237
+ **Example**
7238
+ ```js
7239
+ button.onPaymentError((err) => {
7240
+ console.log('Payment not successful');
7241
+ });
7242
+ ```
7243
+ **Example**
7244
+ ```js
7245
+ button.onPaymentError().then((err) => console.log('Payment not successful'));
7246
+ ```
7247
+ <a name="BaseWalletButton+onCheckoutClose" id="BaseWalletButton+onCheckoutClose" href="#BaseWalletButton+onCheckoutClose">&nbsp;</a>
7248
+
7249
+ ### paypalWalletButtonExpress.onCheckoutClose(handler)
7250
+ Registers a callback function to be invoked when the wallet checkout closes.
7251
+
7252
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7253
+ **Overrides**: [<code>onCheckoutClose</code>](#BaseWalletButton+onCheckoutClose)
7254
+
7255
+ | Param | Type | Description |
7256
+ | --- | --- | --- |
7257
+ | handler | [<code>OnCheckoutCloseCallback</code>](#OnCheckoutCloseCallback) | Function to be called when the wallet checkout closes. |
7258
+
7259
+ **Example**
7260
+ ```js
7261
+ button.onCheckoutClose(() => {
7262
+ console.log('Wallet checkout closes');
7263
+ });
7264
+ ```
7265
+ <a name="BaseWalletButton+onUnavailable" id="BaseWalletButton+onUnavailable" href="#BaseWalletButton+onUnavailable">&nbsp;</a>
7266
+
7267
+ ### paypalWalletButtonExpress.onUnavailable(handler)
7268
+ Registers a callback function to be invoked when the wallet is not available in the current context.
7269
+
7270
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7271
+ **Overrides**: [<code>onUnavailable</code>](#BaseWalletButton+onUnavailable)
7272
+
7273
+ | Param | Type | Description |
7274
+ | --- | --- | --- |
7275
+ | handler | [<code>OnUnavailableCallback</code>](#OnUnavailableCallback) | Function to be called when the wallet is not available in the current context. |
7276
+
7277
+ **Example**
7278
+ ```js
7279
+ button.onUnavailable(() => {
7280
+ console.log('Wallet not available');
7281
+ });
7282
+ ```
7283
+ <a name="BaseWalletButton+onError" id="BaseWalletButton+onError" href="#BaseWalletButton+onError">&nbsp;</a>
7284
+
7285
+ ### paypalWalletButtonExpress.onError(handler)
7286
+ Registers a callback function to be invoked when an error that is not related to payment execution occurs.
7287
+ For example, if the amount of the wallet token injected via the `onClick` event handler does not match the amount provided via the initial `meta` or `setMeta` method.
7288
+
7289
+ **Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
7290
+ **Overrides**: [<code>onError</code>](#BaseWalletButton+onError)
7291
+
7292
+ | Param | Type | Description |
7293
+ | --- | --- | --- |
7294
+ | handler | [<code>OnErrorCallback</code>](#OnErrorCallback) | Function to be called when the WalletButton has an error. |
7295
+
7296
+ **Example**
7297
+ ```js
7298
+ button.onError((error) => {
7299
+ console.log('WalletButtonExpress error', error);
7300
+ });
7301
+ ```
7302
+ <a name="EVENT" id="EVENT" href="#EVENT">&nbsp;</a>
7303
+
7304
+ ## EVENT : <code>object</code>
7305
+ List of available event's name in the wallet button lifecycle
7306
+
7307
+ **Kind**: global constant
7308
+
7309
+ | Param | Type | Default |
7310
+ | --- | --- | --- |
7311
+ | UNAVAILABLE | <code>string</code> | <code>&quot;unavailable&quot;</code> |
7312
+ | ERROR | <code>string</code> | <code>&quot;error&quot;</code> |
7313
+ | PAYMENT_SUCCESSFUL | <code>string</code> | <code>&quot;paymentSuccessful&quot;</code> |
7314
+ | PAYMENT_ERROR | <code>string</code> | <code>&quot;paymentError&quot;</code> |
7315
+ | PAYMENT_IN_REVIEW | <code>string</code> | <code>&quot;paymentInReview&quot;</code> |
7316
+ | ON_CLICK | <code>string</code> | <code>&quot;onClick&quot;</code> |
7317
+ | ON_CHECKOUT_CLOSE | <code>string</code> | <code>&quot;onCheckoutClose&quot;</code> |
7318
+
7319
+ <a name="OnClickCallback" id="OnClickCallback" href="#OnClickCallback">&nbsp;</a>
7320
+
7321
+ ## OnClickCallback ⇒ <code>Promise.&lt;string&gt;</code>
7322
+ Callback for onClick method.
7323
+
7324
+ **Kind**: global typedef
7325
+ **Returns**: <code>Promise.&lt;string&gt;</code> - walletToken string result
7326
+
7327
+ | Param | Type |
7328
+ | --- | --- |
7329
+ | data | [<code>OnClickEventData</code>](#OnClickEventData) |
7330
+
7331
+ <a name="OnPaymentSuccessfulCallback" id="OnPaymentSuccessfulCallback" href="#OnPaymentSuccessfulCallback">&nbsp;</a>
7332
+
7333
+ ## OnPaymentSuccessfulCallback : <code>function</code>
7334
+ Callback for onPaymentSuccessful method.
7335
+
7336
+ **Kind**: global typedef
7337
+
7338
+ | Param | Type |
7339
+ | --- | --- |
7340
+ | data | [<code>OnPaymentSuccessfulEventData</code>](#OnPaymentSuccessfulEventData) |
7341
+
7342
+ <a name="OnPaymentInReviewCallback" id="OnPaymentInReviewCallback" href="#OnPaymentInReviewCallback">&nbsp;</a>
7343
+
7344
+ ## OnPaymentInReviewCallback : <code>function</code>
7345
+ Callback for onPaymentInReview method.
7346
+
7347
+ **Kind**: global typedef
7348
+
7349
+ | Param | Type |
7350
+ | --- | --- |
7351
+ | data | [<code>OnPaymentInReviewEventData</code>](#OnPaymentInReviewEventData) |
7352
+
7353
+ <a name="OnPaymentErrorCallback" id="OnPaymentErrorCallback" href="#OnPaymentErrorCallback">&nbsp;</a>
7354
+
7355
+ ## OnPaymentErrorCallback : <code>function</code>
7356
+ Callback for onPaymentError method.
7357
+
7358
+ **Kind**: global typedef
7359
+
7360
+ | Param | Type |
7361
+ | --- | --- |
7362
+ | data | [<code>OnPaymentErrorEventData</code>](#OnPaymentErrorEventData) |
7363
+
7364
+ <a name="OnCheckoutCloseCallback" id="OnCheckoutCloseCallback" href="#OnCheckoutCloseCallback">&nbsp;</a>
7365
+
7366
+ ## OnCheckoutCloseCallback : <code>function</code>
7367
+ Callback for onCheckoutClose method.
7368
+
7369
+ **Kind**: global typedef
7370
+
7371
+ | Param | Type |
7372
+ | --- | --- |
7373
+ | data | [<code>OnCloseEventData</code>](#OnCloseEventData) |
7374
+
7375
+ <a name="OnUnavailableCallback" id="OnUnavailableCallback" href="#OnUnavailableCallback">&nbsp;</a>
7376
+
7377
+ ## OnUnavailableCallback : <code>function</code>
7378
+ Callback for onUnavailable method.
7379
+
7380
+ **Kind**: global typedef
7381
+
7382
+ | Param | Type |
7383
+ | --- | --- |
7384
+ | data | [<code>OnUnavailableEventData</code>](#OnUnavailableEventData) |
7385
+
7386
+ <a name="OnErrorCallback" id="OnErrorCallback" href="#OnErrorCallback">&nbsp;</a>
7387
+
7388
+ ## OnErrorCallback : <code>function</code>
7389
+ Callback for onError method.
7390
+
7391
+ **Kind**: global typedef
7392
+
7393
+ | Param | Type |
7394
+ | --- | --- |
7395
+ | data | [<code>OnErrorEventData</code>](#OnErrorEventData) |
7396
+
7397
+
6409
7398
  # Click To Pay
6410
7399
 
6411
7400
  ## Overview
@@ -6715,7 +7704,7 @@ Interface of data used for the Mastercard Checkout. For further information refe
6715
7704
  | [customer.first_name] | <code>string</code> | Customer first name. |
6716
7705
  | [customer.last_name] | <code>string</code> | Customer last name. |
6717
7706
  | [customer.phone] | <code>object</code> | Object where the customer phone is stored. |
6718
- | [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). // TODO: Confirm if it can be removed! |
7707
+ | [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
6719
7708
  | [customer.phone.phone] | <code>string</code> | Customer phone number. |
6720
7709
  | [unaccepted_card_type] | <code>string</code> | Used to block a specific card type. Options are 'CREDIT', 'DEBIT'. |
6721
7710