@paydock/client-sdk 1.120.1-beta → 1.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +173 -32
- package/bundles/index.cjs +635 -354
- package/bundles/index.cjs.d.ts +89 -31
- package/bundles/index.mjs +635 -354
- package/bundles/index.mjs.d.ts +89 -31
- 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 +26 -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.d.ts +2 -1
- package/bundles/types/checkout/layout-widgets/payment-methods.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/param.d.ts +7 -0
- package/bundles/types/components/param.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/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/index.d.ts +5 -0
- package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts +2 -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/interfaces/apple-pay-wallet-meta.interface.d.ts +1 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -1
- 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 +635 -354
- package/bundles/widget.umd.js.d.ts +89 -31
- package/bundles/widget.umd.js.min.d.ts +89 -31
- 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 +8 -1
- 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
|
|
|
@@ -6710,7 +6844,10 @@ A full description of the meta parameters for [PaypalWalletButtonExpress](#Paypa
|
|
|
6710
6844
|
|
|
6711
6845
|
<dl>
|
|
6712
6846
|
<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
|
|
6847
|
+
<dd><p>Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process.
|
|
6848
|
+
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>.
|
|
6849
|
+
Apple will determinate if the device has an ApplePay wallet available and at least one active payment.
|
|
6850
|
+
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
6851
|
</dd>
|
|
6715
6852
|
<dt><a href="#PaypalWalletMeta">PaypalWalletMeta</a> : <code>object</code></dt>
|
|
6716
6853
|
<dd><p>Interface for configuration metadata specific to PayPal integration in the wallet checkout and payment process.
|
|
@@ -6743,6 +6880,9 @@ For in-depth information, please refer to the <a href="https://developer.paypal.
|
|
|
6743
6880
|
|
|
6744
6881
|
## ApplePayWalletMeta : <code>object</code>
|
|
6745
6882
|
Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process.
|
|
6883
|
+
For further information about ApplePay Capabilities refer to [the documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/4440085-applepaycapabilities).
|
|
6884
|
+
Apple will determinate if the device has an ApplePay wallet available and at least one active payment.
|
|
6885
|
+
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
6886
|
|
|
6747
6887
|
**Kind**: global interface
|
|
6748
6888
|
|
|
@@ -6760,6 +6900,7 @@ Interface for configuration metadata specific to ApplePay integration in the wal
|
|
|
6760
6900
|
| [style] | <code>object</code> | Styling configuration for ApplePay buttons displayed during checkout. |
|
|
6761
6901
|
| [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
6902
|
| [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. |
|
|
6903
|
+
| [apple_pay_capabilities] | <code>Array.<('credentials\_available'\|'credentials\_status\_unknown'\|'credentials\_unavailable')></code> | Device capabilities needed for wallet button to be available. |
|
|
6763
6904
|
|
|
6764
6905
|
<a name="PaypalWalletMeta" id="PaypalWalletMeta" href="#PaypalWalletMeta"> </a>
|
|
6765
6906
|
|