@paydock/client-sdk 1.108.2 → 1.110.2

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 +3994 -3157
  3. package/bundles/index.cjs.d.ts +465 -47
  4. package/bundles/index.mjs +3992 -3157
  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 +3994 -3157
  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
@@ -75,7 +75,7 @@ Interface of data used for the Mastercard Checkout. For further information refe
75
75
  | [customer.first_name] | <code>string</code> | Customer first name. |
76
76
  | [customer.last_name] | <code>string</code> | Customer last name. |
77
77
  | [customer.phone] | <code>object</code> | Object where the customer phone is stored. |
78
- | [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). // TODO: Confirm if it can be removed! |
78
+ | [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
79
79
  | [customer.phone.phone] | <code>string</code> | Customer phone number. |
80
80
  | [unaccepted_card_type] | <code>string</code> | Used to block a specific card type. Options are 'CREDIT', 'DEBIT'. |
81
81
 
@@ -60,6 +60,7 @@
60
60
  <li><a href="#wallet-buttons-simple-example">Simple example</a></li>
61
61
  <li><a href="#wallet-buttons-advanced-example">Advanced example</a></li>
62
62
  <li><a href="#classes-3">Classes</a></li>
63
+ <li><a href="#express-wallet-buttons">Express Wallet Buttons</a></li>
63
64
  </ul>
64
65
  </li>
65
66
  <li>
@@ -0,0 +1,201 @@
1
+ ## Express Wallet Buttons
2
+
3
+ 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.
4
+
5
+ The general flow to use the widgets is:
6
+ 1. Configure your gateway and connect it using Paydock API or Dashboard.
7
+ 2. Create a container in your site
8
+ ```html
9
+ <div id="widget"></div>
10
+ ```
11
+ 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:
12
+ ```js
13
+ new paydock.{Provider}WalletButtonExpress(
14
+ "#widget",
15
+ accessTokenOrPublicKey,
16
+ gatewayId,
17
+ gatewaySpecificMeta,
18
+ );
19
+ ```
20
+ 4. (optional) If the screen where the button is rendered allows for cart/amount changes, call `setMeta` method to update the meta information.
21
+ 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.
22
+ 6. Handle the `onPaymentSuccessful`, `onPaymentError` and `onPaymentInReview` (if fraud is applicable) for payment results.
23
+
24
+ ### Supported Providers
25
+ 1. [Apple Pay](#apple-pay-wallet-button-express)
26
+ 2. [Paypal](#paypal-wallet-button-express)
27
+
28
+ ### Apple Pay Wallet Button Express
29
+
30
+ 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.
31
+
32
+ ```html
33
+ <!DOCTYPE html>
34
+ <html lang="en">
35
+ <head>
36
+ <meta charset="UTF-8">
37
+ <title>Title</title>
38
+ </head>
39
+ <body>
40
+ <h2>Payment using PayDock ApplePayWalletButtonExpress!</h2>
41
+ <div id="widget"></div>
42
+ </body>
43
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
44
+ <script>
45
+ let button = new paydock.ApplePayWalletButtonExpress(
46
+ "#widget",
47
+ accessTokenOrPublicKey,
48
+ gatewayId,
49
+ {
50
+ amount_label: 'TOTAL',
51
+ country: 'AU',
52
+ currency: 'AUD',
53
+ amount: 15.5,
54
+ // merchant_capabilities: ['supports3DS', 'supportsEMV', 'supportsCredit', 'supportsDebit'],
55
+ // supported_networks: ['visa', 'masterCard', 'amex', 'chinaUnionPay', 'discover', 'interac', 'jcb', 'privateLabel'],
56
+ // required_billing_contact_fields: ['email', 'name', 'phone', 'postalAddress'], // phone and email do not work according to relevant testing
57
+ // required_shipping_contact_fields: ['email', 'phone'], // Workaround to pull phone and email from shipping contact instead - does not require additional shipping address information
58
+ // supported_countries: ["AU"],
59
+ // style: {
60
+ // button_type: "buy",
61
+ // button_style: "black",
62
+ // },
63
+ }
64
+ );
65
+
66
+ button.setEnv(sandbox);
67
+
68
+ button.onUnavailable(function() {
69
+ console.log("Button not available");
70
+ });
71
+
72
+ button.onError(function(error) {
73
+ console.log("On Error Callback", error);
74
+ });
75
+
76
+ button.onPaymentSuccessful(function(data) {
77
+ console.log("Payment successful");
78
+ console.log(data);
79
+ });
80
+
81
+ button.onPaymentError(function(err) {
82
+ console.log("Payment error");
83
+ console.log(err);
84
+ });
85
+
86
+ button.onPaymentInReview(function(data) {
87
+ console.log("The payment is on fraud review");
88
+ console.log(data);
89
+ });
90
+
91
+ button.onClick(async (data) => {
92
+ console.log("Button clicked", data);
93
+
94
+ const responseData = await fetch('https://your-server-url/initialize-wallet-charge');
95
+ const parsedData = await responseData.json();
96
+ return parsedData.resource.data.token;
97
+ });
98
+
99
+ button.onCheckoutClose(() => {
100
+ console.log("Checkout closed");
101
+ });
102
+
103
+ button.load();
104
+ </script>
105
+ </html>
106
+ ```
107
+
108
+ ### Paypal Wallet Button Express
109
+ 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.
110
+
111
+ ```html
112
+ <!DOCTYPE html>
113
+ <html lang="en">
114
+ <head>
115
+ <meta charset="UTF-8">
116
+ <title>Title</title>
117
+ </head>
118
+ <body>
119
+ <h2>Payment using PayDock PaypalWalletButtonExpress!</h2>
120
+ <div id="widget"></div>
121
+ </body>
122
+ <script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
123
+ <script>
124
+ let button = new paydock.PaypalWalletButtonExpress(
125
+ "#widget",
126
+ accessTokenOrPublicKey,
127
+ gatewayId,
128
+ {
129
+ amount: 15.5,
130
+ currency: 'AUD',
131
+ pay_later: false,
132
+ standalone: false,
133
+ capture: true,
134
+ // style: {
135
+ // layout: 'horizontal', // or 'vertical'
136
+ // color: 'gold', // or 'blue', 'silver', 'black', 'white'
137
+ // shape: 'rect', // or 'pill', 'sharp'
138
+ // borderRadius: 5,
139
+ // height: 40,
140
+ // disableMaxWidth: false,
141
+ // label: 'paypal', // or 'checkout', 'buynow', 'pay', 'installment'
142
+ // tagline: true,
143
+ // messages: {
144
+ // layout: 'text', // or 'flex'
145
+ // logo: {
146
+ // type: 'primary', // or 'alternative', 'inline', 'none'
147
+ // position: 'left', // or 'right', 'top'
148
+ // },
149
+ // text: {
150
+ // color: 'black', // or 'white', 'monochrome', 'grayscale'
151
+ // size: 10, // or 11, 12, 13, 14, 15, 16
152
+ // align: 'left', // or 'center', 'right'
153
+ // },
154
+ // color: 'blue', // or 'black', 'white', 'white-no-border', 'gray', 'monochrome', 'grayscale'
155
+ // ratio: '1x1', // or '1x4', '8x1', '20x1'
156
+ // },
157
+ // }
158
+ }
159
+ );
160
+
161
+ button.setEnv('sandbox');
162
+
163
+ button.onUnavailable(function() {
164
+ console.log("Button not available");
165
+ });
166
+
167
+ button.onError(function(error) {
168
+ console.log("On Error Callback", error);
169
+ });
170
+
171
+ button.onPaymentSuccessful(function(data) {
172
+ console.log("Payment successful");
173
+ console.log(data);
174
+ });
175
+
176
+ button.onPaymentError(function(err) {
177
+ console.log("Payment error");
178
+ console.log(err);
179
+ });
180
+
181
+ button.onPaymentInReview(function(data) {
182
+ console.log("The payment is on fraud review");
183
+ console.log(data);
184
+ });
185
+
186
+ button.onClick(async (data) => {
187
+ console.log("Button clicked", data);
188
+
189
+ const responseData = await fetch('https://your-server-url/initialize-wallet-charge');
190
+ const parsedData = await responseData.json();
191
+ return parsedData.resource.data.token;
192
+ });
193
+
194
+ button.onCheckoutClose(() => {
195
+ console.log("Checkout closed");
196
+ });
197
+
198
+ button.load();
199
+ </script>
200
+ </html>
201
+ ```