@paydock/client-sdk 1.120.1 → 1.122.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.
- package/README.md +456 -33
- package/bundles/index.cjs +2686 -431
- package/bundles/index.cjs.d.ts +438 -37
- package/bundles/index.mjs +2686 -431
- package/bundles/index.mjs.d.ts +438 -37
- package/bundles/types/api/api-base.d.ts +6 -6
- package/bundles/types/api/api-base.d.ts.map +1 -1
- package/bundles/types/api/api-checkout-internal.d.ts +2 -2
- package/bundles/types/api/api-checkout-internal.d.ts.map +1 -1
- package/bundles/types/api/api.d.ts +9 -9
- package/bundles/types/api/api.d.ts.map +1 -1
- package/bundles/types/checkout/checkout.d.ts +28 -7
- package/bundles/types/checkout/checkout.d.ts.map +1 -1
- package/bundles/types/checkout/helpers/instruction-handler.d.ts +6 -4
- package/bundles/types/checkout/helpers/instruction-handler.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.afterpay_checkout_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.apple_pay_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.canvas_3ds.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.card_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.disable_payment_method_event.emit.d.ts +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.disable_payment_method_event.emit.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.google_pay_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.merchant_event.emit.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.payment_methods.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.paypal_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.zip_checkout_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/additionals.d.ts +1 -1
- package/bundles/types/checkout/layout-widgets/additionals.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/payment-methods.d.ts +2 -1
- package/bundles/types/checkout/layout-widgets/payment-methods.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/payment-template.d.ts +1 -1
- package/bundles/types/checkout/layout-widgets/payment-template.d.ts.map +1 -1
- package/bundles/types/components/iframe-event.d.ts +3 -8
- package/bundles/types/components/iframe-event.d.ts.map +1 -1
- package/bundles/types/components/link.d.ts +1 -1
- package/bundles/types/components/link.d.ts.map +1 -1
- package/bundles/types/components/param.d.ts +7 -0
- package/bundles/types/components/param.d.ts.map +1 -1
- package/bundles/types/components/wallet-background.d.ts.map +1 -1
- package/bundles/types/helper/event-error.d.ts +55 -0
- package/bundles/types/helper/event-error.d.ts.map +1 -0
- package/bundles/types/helper/process-event-error.d.ts +9 -0
- package/bundles/types/helper/process-event-error.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/index.d.ts +6 -1
- package/bundles/types/wallet-buttons/index.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/afterpay.wallet-service.d.ts +2 -0
- package/bundles/types/wallet-buttons/wallet-services/afterpay.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/apple.wallet-service.d.ts +2 -2
- package/bundles/types/wallet-buttons/wallet-services/apple.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/flypay-v2.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/paypal.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts +2 -0
- package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts +70 -13
- package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts +3 -1
- package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/index.d.ts +114 -1
- package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts +30 -0
- package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-data.interface.d.ts +21 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-response.interface.d.ts +9 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-response.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-option-change-event-data.interface.d.ts +13 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-option-change-event-data.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-option-change-event-response.interface.d.ts +9 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-option-change-event-response.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts +9 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-button-style.constant.d.ts +1 -3
- package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-button-style.constant.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-events.constant.d.ts +5 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/constants/apple-pay-events.constant.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +8 -3
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-contact-editing-mode.type.d.ts +5 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-contact-editing-mode.type.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-data.d.ts +21 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-data.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-method.type.d.ts +21 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-method.type.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-sdk.interface.d.ts +164 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-sdk.interface.d.ts.map +1 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +1 -1
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts +9 -3
- package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/types/shipping-event-to-response.type.d.ts +6 -0
- package/bundles/types/wallet-buttons-express/types/shipping-event-to-response.type.d.ts.map +1 -0
- package/bundles/types/widget/configuration.d.ts.map +1 -1
- package/bundles/types/widget/html-multi-widget.d.ts.map +1 -1
- package/bundles/types/widget/multi-widget.d.ts +11 -3
- package/bundles/types/widget/multi-widget.d.ts.map +1 -1
- package/bundles/widget.umd.js +2688 -431
- package/bundles/widget.umd.js.d.ts +438 -37
- package/bundles/widget.umd.js.min.d.ts +438 -37
- package/bundles/widget.umd.min.js +1 -1
- package/docs/api-widget.md +38 -0
- package/docs/api-wrapper.md +3 -36
- package/docs/wallet-buttons-examples.md +4 -2
- package/docs/wallet-buttons-express.md +291 -2
- package/docs/wallet-buttons.md +3 -1
- package/docs/widget-examples.md +120 -28
- package/package.json +2 -2
- package/slate.md +124 -30
- package/bundles/types/helper/custom-error.d.ts +0 -8
- package/bundles/types/helper/custom-error.d.ts.map +0 -1
- package/bundles/types/wallet-buttons/helpers/apple-pay.helper.d.ts +0 -3
- package/bundles/types/wallet-buttons/helpers/apple-pay.helper.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -99,6 +99,7 @@ format that can be used in RequireJS, Webpack, etc.
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
## Widget
|
|
102
|
+
|
|
102
103
|
You can find description of all methods and parameters [here](https://www.npmjs.com/package/@paydock/client-sdk#widget-simple-example)
|
|
103
104
|
|
|
104
105
|
A payment form where it is possible to enter card data/bank accounts and then receive a one-time
|
|
@@ -115,8 +116,8 @@ It is possible in real-time to monitor the actions of user with widget and get i
|
|
|
115
116
|
|
|
116
117
|
You must create a container for the widget. Inside this tag, the widget will be initialized
|
|
117
118
|
|
|
118
|
-
|
|
119
119
|
### Initialization
|
|
120
|
+
|
|
120
121
|
```javascript
|
|
121
122
|
var widget = new paydock.HtmlWidget('#widget', 'publicKey');
|
|
122
123
|
widget.load();
|
|
@@ -133,7 +134,6 @@ widget.load();
|
|
|
133
134
|
|
|
134
135
|
Then write only need 2 lines of code in js to initialize widget
|
|
135
136
|
|
|
136
|
-
|
|
137
137
|
### Full example
|
|
138
138
|
|
|
139
139
|
```html
|
|
@@ -159,19 +159,18 @@ Then write only need 2 lines of code in js to initialize widget
|
|
|
159
159
|
</html>
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
|
|
163
162
|
## Widget advanced example
|
|
164
163
|
|
|
165
164
|
### Customization
|
|
166
165
|
|
|
167
166
|
```javascript
|
|
168
167
|
widget.setStyles({
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
background_color: 'rgb(0, 0, 0)',
|
|
169
|
+
border_color: 'yellow',
|
|
170
|
+
text_color: '#FFFFAA',
|
|
171
|
+
button_color: 'rgba(255, 255, 255, 0.9)',
|
|
172
|
+
font_size: '20px'
|
|
173
|
+
});
|
|
175
174
|
```
|
|
176
175
|
|
|
177
176
|
This example shows how you can customize to your needs and design
|
|
@@ -180,9 +179,9 @@ This example shows how you can customize to your needs and design
|
|
|
180
179
|
|
|
181
180
|
```html
|
|
182
181
|
<div id="widget"
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
widget-style="text-color: #FFFFAA; border-color: #yellow"
|
|
183
|
+
title="Payment form"
|
|
184
|
+
finish-text="Payment resource was successfully accepted"></div>
|
|
186
185
|
```
|
|
187
186
|
|
|
188
187
|
This example shows how you can set style and texts from html
|
|
@@ -199,19 +198,112 @@ widget.setSupportedCardIcons(['mastercard', 'visa']); // add icons of supported
|
|
|
199
198
|
|
|
200
199
|
This example shows how you can use a lot of other methods to settings your form
|
|
201
200
|
|
|
202
|
-
|
|
203
201
|
### Error handling
|
|
204
202
|
|
|
203
|
+
## Overview
|
|
204
|
+
|
|
205
|
+
Error events are emitted when an error occurs during widget operations. These events provide detailed information about the error, including its category, cause, and contextual details.
|
|
206
|
+
|
|
207
|
+
## Error Event Structure
|
|
208
|
+
|
|
209
|
+
### Base Properties
|
|
210
|
+
|
|
211
|
+
| Property | Type | Description |
|
|
212
|
+
|----------|------|-------------|
|
|
213
|
+
| `event` | `string` | Always set to `"error"` |
|
|
214
|
+
| `purpose` | `string` | Indicates the purpose of the action that triggered the error event (e.g., `"payment_source"`) |
|
|
215
|
+
| `message_source` | `string` | Source of the message (e.g., `"widget.paydock"`) |
|
|
216
|
+
| `ref_id` | `string` | Reference ID for the operation |
|
|
217
|
+
| `widget_id` | `string` | Unique identifier of the widget instance |
|
|
218
|
+
| `error` | `object` | Error object containing error information |
|
|
219
|
+
|
|
220
|
+
### Error Object Properties
|
|
221
|
+
|
|
222
|
+
The `error` object contains detailed information about the error:
|
|
223
|
+
|
|
224
|
+
| Property | Type | Description |
|
|
225
|
+
|----------|------|-------------|
|
|
226
|
+
| `category` | `string` | High-level error classification |
|
|
227
|
+
| `cause` | `string` | Specific error cause |
|
|
228
|
+
| `retryable` | `boolean` | Indicates if the operation can be retried |
|
|
229
|
+
| `details` | `object` | Additional error context |
|
|
230
|
+
|
|
231
|
+
## Error Categories
|
|
232
|
+
|
|
233
|
+
| Category | Description |
|
|
234
|
+
|----------|-------------|
|
|
235
|
+
| `configuration` | Configuration-related errors |
|
|
236
|
+
| `identity_access_management` | Authentication and authorization errors |
|
|
237
|
+
| `internal` | Internal system errors |
|
|
238
|
+
| `process` | Process and operation errors |
|
|
239
|
+
| `resource` | Resource-related errors |
|
|
240
|
+
| `validation` | Input validation errors |
|
|
241
|
+
|
|
242
|
+
## Error Causes
|
|
243
|
+
|
|
244
|
+
| Cause | Category | Description |
|
|
245
|
+
|-------|----------|-------------|
|
|
246
|
+
| `aborted` | `process` | Operation was aborted |
|
|
247
|
+
| `access_forbidden` | `identity` | Access to resource is forbidden |
|
|
248
|
+
| `already_exists` | `validation` | Resource already exists |
|
|
249
|
+
| `canceled` | `process` | Operation was canceled |
|
|
250
|
+
| `invalid_configuration` | `configuration` | Invalid widget configuration |
|
|
251
|
+
| `invalid_input` | `validation` | Invalid input provided |
|
|
252
|
+
| `not_found` | `resource` | Requested resource not found |
|
|
253
|
+
| `not_implemented` | `process` | Requested feature not implemented |
|
|
254
|
+
| `rate_limited` | `process` | Too many requests |
|
|
255
|
+
| `server_busy` | `process` | Server is too busy to handle request |
|
|
256
|
+
| `service_unreachable` | `process` | Unable to reach required service |
|
|
257
|
+
| `unauthorized` | `identity` | Authentication required |
|
|
258
|
+
| `unknown_error` | `internal` | Unexpected error occurred |
|
|
259
|
+
| `unprocessable_entity` | `validation` | Valid input but cannot be processed |
|
|
260
|
+
|
|
261
|
+
## Error Details Object
|
|
262
|
+
|
|
263
|
+
| Property | Type | Description |
|
|
264
|
+
|----------|------|-------------|
|
|
265
|
+
| `cause` | `string` | Matches the top-level error cause |
|
|
266
|
+
| `contextId` | `string` | Context identifier (usually matches widget_id) |
|
|
267
|
+
| `message` | `string` | Human-readable error message |
|
|
268
|
+
| `timestamp` | `string` | ISO 8601 timestamp of when the error occurred |
|
|
269
|
+
|
|
270
|
+
## Example
|
|
271
|
+
|
|
205
272
|
```javascript
|
|
273
|
+
widget.hideUiErrors(); // hide default UI errors and handle errors by listening to error events with widget.on('error')
|
|
274
|
+
|
|
206
275
|
widget.on('error', (error) => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
276
|
+
console.log(error);
|
|
277
|
+
// {
|
|
278
|
+
// "event": "error",
|
|
279
|
+
// "purpose": "payment_source",
|
|
280
|
+
// "message_source": "widget.paydock",
|
|
281
|
+
// "ref_id": "",
|
|
282
|
+
// "widget_id": "d4744f30-dcf5-168e-7f78-c8273a3401d4",
|
|
283
|
+
// "error": {
|
|
284
|
+
// "category": "process",
|
|
285
|
+
// "cause": "service_unreachable",
|
|
286
|
+
// "details": {
|
|
287
|
+
// "cause": "service_unreachable",
|
|
288
|
+
// "contextId": "d4744f30-dcf5-168e-7f78-c8273a3401d4",
|
|
289
|
+
// "message": "The service is not availabe",
|
|
290
|
+
// "timestamp": "2025-02-13T09:30:21.157Z"
|
|
291
|
+
// },
|
|
292
|
+
// "retryable": false
|
|
293
|
+
// }
|
|
294
|
+
// }
|
|
212
295
|
});
|
|
213
296
|
```
|
|
214
297
|
|
|
298
|
+
## Handling Errors (Tips)
|
|
299
|
+
|
|
300
|
+
When handling errors, consider:
|
|
301
|
+
|
|
302
|
+
1. Check the `retryable` flag to determine if the operation can be retried
|
|
303
|
+
2. Use the `category` for high-level error handling logic
|
|
304
|
+
3. Use the `cause` for specific error handling cases
|
|
305
|
+
4. The `contextId` can be used for error tracking and debugging
|
|
306
|
+
5. The `timestamp` helps with error logging and debugging
|
|
215
307
|
|
|
216
308
|
### Full example
|
|
217
309
|
|
|
@@ -219,9 +311,9 @@ widget.on('error', (error) => {
|
|
|
219
311
|
<!DOCTYPE html>
|
|
220
312
|
<html lang="en">
|
|
221
313
|
<head>
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
314
|
+
<meta charset="UTF-8">
|
|
315
|
+
<title>Title</title>
|
|
316
|
+
<style>iframe {border: 0;width: 100%;height: 400px;}</style>
|
|
225
317
|
</head>
|
|
226
318
|
<body>
|
|
227
319
|
<form id="paymentForm">
|
|
@@ -260,18 +352,18 @@ widget.on('error', (error) => {
|
|
|
260
352
|
|
|
261
353
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.js" ></script>
|
|
262
354
|
<script>
|
|
263
|
-
|
|
355
|
+
var widget = new paydock.HtmlWidget('#widget', 'publicKey', 'gatewayId');
|
|
264
356
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
357
|
+
widget.setSupportedCardIcons(['mastercard', 'visa']);
|
|
358
|
+
widget.setFormFields(['phone', 'email']);
|
|
359
|
+
widget.setRefId('custom-ref-id');
|
|
268
360
|
widget.onFinishInsert('input[name="payment_source_token"]', 'payment_source');
|
|
269
361
|
|
|
270
|
-
widget.on('error', (error) => {
|
|
271
|
-
document.getElementById('error-message').textContent = error.
|
|
362
|
+
widget.on('error', ({ error }) => {
|
|
363
|
+
document.getElementById('error-message').textContent = error.details.message;
|
|
272
364
|
document.getElementById('error').style.display = 'block';
|
|
273
365
|
});
|
|
274
|
-
|
|
366
|
+
widget.load();
|
|
275
367
|
</script>
|
|
276
368
|
|
|
277
369
|
</body>
|
|
@@ -706,6 +798,7 @@ Class Widget include method for working on html and include extended by HtmlMult
|
|
|
706
798
|
* [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
|
|
707
799
|
* [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
708
800
|
* [.setSupportedCardIcons(elements, validateCardNumberInput)](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
801
|
+
* [.hideUiErrors()](#user-content-w_MultiWidget+hideUiErrors)
|
|
709
802
|
* [.setEnv(env, [alias])](#user-content-w_MultiWidget+setEnv)
|
|
710
803
|
* [.loadIFrameUrl()](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
711
804
|
* [.setLanguage(code)](#user-content-w_MultiWidget+setLanguage)
|
|
@@ -1337,6 +1430,18 @@ Current method can set icons of supported card types
|
|
|
1337
1430
|
```javascript
|
|
1338
1431
|
widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
|
|
1339
1432
|
```
|
|
1433
|
+
<a name="w_MultiWidget+hideUiErrors" id="w_MultiWidget+hideUiErrors" href="#user-content-w_MultiWidget+hideUiErrors"> </a>
|
|
1434
|
+
|
|
1435
|
+
### htmlWidget.hideUiErrors()
|
|
1436
|
+
Current method can hide prevent the widget from showing the error messages
|
|
1437
|
+
|
|
1438
|
+
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
1439
|
+
**Overrides**: [<code>hideUiErrors</code>](#user-content-w_MultiWidget+hideUiErrors)
|
|
1440
|
+
**Example**
|
|
1441
|
+
|
|
1442
|
+
```javascript
|
|
1443
|
+
widget.hideUiErrors('id');
|
|
1444
|
+
```
|
|
1340
1445
|
<a name="w_MultiWidget+setEnv" id="w_MultiWidget+setEnv" href="#user-content-w_MultiWidget+setEnv"> </a>
|
|
1341
1446
|
|
|
1342
1447
|
### htmlWidget.setEnv(env, [alias])
|
|
@@ -1431,6 +1536,7 @@ Class HtmlMultiWidget include method for working with html
|
|
|
1431
1536
|
* [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
|
|
1432
1537
|
* [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
1433
1538
|
* [.setSupportedCardIcons(elements, validateCardNumberInput)](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
1539
|
+
* [.hideUiErrors()](#user-content-w_MultiWidget+hideUiErrors)
|
|
1434
1540
|
* [.setEnv(env, [alias])](#user-content-w_MultiWidget+setEnv)
|
|
1435
1541
|
* [.loadIFrameUrl()](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
1436
1542
|
* [.setLanguage(code)](#user-content-w_MultiWidget+setLanguage)
|
|
@@ -1963,6 +2069,18 @@ Current method can set icons of supported card types
|
|
|
1963
2069
|
```javascript
|
|
1964
2070
|
widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
|
|
1965
2071
|
```
|
|
2072
|
+
<a name="w_MultiWidget+hideUiErrors" id="w_MultiWidget+hideUiErrors" href="#user-content-w_MultiWidget+hideUiErrors"> </a>
|
|
2073
|
+
|
|
2074
|
+
### htmlMultiWidget.hideUiErrors()
|
|
2075
|
+
Current method can hide prevent the widget from showing the error messages
|
|
2076
|
+
|
|
2077
|
+
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
2078
|
+
**Overrides**: [<code>hideUiErrors</code>](#user-content-w_MultiWidget+hideUiErrors)
|
|
2079
|
+
**Example**
|
|
2080
|
+
|
|
2081
|
+
```javascript
|
|
2082
|
+
widget.hideUiErrors('id');
|
|
2083
|
+
```
|
|
1966
2084
|
<a name="w_MultiWidget+setEnv" id="w_MultiWidget+setEnv" href="#user-content-w_MultiWidget+setEnv"> </a>
|
|
1967
2085
|
|
|
1968
2086
|
### htmlMultiWidget.setEnv(env, [alias])
|
|
@@ -2216,6 +2334,7 @@ Class MultiWidget include method for for creating iframe url
|
|
|
2216
2334
|
* [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
|
|
2217
2335
|
* [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
2218
2336
|
* [.setSupportedCardIcons(elements, validateCardNumberInput)](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
2337
|
+
* [.hideUiErrors()](#user-content-w_MultiWidget+hideUiErrors)
|
|
2219
2338
|
* [.setEnv(env, [alias])](#user-content-w_MultiWidget+setEnv)
|
|
2220
2339
|
* [.loadIFrameUrl()](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
2221
2340
|
* [.setLanguage(code)](#user-content-w_MultiWidget+setLanguage)
|
|
@@ -2503,6 +2622,17 @@ Current method can set icons of supported card types
|
|
|
2503
2622
|
```javascript
|
|
2504
2623
|
widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
|
|
2505
2624
|
```
|
|
2625
|
+
<a name="w_MultiWidget+hideUiErrors" id="w_MultiWidget+hideUiErrors" href="#user-content-w_MultiWidget+hideUiErrors"> </a>
|
|
2626
|
+
|
|
2627
|
+
### multiWidget.hideUiErrors()
|
|
2628
|
+
Current method can hide prevent the widget from showing the error messages
|
|
2629
|
+
|
|
2630
|
+
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2631
|
+
**Example**
|
|
2632
|
+
|
|
2633
|
+
```javascript
|
|
2634
|
+
widget.hideUiErrors('id');
|
|
2635
|
+
```
|
|
2506
2636
|
<a name="w_MultiWidget+setEnv" id="w_MultiWidget+setEnv" href="#user-content-w_MultiWidget+setEnv"> </a>
|
|
2507
2637
|
|
|
2508
2638
|
### multiWidget.setEnv(env, [alias])
|
|
@@ -5434,7 +5564,7 @@ button.onUpdate((data) => {
|
|
|
5434
5564
|
After the payment is completed, the onPaymentSuccessful(data) will be called if the payment was successful. If the payment was not successful, the function onPaymentError(data) will be called. If fraud check is active for the gateway, a fraud body was sent in the wallet charge initialize call and the fraud service left the charge in review, then the onPaymentInReview(data) will be called.
|
|
5435
5565
|
All three callbacks return relevant data according to each one of the scenarios.
|
|
5436
5566
|
|
|
5437
|
-
Note that these callbacks will not
|
|
5567
|
+
>*Note that these callbacks will not be triggered for the Afterpay wallet when Redirect mode is used, that is when the charge is initialized with the success_url and error_url parameters, since the payment completion is done through the Redirect method, and therefore this SDK will not be loaded once the payment is completed at checkout.*
|
|
5438
5568
|
|
|
5439
5569
|
```javascript
|
|
5440
5570
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
@@ -5636,7 +5766,7 @@ _(Required `meta` fields: - . Optional `meta` fields: -)_
|
|
|
5636
5766
|
|
|
5637
5767
|
This example shows how to use these functions for **ApplePay via MPGS** and **GooglePay via MPGS**:
|
|
5638
5768
|
|
|
5639
|
-
_(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `raw_data_initialization`, `request_shipping`, `style.button_type`)_
|
|
5769
|
+
_(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `raw_data_initialization`, `request_shipping`, `style.button_type`, `style.button_style`)_
|
|
5640
5770
|
### ApplePay and GooglePay via MPGS Full example
|
|
5641
5771
|
|
|
5642
5772
|
```html
|
|
@@ -5668,6 +5798,7 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
5668
5798
|
},
|
|
5669
5799
|
apple: {
|
|
5670
5800
|
button_type: 'buy',
|
|
5801
|
+
button_style: 'black',
|
|
5671
5802
|
},
|
|
5672
5803
|
},
|
|
5673
5804
|
shipping_options: [
|
|
@@ -5784,6 +5915,7 @@ Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpeci
|
|
|
5784
5915
|
},
|
|
5785
5916
|
apple: {
|
|
5786
5917
|
button_type: 'buy',
|
|
5918
|
+
button_style: 'black',
|
|
5787
5919
|
},
|
|
5788
5920
|
},
|
|
5789
5921
|
shipping_options: [
|
|
@@ -6007,10 +6139,12 @@ Interface of data used by the wallet checkout and payment proccess.
|
|
|
6007
6139
|
| [merchant_name] | <code>string</code> | Merchant Name used for GooglePay integration via MPGS. Required for [GooglePay]. N/A for other wallets. |
|
|
6008
6140
|
| [raw_data_initialization] | <code>object</code> | Used to provide values to initialize wallet with raw data. Optional for [ApplePay]. N/A for the other wallets. |
|
|
6009
6141
|
| [style] | <code>object</code> | For **Paypal**: used to style the buttons, check possible values in the [style guide](https://developer.paypal.com/docs/business/checkout/reference/style-guide). When `standalone` and `pay_later`, extra options can be provided in `style.messages` with the [messages style options](https://developer.paypal.com/docs/checkout/pay-later/us/integrate/reference/#stylelayout). Also used at **ApplePay**, **GooglePay** and **Afterpay** to select button type. Optional for [PayPal, ApplePay, GooglePay, Afterpay]. N/A for [Stripe, FlyPay, Flypay V2]. |
|
|
6010
|
-
| [style.button_type] | <code>object</code> | Used to select ApplePay button type (e.g: 'buy','donate', etc), check possible values
|
|
6142
|
+
| [style.button_type] | <code>object</code> | Used to select ApplePay button type (e.g: 'buy','donate', etc), check possible values [here](https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css). Also select button type for GooglePay (check GooglePayStyles) and Afterpay (check AfterpayStyles). Optional for [ApplePay, GooglePay, Afterpay]. N/A for other wallets. |
|
|
6143
|
+
| [style.button_style] | <code>object</code> | Used to select ApplePay button style (e.g: 'black', 'white', etc), check possible values [here](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaybuttonstyle). Optional for [ApplePay]. N/A for other wallets. |
|
|
6011
6144
|
| [style.height] | <code>object</code> | Used to select Afterpay button height. Optional for [Afterpay]. N/A for other wallets. |
|
|
6012
6145
|
| [wallets] | <code>array</code> | By default if this is not sent or empty, we will try to show either Apple Pay or Google Pay buttons. This can be limited sending the following array in this field: ['apple','google]. Optional for [Stripe, ApplePay, GooglePay]. N/A for other wallets. |
|
|
6013
6146
|
| [client_id] | <code>string</code> | Client ID to be used in the provider system. Required for [Flypay V2]. N/A for [FlyPay, GooglePay, ApplePay, PayPal, Afterpay]. |
|
|
6147
|
+
| [apple_pay_capabilities] | <code>Array.<('credentials\_available'\|'credentials\_status\_unknown'\|'credentials\_unavailable')></code> | Device capabilities needed for wallet button to be available. For further information about refer to [the documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/4440085-applepaycapabilities). If the recognized value is credentials_status_unknown, the payment most possibly cannot be finished on the web, and the buyer must complete it on a compatible device, like Iphone, via QR scan. Optional parameter for [ApplePay]. N/A for [FlyPay, GooglePay, Flypay V2, PayPal, Afterpay]. |
|
|
6014
6148
|
|
|
6015
6149
|
<a name="IApplePayShippingOption" id="IApplePayShippingOption" href="#IApplePayShippingOption"> </a>
|
|
6016
6150
|
|
|
@@ -6678,6 +6812,9 @@ A full description of the meta parameters for [PaypalWalletButtonExpress](#Paypa
|
|
|
6678
6812
|
<dt><a href="#EVENT">EVENT</a> : <code>object</code></dt>
|
|
6679
6813
|
<dd><p>List of available event's name in the wallet button lifecycle</p>
|
|
6680
6814
|
</dd>
|
|
6815
|
+
<dt><a href="#ContactFieldType">ContactFieldType</a> : <code>object</code></dt>
|
|
6816
|
+
<dd><p>List of available contact fields for ContactFieldType</p>
|
|
6817
|
+
</dd>
|
|
6681
6818
|
</dl>
|
|
6682
6819
|
|
|
6683
6820
|
## Typedefs
|
|
@@ -6698,6 +6835,12 @@ A full description of the meta parameters for [PaypalWalletButtonExpress](#Paypa
|
|
|
6698
6835
|
<dt><a href="#OnCheckoutCloseCallback">OnCheckoutCloseCallback</a> : <code>function</code></dt>
|
|
6699
6836
|
<dd><p>Callback for onCheckoutClose method.</p>
|
|
6700
6837
|
</dd>
|
|
6838
|
+
<dt><a href="#OnShippingAddressChangeCallback">OnShippingAddressChangeCallback</a> ⇒ <code><a href="#OnShippingAddressChangeEventResponse">Promise.<OnShippingAddressChangeEventResponse></a></code></dt>
|
|
6839
|
+
<dd><p>Callback for onShippingAddressChange method.</p>
|
|
6840
|
+
</dd>
|
|
6841
|
+
<dt><a href="#OnShippingOptionsChangeCallback">OnShippingOptionsChangeCallback</a> ⇒ <code><a href="#OnShippingOptionChangeEventResponse">Promise.<OnShippingOptionChangeEventResponse></a></code></dt>
|
|
6842
|
+
<dd><p>Callback for onShippingOptionsChange method.</p>
|
|
6843
|
+
</dd>
|
|
6701
6844
|
<dt><a href="#OnUnavailableCallback">OnUnavailableCallback</a> : <code>function</code></dt>
|
|
6702
6845
|
<dd><p>Callback for onUnavailable method.</p>
|
|
6703
6846
|
</dd>
|
|
@@ -6710,7 +6853,10 @@ A full description of the meta parameters for [PaypalWalletButtonExpress](#Paypa
|
|
|
6710
6853
|
|
|
6711
6854
|
<dl>
|
|
6712
6855
|
<dt><a href="#ApplePayWalletMeta">ApplePayWalletMeta</a> : <code>object</code></dt>
|
|
6713
|
-
<dd><p>Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process
|
|
6856
|
+
<dd><p>Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process.
|
|
6857
|
+
For further information about ApplePay Capabilities refer to <a href="https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/4440085-applepaycapabilities">the documentation</a>.
|
|
6858
|
+
Apple will determinate if the device has an ApplePay wallet available and at least one active payment.
|
|
6859
|
+
If the determinated value is credentials_status_unknown, the payment possbily should might be not able to be finished on the web, and the buyer must complete it on a compatible device, like Iphone or Ipad.</p>
|
|
6714
6860
|
</dd>
|
|
6715
6861
|
<dt><a href="#PaypalWalletMeta">PaypalWalletMeta</a> : <code>object</code></dt>
|
|
6716
6862
|
<dd><p>Interface for configuration metadata specific to PayPal integration in the wallet checkout and payment process.
|
|
@@ -6737,12 +6883,34 @@ For in-depth information, please refer to the <a href="https://developer.paypal.
|
|
|
6737
6883
|
<dt><a href="#OnErrorEventData">OnErrorEventData</a> : <code>object</code></dt>
|
|
6738
6884
|
<dd><p>Interface for OnErrorEventData</p>
|
|
6739
6885
|
</dd>
|
|
6886
|
+
<dt><a href="#OnShippingAddressChangeEventData">OnShippingAddressChangeEventData</a> : <code>object</code></dt>
|
|
6887
|
+
<dd><p>Interface for OnShippingAddressChangeEventData.</p>
|
|
6888
|
+
</dd>
|
|
6889
|
+
<dt><a href="#OnShippingAddressChangeEventResponse">OnShippingAddressChangeEventResponse</a> : <code>object</code></dt>
|
|
6890
|
+
<dd><p>Interface for OnShippingAddressChangeEventResponse.</p>
|
|
6891
|
+
</dd>
|
|
6892
|
+
<dt><a href="#IApplePayShippingOption">IApplePayShippingOption</a> : <code>object</code></dt>
|
|
6893
|
+
<dd><p>Interface for IApplePayShippingOption.
|
|
6894
|
+
Used for adding new shippings options when customer updates the shipping address.</p>
|
|
6895
|
+
</dd>
|
|
6896
|
+
<dt><a href="#OnShippingOptionChangeEventData">OnShippingOptionChangeEventData</a> : <code>object</code></dt>
|
|
6897
|
+
<dd><p>Interface for OnShippingOptionChangeEventData.</p>
|
|
6898
|
+
</dd>
|
|
6899
|
+
<dt><a href="#OnShippingOptionChangeEventResponse">OnShippingOptionChangeEventResponse</a> : <code>object</code></dt>
|
|
6900
|
+
<dd><p>Interface for OnShippingOptionChangeEventResponse.</p>
|
|
6901
|
+
</dd>
|
|
6902
|
+
<dt><a href="#IApplePayError">IApplePayError</a> : <code>object</code></dt>
|
|
6903
|
+
<dd><p>Interface for IApplePayError.</p>
|
|
6904
|
+
</dd>
|
|
6740
6905
|
</dl>
|
|
6741
6906
|
|
|
6742
6907
|
<a name="ApplePayWalletMeta" id="ApplePayWalletMeta" href="#ApplePayWalletMeta"> </a>
|
|
6743
6908
|
|
|
6744
6909
|
## ApplePayWalletMeta : <code>object</code>
|
|
6745
6910
|
Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process.
|
|
6911
|
+
For further information about ApplePay Capabilities refer to [the documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/4440085-applepaycapabilities).
|
|
6912
|
+
Apple will determinate if the device has an ApplePay wallet available and at least one active payment.
|
|
6913
|
+
If the determinated value is credentials_status_unknown, the payment possbily should might be not able to be finished on the web, and the buyer must complete it on a compatible device, like Iphone or Ipad.
|
|
6746
6914
|
|
|
6747
6915
|
**Kind**: global interface
|
|
6748
6916
|
|
|
@@ -6755,11 +6923,15 @@ Interface for configuration metadata specific to ApplePay integration in the wal
|
|
|
6755
6923
|
| [merchant_capabilities] | <code>Array.<('supports3DS'\|'supportsEMV'\|'supportsCredit'\|'supportsDebit')></code> | Array of capabilities that the merchant supports, influencing the transaction processing features available. |
|
|
6756
6924
|
| [supported_networks] | <code>Array.<('visa'\|'masterCard'\|'amex'\|'chinaUnionPay'\|'discover'\|'interac'\|'jcb'\|'privateLabel')></code> | List of payment networks supported by the merchant for ApplePay transactions. |
|
|
6757
6925
|
| [required_billing_contact_fields] | <code>Array.<('email'\|'name'\|'phone'\|'postalAddress')></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. |
|
|
6758
|
-
| [required_shipping_contact_fields] | <code>Array.<('email'\|'phone')></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. |
|
|
6926
|
+
| [required_shipping_contact_fields] | <code>Array.<('email'\|'phone')></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. Required for onShippingAddressChange callback. |
|
|
6759
6927
|
| [supported_countries] | <code>Array.<string></code> | List of countries where ApplePay is supported by the merchant, restricting usage to specified regions. |
|
|
6760
6928
|
| [style] | <code>object</code> | Styling configuration for ApplePay buttons displayed during checkout. |
|
|
6761
6929
|
| [style.button_type] | <code>ApplePayButtonType</code> | Enum type to select the type of ApplePay button (e.g., 'buy', 'donate', etc.), providing user interface customization. |
|
|
6762
6930
|
| [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. |
|
|
6931
|
+
| [shipping_editing_mode] | <code>'available'</code> \| <code>'store\_pickup'</code> | ApplePay - available for allowing editing shipping, store_pickup for not allowing editing shipping. |
|
|
6932
|
+
| [shipping_data] | <code>object</code> | ApplePay - Preloaded data used for populate shipping address information |
|
|
6933
|
+
| [shipping_data.email_address] | <code>string</code> | ApplePay - The shipping address email |
|
|
6934
|
+
| [apple_pay_capabilities] | <code>Array.<('credentials\_available'\|'credentials\_status\_unknown'\|'credentials\_unavailable')></code> | Device capabilities needed for wallet button to be available. |
|
|
6763
6935
|
|
|
6764
6936
|
<a name="PaypalWalletMeta" id="PaypalWalletMeta" href="#PaypalWalletMeta"> </a>
|
|
6765
6937
|
|
|
@@ -6891,6 +7063,115 @@ Interface for OnErrorEventData
|
|
|
6891
7063
|
| [chargeId] | <code>string</code> | chargeId in case it's already set after onClick event |
|
|
6892
7064
|
| [data] | <code>Error</code> | Error object if present |
|
|
6893
7065
|
|
|
7066
|
+
<a name="OnShippingAddressChangeEventData" id="OnShippingAddressChangeEventData" href="#OnShippingAddressChangeEventData"> </a>
|
|
7067
|
+
|
|
7068
|
+
## OnShippingAddressChangeEventData : <code>object</code>
|
|
7069
|
+
Interface for OnShippingAddressChangeEventData.
|
|
7070
|
+
|
|
7071
|
+
**Kind**: global interface
|
|
7072
|
+
|
|
7073
|
+
| Param | Type | Description |
|
|
7074
|
+
| --- | --- | --- |
|
|
7075
|
+
| event | <code>string</code> | Event Name is 'onShippingAddressChange' |
|
|
7076
|
+
| chargeId | <code>string</code> | chargeId set after onClick event |
|
|
7077
|
+
| data.address_city | <code>string</code> | PayPal and ApplePay - Shipping address city |
|
|
7078
|
+
| data.address_state | <code>string</code> | PayPal and ApplePay - Shipping address state |
|
|
7079
|
+
| data.address_postcode | <code>string</code> | PayPal and ApplePay - Shipping address postcode |
|
|
7080
|
+
| data.address_country | <code>string</code> | PayPal and ApplePay - Shipping address country code |
|
|
7081
|
+
| [data.address_line1] | <code>string</code> | ApplePay - Shipping address line 1 |
|
|
7082
|
+
| [data.address_line2] | <code>string</code> | ApplePay - Shipping address line 2 |
|
|
7083
|
+
| [data.contact.phone] | <code>string</code> | ApplePay - Shipping contact phone |
|
|
7084
|
+
| [data.contact.email] | <code>string</code> | ApplePay - Shipping contact email |
|
|
7085
|
+
| [data.contact.first_name] | <code>string</code> | ApplePay - Shipping contact first name |
|
|
7086
|
+
| [data.contact.last_name] | <code>string</code> | ApplePay - Shipping contact last name |
|
|
7087
|
+
|
|
7088
|
+
<a name="OnShippingAddressChangeEventResponse" id="OnShippingAddressChangeEventResponse" href="#OnShippingAddressChangeEventResponse"> </a>
|
|
7089
|
+
|
|
7090
|
+
## OnShippingAddressChangeEventResponse : <code>object</code>
|
|
7091
|
+
Interface for OnShippingAddressChangeEventResponse.
|
|
7092
|
+
|
|
7093
|
+
**Kind**: global interface
|
|
7094
|
+
|
|
7095
|
+
| Param | Type | Description |
|
|
7096
|
+
| --- | --- | --- |
|
|
7097
|
+
| [token] | <code>string</code> | Updated Wallet Token if any |
|
|
7098
|
+
| [label] | <code>string</code> | ApplePay - Required. Label to show to the customer. |
|
|
7099
|
+
| [amount] | <code>string</code> | ApplePay - Required. New amount for shipping option. |
|
|
7100
|
+
| [error] | <code>string</code> | PayPal and ApplePay - Error object in case of error when processing shipping address in if new address unsupported or any other possible error. |
|
|
7101
|
+
| error.code | <code>string</code> | PayPal and ApplePay - Error code, mandatory in case of error. Possible values for Paypal are 'address_error', 'country_error', 'state_error', 'zip_error' or any other string if none applies. For ApplePay values are 'address_error', 'shipping_contact_invalid' and 'billing_contact_invalid'. |
|
|
7102
|
+
| [error.field] | <code>string</code> | ApplePay - Error field in case of specifically showing it. Possible values for Apple Pay are 'phone', 'email', 'name', 'phonetic_name', 'address_lines', 'locality', 'postal_code', 'administrative_area', 'country', 'country_code'. |
|
|
7103
|
+
| [error.message] | <code>string</code> | ApplePay - Custom user facing error message. |
|
|
7104
|
+
|
|
7105
|
+
<a name="IApplePayShippingOption" id="IApplePayShippingOption" href="#IApplePayShippingOption"> </a>
|
|
7106
|
+
|
|
7107
|
+
## IApplePayShippingOption : <code>object</code>
|
|
7108
|
+
Interface for IApplePayShippingOption.
|
|
7109
|
+
Used for adding new shippings options when customer updates the shipping address.
|
|
7110
|
+
|
|
7111
|
+
**Kind**: global interface
|
|
7112
|
+
|
|
7113
|
+
| Param | Type | Description |
|
|
7114
|
+
| --- | --- | --- |
|
|
7115
|
+
| [id] | <code>string</code> | Updated Wallet Token if any |
|
|
7116
|
+
| [label] | <code>string</code> | ApplePay - Required. Label to show to the customer. |
|
|
7117
|
+
| [amount] | <code>string</code> | ApplePay - Required. New amount for shipping option. |
|
|
7118
|
+
| [detail] | <code>string</code> | ApplePay - Optional detail for shipping option. |
|
|
7119
|
+
| [date_components_range] | <code>object</code> | ApplePay - Object that contains the dates for shipping |
|
|
7120
|
+
| [date_components_range.start_date_components] | <code>object</code> | ApplePay - Contains the start date object |
|
|
7121
|
+
| [date_components_range.start_date_components.years] | <code>string</code> | ApplePay - Contains the start date year |
|
|
7122
|
+
| [date_components_range.start_date_components.months] | <code>string</code> | ApplePay - Contains the start date month |
|
|
7123
|
+
| [date_components_range.start_date_components.days] | <code>string</code> | ApplePay - Contains the start date day |
|
|
7124
|
+
| [date_components_range.start_date_components.hours] | <code>string</code> | ApplePay - Contains the start date hour |
|
|
7125
|
+
| [date_components_range.end_date_components] | <code>object</code> | ApplePay - Contains the end date year |
|
|
7126
|
+
| [date_components_range.end_date_components.years] | <code>string</code> | ApplePay - Contains the end date year |
|
|
7127
|
+
| [date_components_range.end_date_components.months] | <code>string</code> | ApplePay - Contains the end date month |
|
|
7128
|
+
| [date_components_range.end_date_components.days] | <code>string</code> | ApplePay - Contains the end date day |
|
|
7129
|
+
| [date_components_range.end_date_components.hours] | <code>string</code> | ApplePay - Contains the end date hour |
|
|
7130
|
+
|
|
7131
|
+
<a name="OnShippingOptionChangeEventData" id="OnShippingOptionChangeEventData" href="#OnShippingOptionChangeEventData"> </a>
|
|
7132
|
+
|
|
7133
|
+
## OnShippingOptionChangeEventData : <code>object</code>
|
|
7134
|
+
Interface for OnShippingOptionChangeEventData.
|
|
7135
|
+
|
|
7136
|
+
**Kind**: global interface
|
|
7137
|
+
|
|
7138
|
+
| Param | Type | Description |
|
|
7139
|
+
| --- | --- | --- |
|
|
7140
|
+
| event | <code>string</code> | Event Name is 'onShippingOptionsChange' |
|
|
7141
|
+
| chargeId | <code>string</code> | chargeId set after onClick event |
|
|
7142
|
+
| [data.shipping_option_id] | <code>string</code> | PayPal and ApplePay - Selected shipping option id |
|
|
7143
|
+
| [data.amount] | <code>string</code> | Paypal and ApplePay - Selected shipping option amount |
|
|
7144
|
+
| [data.label] | <code>string</code> | ApplePay - Selected shipping option label |
|
|
7145
|
+
| [data.detail] | <code>string</code> | ApplePay - Selected shipping option detail |
|
|
7146
|
+
|
|
7147
|
+
<a name="OnShippingOptionChangeEventResponse" id="OnShippingOptionChangeEventResponse" href="#OnShippingOptionChangeEventResponse"> </a>
|
|
7148
|
+
|
|
7149
|
+
## OnShippingOptionChangeEventResponse : <code>object</code>
|
|
7150
|
+
Interface for OnShippingOptionChangeEventResponse.
|
|
7151
|
+
|
|
7152
|
+
**Kind**: global interface
|
|
7153
|
+
|
|
7154
|
+
| Param | Type | Description |
|
|
7155
|
+
| --- | --- | --- |
|
|
7156
|
+
| [token] | <code>string</code> | Updated Wallet Token if any |
|
|
7157
|
+
| [label] | <code>string</code> | ApplePay - Required. Label to show to the customer. |
|
|
7158
|
+
| [amount] | <code>string</code> | ApplePay - Required. New amount for shipping option. |
|
|
7159
|
+
| [error] | <code>string</code> | PayPal - Error object in case of error when processing shipping option selection. |
|
|
7160
|
+
| error.code | <code>string</code> | Possible values for Paypal are 'method_unavailable', 'store_unavailable' or any other string if none applies. |
|
|
7161
|
+
|
|
7162
|
+
<a name="IApplePayError" id="IApplePayError" href="#IApplePayError"> </a>
|
|
7163
|
+
|
|
7164
|
+
## IApplePayError : <code>object</code>
|
|
7165
|
+
Interface for IApplePayError.
|
|
7166
|
+
|
|
7167
|
+
**Kind**: global interface
|
|
7168
|
+
|
|
7169
|
+
| Param | Type | Description |
|
|
7170
|
+
| --- | --- | --- |
|
|
7171
|
+
| code | <code>'shipping\_contact\_invalid'</code> \| <code>'billing\_contact\_invalid'</code> \| <code>'address\_unserviceable'</code> \| <code>'coupon\_code\_invalid'</code> \| <code>'coupon\_code\_expired'</code> \| <code>'unknown'</code> | The error code for this instance. |
|
|
7172
|
+
| contact_field | [<code>ContactFieldType</code>](#ContactFieldType) | The error code for this instance. |
|
|
7173
|
+
| message | <code>string</code> \| <code>undefined</code> | TA localized, user-facing string that describes the error. |
|
|
7174
|
+
|
|
6894
7175
|
<a name="ApplePayWalletButtonExpress" id="ApplePayWalletButtonExpress" href="#ApplePayWalletButtonExpress"> </a>
|
|
6895
7176
|
|
|
6896
7177
|
## ApplePayWalletButtonExpress ⇐ <code>BaseWalletButton</code>
|
|
@@ -6909,6 +7190,8 @@ Class ApplePayWalletButtonExpress to work with Apple Pay Wallet.
|
|
|
6909
7190
|
* [.onPaymentInReview([handler])](#BaseWalletButton+onPaymentInReview)
|
|
6910
7191
|
* [.onPaymentError([handler])](#BaseWalletButton+onPaymentError)
|
|
6911
7192
|
* [.onCheckoutClose(handler)](#BaseWalletButton+onCheckoutClose)
|
|
7193
|
+
* [.onShippingAddressChange([handler])](#BaseWalletButton+onShippingAddressChange)
|
|
7194
|
+
* [.onShippingOptionsChange([handler])](#BaseWalletButton+onShippingOptionsChange)
|
|
6912
7195
|
* [.onUnavailable(handler)](#BaseWalletButton+onUnavailable)
|
|
6913
7196
|
* [.onError(handler)](#BaseWalletButton+onError)
|
|
6914
7197
|
|
|
@@ -7085,6 +7368,52 @@ button.onCheckoutClose(() => {
|
|
|
7085
7368
|
console.log('Wallet checkout closes');
|
|
7086
7369
|
});
|
|
7087
7370
|
```
|
|
7371
|
+
<a name="BaseWalletButton+onShippingAddressChange" id="BaseWalletButton+onShippingAddressChange" href="#BaseWalletButton+onShippingAddressChange"> </a>
|
|
7372
|
+
|
|
7373
|
+
### applePayWalletButtonExpress.onShippingAddressChange([handler])
|
|
7374
|
+
If shipping address data is updated, the function passed as parameter will be called.
|
|
7375
|
+
Use this method to listen for shipping address selection or input from customer when shipping is enabled.
|
|
7376
|
+
The event handler needs to return a new token in case a backend to backend wallet update call was executed.
|
|
7377
|
+
In addition, if any error occured, an error string must be supplied.
|
|
7378
|
+
By default, the event handler will be processed successfuly if neither token nor error is returned.
|
|
7379
|
+
|
|
7380
|
+
**Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
|
|
7381
|
+
**Overrides**: [<code>onShippingAddressChange</code>](#BaseWalletButton+onShippingAddressChange)
|
|
7382
|
+
|
|
7383
|
+
| Param | Type | Description |
|
|
7384
|
+
| --- | --- | --- |
|
|
7385
|
+
| [handler] | [<code>OnShippingAddressChangeCallback</code>](#OnShippingAddressChangeCallback) | Function to be called when the shipping address data is updated. |
|
|
7386
|
+
|
|
7387
|
+
**Example**
|
|
7388
|
+
```js
|
|
7389
|
+
button.onShippingAddressChange((data) => {
|
|
7390
|
+
const responseData = await fetch('https://your-server.com/update-shipping-info');
|
|
7391
|
+
return { error: null, token: responseData.walletToken };
|
|
7392
|
+
});
|
|
7393
|
+
```
|
|
7394
|
+
<a name="BaseWalletButton+onShippingOptionsChange" id="BaseWalletButton+onShippingOptionsChange" href="#BaseWalletButton+onShippingOptionsChange"> </a>
|
|
7395
|
+
|
|
7396
|
+
### applePayWalletButtonExpress.onShippingOptionsChange([handler])
|
|
7397
|
+
If shipping options data is updated, the function passed as parameter will be called.
|
|
7398
|
+
Use this method to listen for shipping option selection from customer when shipping is enabled.
|
|
7399
|
+
The event handler needs to return a new token in case a backend to backend wallet update call was executed.
|
|
7400
|
+
In addition, if any error occured, an error string must be supplied.
|
|
7401
|
+
By default, the event handler will be processed successfuly if neither token nor error is returned.
|
|
7402
|
+
|
|
7403
|
+
**Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
|
|
7404
|
+
**Overrides**: [<code>onShippingOptionsChange</code>](#BaseWalletButton+onShippingOptionsChange)
|
|
7405
|
+
|
|
7406
|
+
| Param | Type | Description |
|
|
7407
|
+
| --- | --- | --- |
|
|
7408
|
+
| [handler] | [<code>OnShippingOptionsChangeCallback</code>](#OnShippingOptionsChangeCallback) | Function to be called when the shipping options data is updated. |
|
|
7409
|
+
|
|
7410
|
+
**Example**
|
|
7411
|
+
```js
|
|
7412
|
+
button.onShippingOptionsChange((data) => {
|
|
7413
|
+
const responseData = await fetch('https://your-server.com/update-shipping-info');
|
|
7414
|
+
return { error: null, token: responseData.walletToken };
|
|
7415
|
+
});
|
|
7416
|
+
```
|
|
7088
7417
|
<a name="BaseWalletButton+onUnavailable" id="BaseWalletButton+onUnavailable" href="#BaseWalletButton+onUnavailable"> </a>
|
|
7089
7418
|
|
|
7090
7419
|
### applePayWalletButtonExpress.onUnavailable(handler)
|
|
@@ -7140,6 +7469,8 @@ Class PaypalWalletButtonExpress to work with Paypal Wallet.
|
|
|
7140
7469
|
* [.onPaymentInReview([handler])](#BaseWalletButton+onPaymentInReview)
|
|
7141
7470
|
* [.onPaymentError([handler])](#BaseWalletButton+onPaymentError)
|
|
7142
7471
|
* [.onCheckoutClose(handler)](#BaseWalletButton+onCheckoutClose)
|
|
7472
|
+
* [.onShippingAddressChange([handler])](#BaseWalletButton+onShippingAddressChange)
|
|
7473
|
+
* [.onShippingOptionsChange([handler])](#BaseWalletButton+onShippingOptionsChange)
|
|
7143
7474
|
* [.onUnavailable(handler)](#BaseWalletButton+onUnavailable)
|
|
7144
7475
|
* [.onError(handler)](#BaseWalletButton+onError)
|
|
7145
7476
|
|
|
@@ -7316,6 +7647,52 @@ button.onCheckoutClose(() => {
|
|
|
7316
7647
|
console.log('Wallet checkout closes');
|
|
7317
7648
|
});
|
|
7318
7649
|
```
|
|
7650
|
+
<a name="BaseWalletButton+onShippingAddressChange" id="BaseWalletButton+onShippingAddressChange" href="#BaseWalletButton+onShippingAddressChange"> </a>
|
|
7651
|
+
|
|
7652
|
+
### paypalWalletButtonExpress.onShippingAddressChange([handler])
|
|
7653
|
+
If shipping address data is updated, the function passed as parameter will be called.
|
|
7654
|
+
Use this method to listen for shipping address selection or input from customer when shipping is enabled.
|
|
7655
|
+
The event handler needs to return a new token in case a backend to backend wallet update call was executed.
|
|
7656
|
+
In addition, if any error occured, an error string must be supplied.
|
|
7657
|
+
By default, the event handler will be processed successfuly if neither token nor error is returned.
|
|
7658
|
+
|
|
7659
|
+
**Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
|
|
7660
|
+
**Overrides**: [<code>onShippingAddressChange</code>](#BaseWalletButton+onShippingAddressChange)
|
|
7661
|
+
|
|
7662
|
+
| Param | Type | Description |
|
|
7663
|
+
| --- | --- | --- |
|
|
7664
|
+
| [handler] | [<code>OnShippingAddressChangeCallback</code>](#OnShippingAddressChangeCallback) | Function to be called when the shipping address data is updated. |
|
|
7665
|
+
|
|
7666
|
+
**Example**
|
|
7667
|
+
```js
|
|
7668
|
+
button.onShippingAddressChange((data) => {
|
|
7669
|
+
const responseData = await fetch('https://your-server.com/update-shipping-info');
|
|
7670
|
+
return { error: null, token: responseData.walletToken };
|
|
7671
|
+
});
|
|
7672
|
+
```
|
|
7673
|
+
<a name="BaseWalletButton+onShippingOptionsChange" id="BaseWalletButton+onShippingOptionsChange" href="#BaseWalletButton+onShippingOptionsChange"> </a>
|
|
7674
|
+
|
|
7675
|
+
### paypalWalletButtonExpress.onShippingOptionsChange([handler])
|
|
7676
|
+
If shipping options data is updated, the function passed as parameter will be called.
|
|
7677
|
+
Use this method to listen for shipping option selection from customer when shipping is enabled.
|
|
7678
|
+
The event handler needs to return a new token in case a backend to backend wallet update call was executed.
|
|
7679
|
+
In addition, if any error occured, an error string must be supplied.
|
|
7680
|
+
By default, the event handler will be processed successfuly if neither token nor error is returned.
|
|
7681
|
+
|
|
7682
|
+
**Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
|
|
7683
|
+
**Overrides**: [<code>onShippingOptionsChange</code>](#BaseWalletButton+onShippingOptionsChange)
|
|
7684
|
+
|
|
7685
|
+
| Param | Type | Description |
|
|
7686
|
+
| --- | --- | --- |
|
|
7687
|
+
| [handler] | [<code>OnShippingOptionsChangeCallback</code>](#OnShippingOptionsChangeCallback) | Function to be called when the shipping options data is updated. |
|
|
7688
|
+
|
|
7689
|
+
**Example**
|
|
7690
|
+
```js
|
|
7691
|
+
button.onShippingOptionsChange((data) => {
|
|
7692
|
+
const responseData = await fetch('https://your-server.com/update-shipping-info');
|
|
7693
|
+
return { error: null, token: responseData.walletToken };
|
|
7694
|
+
});
|
|
7695
|
+
```
|
|
7319
7696
|
<a name="BaseWalletButton+onUnavailable" id="BaseWalletButton+onUnavailable" href="#BaseWalletButton+onUnavailable"> </a>
|
|
7320
7697
|
|
|
7321
7698
|
### paypalWalletButtonExpress.onUnavailable(handler)
|
|
@@ -7369,6 +7746,28 @@ List of available event's name in the wallet button lifecycle
|
|
|
7369
7746
|
| PAYMENT_IN_REVIEW | <code>string</code> | <code>"paymentInReview"</code> |
|
|
7370
7747
|
| ON_CLICK | <code>string</code> | <code>"onClick"</code> |
|
|
7371
7748
|
| ON_CHECKOUT_CLOSE | <code>string</code> | <code>"onCheckoutClose"</code> |
|
|
7749
|
+
| ON_SHIPPING_ADDRESS_CHANGE | <code>string</code> | <code>"onShippingAddressChange"</code> |
|
|
7750
|
+
| ON_SHIPPING_OPTIONS_CHANGE | <code>string</code> | <code>"onShippingOptionsChange"</code> |
|
|
7751
|
+
|
|
7752
|
+
<a name="ContactFieldType" id="ContactFieldType" href="#ContactFieldType"> </a>
|
|
7753
|
+
|
|
7754
|
+
## ContactFieldType : <code>object</code>
|
|
7755
|
+
List of available contact fields for ContactFieldType
|
|
7756
|
+
|
|
7757
|
+
**Kind**: global constant
|
|
7758
|
+
|
|
7759
|
+
| Param | Type |
|
|
7760
|
+
| --- | --- |
|
|
7761
|
+
| phone | <code>string</code> |
|
|
7762
|
+
| email | <code>string</code> |
|
|
7763
|
+
| name | <code>string</code> |
|
|
7764
|
+
| phonetic_name | <code>string</code> |
|
|
7765
|
+
| address_lines | <code>string</code> |
|
|
7766
|
+
| address_city | <code>string</code> |
|
|
7767
|
+
| address_postcode | <code>string</code> |
|
|
7768
|
+
| address_state | <code>string</code> |
|
|
7769
|
+
| address_country | <code>string</code> |
|
|
7770
|
+
| address_country_code | <code>string</code> |
|
|
7372
7771
|
|
|
7373
7772
|
<a name="OnClickCallback" id="OnClickCallback" href="#OnClickCallback"> </a>
|
|
7374
7773
|
|
|
@@ -7426,6 +7825,30 @@ Callback for onCheckoutClose method.
|
|
|
7426
7825
|
| --- | --- |
|
|
7427
7826
|
| data | [<code>OnCloseEventData</code>](#OnCloseEventData) |
|
|
7428
7827
|
|
|
7828
|
+
<a name="OnShippingAddressChangeCallback" id="OnShippingAddressChangeCallback" href="#OnShippingAddressChangeCallback"> </a>
|
|
7829
|
+
|
|
7830
|
+
## OnShippingAddressChangeCallback ⇒ [<code>Promise.<OnShippingAddressChangeEventResponse></code>](#OnShippingAddressChangeEventResponse)
|
|
7831
|
+
Callback for onShippingAddressChange method.
|
|
7832
|
+
|
|
7833
|
+
**Kind**: global typedef
|
|
7834
|
+
**Returns**: [<code>Promise.<OnShippingAddressChangeEventResponse></code>](#OnShippingAddressChangeEventResponse) - Address update result
|
|
7835
|
+
|
|
7836
|
+
| Param | Type |
|
|
7837
|
+
| --- | --- |
|
|
7838
|
+
| data | [<code>OnShippingAddressChangeEventData</code>](#OnShippingAddressChangeEventData) |
|
|
7839
|
+
|
|
7840
|
+
<a name="OnShippingOptionsChangeCallback" id="OnShippingOptionsChangeCallback" href="#OnShippingOptionsChangeCallback"> </a>
|
|
7841
|
+
|
|
7842
|
+
## OnShippingOptionsChangeCallback ⇒ [<code>Promise.<OnShippingOptionChangeEventResponse></code>](#OnShippingOptionChangeEventResponse)
|
|
7843
|
+
Callback for onShippingOptionsChange method.
|
|
7844
|
+
|
|
7845
|
+
**Kind**: global typedef
|
|
7846
|
+
**Returns**: [<code>Promise.<OnShippingOptionChangeEventResponse></code>](#OnShippingOptionChangeEventResponse) - Address update result
|
|
7847
|
+
|
|
7848
|
+
| Param | Type |
|
|
7849
|
+
| --- | --- |
|
|
7850
|
+
| data | [<code>OnShippingOptionChangeEventData</code>](#OnShippingOptionChangeEventData) |
|
|
7851
|
+
|
|
7429
7852
|
<a name="OnUnavailableCallback" id="OnUnavailableCallback" href="#OnUnavailableCallback"> </a>
|
|
7430
7853
|
|
|
7431
7854
|
## OnUnavailableCallback : <code>function</code>
|