@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/docs/api-widget.md
CHANGED
|
@@ -426,6 +426,7 @@ Class Widget include method for working on html and include extended by HtmlMult
|
|
|
426
426
|
* [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
|
|
427
427
|
* [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
428
428
|
* [.setSupportedCardIcons(elements, validateCardNumberInput)](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
429
|
+
* [.hideUiErrors()](#user-content-w_MultiWidget+hideUiErrors)
|
|
429
430
|
* [.setEnv(env, [alias])](#user-content-w_MultiWidget+setEnv)
|
|
430
431
|
* [.loadIFrameUrl()](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
431
432
|
* [.setLanguage(code)](#user-content-w_MultiWidget+setLanguage)
|
|
@@ -1057,6 +1058,18 @@ Current method can set icons of supported card types
|
|
|
1057
1058
|
```javascript
|
|
1058
1059
|
widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
|
|
1059
1060
|
```
|
|
1061
|
+
<a name="w_MultiWidget+hideUiErrors" id="w_MultiWidget+hideUiErrors" href="#user-content-w_MultiWidget+hideUiErrors"> </a>
|
|
1062
|
+
|
|
1063
|
+
### htmlWidget.hideUiErrors()
|
|
1064
|
+
Current method can hide prevent the widget from showing the error messages
|
|
1065
|
+
|
|
1066
|
+
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
1067
|
+
**Overrides**: [<code>hideUiErrors</code>](#user-content-w_MultiWidget+hideUiErrors)
|
|
1068
|
+
**Example**
|
|
1069
|
+
|
|
1070
|
+
```javascript
|
|
1071
|
+
widget.hideUiErrors('id');
|
|
1072
|
+
```
|
|
1060
1073
|
<a name="w_MultiWidget+setEnv" id="w_MultiWidget+setEnv" href="#user-content-w_MultiWidget+setEnv"> </a>
|
|
1061
1074
|
|
|
1062
1075
|
### htmlWidget.setEnv(env, [alias])
|
|
@@ -1151,6 +1164,7 @@ Class HtmlMultiWidget include method for working with html
|
|
|
1151
1164
|
* [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
|
|
1152
1165
|
* [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
1153
1166
|
* [.setSupportedCardIcons(elements, validateCardNumberInput)](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
1167
|
+
* [.hideUiErrors()](#user-content-w_MultiWidget+hideUiErrors)
|
|
1154
1168
|
* [.setEnv(env, [alias])](#user-content-w_MultiWidget+setEnv)
|
|
1155
1169
|
* [.loadIFrameUrl()](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
1156
1170
|
* [.setLanguage(code)](#user-content-w_MultiWidget+setLanguage)
|
|
@@ -1683,6 +1697,18 @@ Current method can set icons of supported card types
|
|
|
1683
1697
|
```javascript
|
|
1684
1698
|
widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
|
|
1685
1699
|
```
|
|
1700
|
+
<a name="w_MultiWidget+hideUiErrors" id="w_MultiWidget+hideUiErrors" href="#user-content-w_MultiWidget+hideUiErrors"> </a>
|
|
1701
|
+
|
|
1702
|
+
### htmlMultiWidget.hideUiErrors()
|
|
1703
|
+
Current method can hide prevent the widget from showing the error messages
|
|
1704
|
+
|
|
1705
|
+
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1706
|
+
**Overrides**: [<code>hideUiErrors</code>](#user-content-w_MultiWidget+hideUiErrors)
|
|
1707
|
+
**Example**
|
|
1708
|
+
|
|
1709
|
+
```javascript
|
|
1710
|
+
widget.hideUiErrors('id');
|
|
1711
|
+
```
|
|
1686
1712
|
<a name="w_MultiWidget+setEnv" id="w_MultiWidget+setEnv" href="#user-content-w_MultiWidget+setEnv"> </a>
|
|
1687
1713
|
|
|
1688
1714
|
### htmlMultiWidget.setEnv(env, [alias])
|
|
@@ -1936,6 +1962,7 @@ Class MultiWidget include method for for creating iframe url
|
|
|
1936
1962
|
* [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
|
|
1937
1963
|
* [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
1938
1964
|
* [.setSupportedCardIcons(elements, validateCardNumberInput)](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
1965
|
+
* [.hideUiErrors()](#user-content-w_MultiWidget+hideUiErrors)
|
|
1939
1966
|
* [.setEnv(env, [alias])](#user-content-w_MultiWidget+setEnv)
|
|
1940
1967
|
* [.loadIFrameUrl()](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
1941
1968
|
* [.setLanguage(code)](#user-content-w_MultiWidget+setLanguage)
|
|
@@ -2223,6 +2250,17 @@ Current method can set icons of supported card types
|
|
|
2223
2250
|
```javascript
|
|
2224
2251
|
widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
|
|
2225
2252
|
```
|
|
2253
|
+
<a name="w_MultiWidget+hideUiErrors" id="w_MultiWidget+hideUiErrors" href="#user-content-w_MultiWidget+hideUiErrors"> </a>
|
|
2254
|
+
|
|
2255
|
+
### multiWidget.hideUiErrors()
|
|
2256
|
+
Current method can hide prevent the widget from showing the error messages
|
|
2257
|
+
|
|
2258
|
+
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2259
|
+
**Example**
|
|
2260
|
+
|
|
2261
|
+
```javascript
|
|
2262
|
+
widget.hideUiErrors('id');
|
|
2263
|
+
```
|
|
2226
2264
|
<a name="w_MultiWidget+setEnv" id="w_MultiWidget+setEnv" href="#user-content-w_MultiWidget+setEnv"> </a>
|
|
2227
2265
|
|
|
2228
2266
|
### multiWidget.setEnv(env, [alias])
|
package/docs/api-wrapper.md
CHANGED
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
## Classes
|
|
2
|
-
|
|
3
|
-
<dl>
|
|
4
|
-
<dt><a href="#Api">Api</a></dt>
|
|
5
|
-
<dd><p>Class Api include method for working with paydock api</p>
|
|
6
|
-
</dd>
|
|
7
|
-
</dl>
|
|
8
|
-
|
|
9
|
-
## Interfaces
|
|
10
|
-
|
|
11
|
-
<dl>
|
|
12
|
-
<dt><a href="#BrowserDetails">BrowserDetails</a></dt>
|
|
13
|
-
<dd><p>Interface for browser details response.</p>
|
|
14
|
-
</dd>
|
|
15
|
-
</dl>
|
|
16
|
-
|
|
17
|
-
<a name="BrowserDetails" id="BrowserDetails" href="#BrowserDetails"> </a>
|
|
18
|
-
|
|
19
|
-
## BrowserDetails
|
|
20
|
-
Interface for browser details response.
|
|
21
|
-
|
|
22
|
-
**Kind**: global interface
|
|
23
|
-
|
|
24
|
-
| Param | Type |
|
|
25
|
-
| --- | --- |
|
|
26
|
-
| [name] | <code>string</code> |
|
|
27
|
-
| [java_enabled] | <code>string</code> |
|
|
28
|
-
| [language] | <code>string</code> |
|
|
29
|
-
| [screen_height] | <code>string</code> |
|
|
30
|
-
| [screen_width] | <code>string</code> |
|
|
31
|
-
| [time_zone] | <code>string</code> |
|
|
32
|
-
| [color_depth] | <code>string</code> |
|
|
33
|
-
|
|
34
1
|
<a name="Api" id="Api" href="#Api"> </a>
|
|
35
2
|
|
|
36
3
|
## Api
|
|
@@ -40,7 +7,7 @@ Class Api include method for working with paydock api
|
|
|
40
7
|
|
|
41
8
|
* [Api](#Api)
|
|
42
9
|
* [new Api(publicKey)](#new_Api_new)
|
|
43
|
-
* [.getBrowserDetails()](#Api+getBrowserDetails) ⇒
|
|
10
|
+
* [.getBrowserDetails()](#Api+getBrowserDetails) ⇒ <code>BrowserDetails</code>
|
|
44
11
|
* [.charge()](#Api+charge)
|
|
45
12
|
|
|
46
13
|
<a name="new_Api_new" id="new_Api_new" href="#new_Api_new"> </a>
|
|
@@ -57,11 +24,11 @@ var api = new Api('publicKey');
|
|
|
57
24
|
```
|
|
58
25
|
<a name="Api+getBrowserDetails" id="Api+getBrowserDetails" href="#Api+getBrowserDetails"> </a>
|
|
59
26
|
|
|
60
|
-
### api.getBrowserDetails() ⇒
|
|
27
|
+
### api.getBrowserDetails() ⇒ <code>BrowserDetails</code>
|
|
61
28
|
Method for getting browser details
|
|
62
29
|
|
|
63
30
|
**Kind**: instance method of [<code>Api</code>](#Api)
|
|
64
|
-
**Returns**:
|
|
31
|
+
**Returns**: <code>BrowserDetails</code> - Browser details object
|
|
65
32
|
**Example**
|
|
66
33
|
```js
|
|
67
34
|
api.getBrowserDetails();
|
|
@@ -234,7 +234,7 @@ button.onUpdate((data) => {
|
|
|
234
234
|
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.
|
|
235
235
|
All three callbacks return relevant data according to each one of the scenarios.
|
|
236
236
|
|
|
237
|
-
Note that these callbacks will not
|
|
237
|
+
>*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.*
|
|
238
238
|
|
|
239
239
|
```javascript
|
|
240
240
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
@@ -436,7 +436,7 @@ _(Required `meta` fields: - . Optional `meta` fields: -)_
|
|
|
436
436
|
|
|
437
437
|
This example shows how to use these functions for **ApplePay via MPGS** and **GooglePay via MPGS**:
|
|
438
438
|
|
|
439
|
-
_(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `raw_data_initialization`, `request_shipping`, `style.button_type`)_
|
|
439
|
+
_(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `raw_data_initialization`, `request_shipping`, `style.button_type`, `style.button_style`)_
|
|
440
440
|
### ApplePay and GooglePay via MPGS Full example
|
|
441
441
|
|
|
442
442
|
```html
|
|
@@ -468,6 +468,7 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
468
468
|
},
|
|
469
469
|
apple: {
|
|
470
470
|
button_type: 'buy',
|
|
471
|
+
button_style: 'black',
|
|
471
472
|
},
|
|
472
473
|
},
|
|
473
474
|
shipping_options: [
|
|
@@ -584,6 +585,7 @@ Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpeci
|
|
|
584
585
|
},
|
|
585
586
|
apple: {
|
|
586
587
|
button_type: 'buy',
|
|
588
|
+
button_style: 'black',
|
|
587
589
|
},
|
|
588
590
|
},
|
|
589
591
|
shipping_options: [
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
<dt><a href="#EVENT">EVENT</a> : <code>object</code></dt>
|
|
16
16
|
<dd><p>List of available event's name in the wallet button lifecycle</p>
|
|
17
17
|
</dd>
|
|
18
|
+
<dt><a href="#ContactFieldType">ContactFieldType</a> : <code>object</code></dt>
|
|
19
|
+
<dd><p>List of available contact fields for ContactFieldType</p>
|
|
20
|
+
</dd>
|
|
18
21
|
</dl>
|
|
19
22
|
|
|
20
23
|
## Typedefs
|
|
@@ -35,6 +38,12 @@
|
|
|
35
38
|
<dt><a href="#OnCheckoutCloseCallback">OnCheckoutCloseCallback</a> : <code>function</code></dt>
|
|
36
39
|
<dd><p>Callback for onCheckoutClose method.</p>
|
|
37
40
|
</dd>
|
|
41
|
+
<dt><a href="#OnShippingAddressChangeCallback">OnShippingAddressChangeCallback</a> ⇒ <code><a href="#OnShippingAddressChangeEventResponse">Promise.<OnShippingAddressChangeEventResponse></a></code></dt>
|
|
42
|
+
<dd><p>Callback for onShippingAddressChange method.</p>
|
|
43
|
+
</dd>
|
|
44
|
+
<dt><a href="#OnShippingOptionsChangeCallback">OnShippingOptionsChangeCallback</a> ⇒ <code><a href="#OnShippingOptionChangeEventResponse">Promise.<OnShippingOptionChangeEventResponse></a></code></dt>
|
|
45
|
+
<dd><p>Callback for onShippingOptionsChange method.</p>
|
|
46
|
+
</dd>
|
|
38
47
|
<dt><a href="#OnUnavailableCallback">OnUnavailableCallback</a> : <code>function</code></dt>
|
|
39
48
|
<dd><p>Callback for onUnavailable method.</p>
|
|
40
49
|
</dd>
|
|
@@ -47,7 +56,10 @@
|
|
|
47
56
|
|
|
48
57
|
<dl>
|
|
49
58
|
<dt><a href="#ApplePayWalletMeta">ApplePayWalletMeta</a> : <code>object</code></dt>
|
|
50
|
-
<dd><p>Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process
|
|
59
|
+
<dd><p>Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process.
|
|
60
|
+
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>.
|
|
61
|
+
Apple will determinate if the device has an ApplePay wallet available and at least one active payment.
|
|
62
|
+
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>
|
|
51
63
|
</dd>
|
|
52
64
|
<dt><a href="#PaypalWalletMeta">PaypalWalletMeta</a> : <code>object</code></dt>
|
|
53
65
|
<dd><p>Interface for configuration metadata specific to PayPal integration in the wallet checkout and payment process.
|
|
@@ -74,12 +86,34 @@ For in-depth information, please refer to the <a href="https://developer.paypal.
|
|
|
74
86
|
<dt><a href="#OnErrorEventData">OnErrorEventData</a> : <code>object</code></dt>
|
|
75
87
|
<dd><p>Interface for OnErrorEventData</p>
|
|
76
88
|
</dd>
|
|
89
|
+
<dt><a href="#OnShippingAddressChangeEventData">OnShippingAddressChangeEventData</a> : <code>object</code></dt>
|
|
90
|
+
<dd><p>Interface for OnShippingAddressChangeEventData.</p>
|
|
91
|
+
</dd>
|
|
92
|
+
<dt><a href="#OnShippingAddressChangeEventResponse">OnShippingAddressChangeEventResponse</a> : <code>object</code></dt>
|
|
93
|
+
<dd><p>Interface for OnShippingAddressChangeEventResponse.</p>
|
|
94
|
+
</dd>
|
|
95
|
+
<dt><a href="#IApplePayShippingOption">IApplePayShippingOption</a> : <code>object</code></dt>
|
|
96
|
+
<dd><p>Interface for IApplePayShippingOption.
|
|
97
|
+
Used for adding new shippings options when customer updates the shipping address.</p>
|
|
98
|
+
</dd>
|
|
99
|
+
<dt><a href="#OnShippingOptionChangeEventData">OnShippingOptionChangeEventData</a> : <code>object</code></dt>
|
|
100
|
+
<dd><p>Interface for OnShippingOptionChangeEventData.</p>
|
|
101
|
+
</dd>
|
|
102
|
+
<dt><a href="#OnShippingOptionChangeEventResponse">OnShippingOptionChangeEventResponse</a> : <code>object</code></dt>
|
|
103
|
+
<dd><p>Interface for OnShippingOptionChangeEventResponse.</p>
|
|
104
|
+
</dd>
|
|
105
|
+
<dt><a href="#IApplePayError">IApplePayError</a> : <code>object</code></dt>
|
|
106
|
+
<dd><p>Interface for IApplePayError.</p>
|
|
107
|
+
</dd>
|
|
77
108
|
</dl>
|
|
78
109
|
|
|
79
110
|
<a name="ApplePayWalletMeta" id="ApplePayWalletMeta" href="#ApplePayWalletMeta"> </a>
|
|
80
111
|
|
|
81
112
|
## ApplePayWalletMeta : <code>object</code>
|
|
82
113
|
Interface for configuration metadata specific to ApplePay integration in the wallet checkout and payment process.
|
|
114
|
+
For further information about ApplePay Capabilities refer to [the documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/4440085-applepaycapabilities).
|
|
115
|
+
Apple will determinate if the device has an ApplePay wallet available and at least one active payment.
|
|
116
|
+
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.
|
|
83
117
|
|
|
84
118
|
**Kind**: global interface
|
|
85
119
|
|
|
@@ -92,11 +126,15 @@ Interface for configuration metadata specific to ApplePay integration in the wal
|
|
|
92
126
|
| [merchant_capabilities] | <code>Array.<('supports3DS'\|'supportsEMV'\|'supportsCredit'\|'supportsDebit')></code> | Array of capabilities that the merchant supports, influencing the transaction processing features available. |
|
|
93
127
|
| [supported_networks] | <code>Array.<('visa'\|'masterCard'\|'amex'\|'chinaUnionPay'\|'discover'\|'interac'\|'jcb'\|'privateLabel')></code> | List of payment networks supported by the merchant for ApplePay transactions. |
|
|
94
128
|
| [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. |
|
|
95
|
-
| [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. |
|
|
129
|
+
| [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. |
|
|
96
130
|
| [supported_countries] | <code>Array.<string></code> | List of countries where ApplePay is supported by the merchant, restricting usage to specified regions. |
|
|
97
131
|
| [style] | <code>object</code> | Styling configuration for ApplePay buttons displayed during checkout. |
|
|
98
132
|
| [style.button_type] | <code>ApplePayButtonType</code> | Enum type to select the type of ApplePay button (e.g., 'buy', 'donate', etc.), providing user interface customization. |
|
|
99
133
|
| [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. |
|
|
134
|
+
| [shipping_editing_mode] | <code>'available'</code> \| <code>'store\_pickup'</code> | ApplePay - available for allowing editing shipping, store_pickup for not allowing editing shipping. |
|
|
135
|
+
| [shipping_data] | <code>object</code> | ApplePay - Preloaded data used for populate shipping address information |
|
|
136
|
+
| [shipping_data.email_address] | <code>string</code> | ApplePay - The shipping address email |
|
|
137
|
+
| [apple_pay_capabilities] | <code>Array.<('credentials\_available'\|'credentials\_status\_unknown'\|'credentials\_unavailable')></code> | Device capabilities needed for wallet button to be available. |
|
|
100
138
|
|
|
101
139
|
<a name="PaypalWalletMeta" id="PaypalWalletMeta" href="#PaypalWalletMeta"> </a>
|
|
102
140
|
|
|
@@ -228,6 +266,115 @@ Interface for OnErrorEventData
|
|
|
228
266
|
| [chargeId] | <code>string</code> | chargeId in case it's already set after onClick event |
|
|
229
267
|
| [data] | <code>Error</code> | Error object if present |
|
|
230
268
|
|
|
269
|
+
<a name="OnShippingAddressChangeEventData" id="OnShippingAddressChangeEventData" href="#OnShippingAddressChangeEventData"> </a>
|
|
270
|
+
|
|
271
|
+
## OnShippingAddressChangeEventData : <code>object</code>
|
|
272
|
+
Interface for OnShippingAddressChangeEventData.
|
|
273
|
+
|
|
274
|
+
**Kind**: global interface
|
|
275
|
+
|
|
276
|
+
| Param | Type | Description |
|
|
277
|
+
| --- | --- | --- |
|
|
278
|
+
| event | <code>string</code> | Event Name is 'onShippingAddressChange' |
|
|
279
|
+
| chargeId | <code>string</code> | chargeId set after onClick event |
|
|
280
|
+
| data.address_city | <code>string</code> | PayPal and ApplePay - Shipping address city |
|
|
281
|
+
| data.address_state | <code>string</code> | PayPal and ApplePay - Shipping address state |
|
|
282
|
+
| data.address_postcode | <code>string</code> | PayPal and ApplePay - Shipping address postcode |
|
|
283
|
+
| data.address_country | <code>string</code> | PayPal and ApplePay - Shipping address country code |
|
|
284
|
+
| [data.address_line1] | <code>string</code> | ApplePay - Shipping address line 1 |
|
|
285
|
+
| [data.address_line2] | <code>string</code> | ApplePay - Shipping address line 2 |
|
|
286
|
+
| [data.contact.phone] | <code>string</code> | ApplePay - Shipping contact phone |
|
|
287
|
+
| [data.contact.email] | <code>string</code> | ApplePay - Shipping contact email |
|
|
288
|
+
| [data.contact.first_name] | <code>string</code> | ApplePay - Shipping contact first name |
|
|
289
|
+
| [data.contact.last_name] | <code>string</code> | ApplePay - Shipping contact last name |
|
|
290
|
+
|
|
291
|
+
<a name="OnShippingAddressChangeEventResponse" id="OnShippingAddressChangeEventResponse" href="#OnShippingAddressChangeEventResponse"> </a>
|
|
292
|
+
|
|
293
|
+
## OnShippingAddressChangeEventResponse : <code>object</code>
|
|
294
|
+
Interface for OnShippingAddressChangeEventResponse.
|
|
295
|
+
|
|
296
|
+
**Kind**: global interface
|
|
297
|
+
|
|
298
|
+
| Param | Type | Description |
|
|
299
|
+
| --- | --- | --- |
|
|
300
|
+
| [token] | <code>string</code> | Updated Wallet Token if any |
|
|
301
|
+
| [label] | <code>string</code> | ApplePay - Required. Label to show to the customer. |
|
|
302
|
+
| [amount] | <code>string</code> | ApplePay - Required. New amount for shipping option. |
|
|
303
|
+
| [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. |
|
|
304
|
+
| 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'. |
|
|
305
|
+
| [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'. |
|
|
306
|
+
| [error.message] | <code>string</code> | ApplePay - Custom user facing error message. |
|
|
307
|
+
|
|
308
|
+
<a name="IApplePayShippingOption" id="IApplePayShippingOption" href="#IApplePayShippingOption"> </a>
|
|
309
|
+
|
|
310
|
+
## IApplePayShippingOption : <code>object</code>
|
|
311
|
+
Interface for IApplePayShippingOption.
|
|
312
|
+
Used for adding new shippings options when customer updates the shipping address.
|
|
313
|
+
|
|
314
|
+
**Kind**: global interface
|
|
315
|
+
|
|
316
|
+
| Param | Type | Description |
|
|
317
|
+
| --- | --- | --- |
|
|
318
|
+
| [id] | <code>string</code> | Updated Wallet Token if any |
|
|
319
|
+
| [label] | <code>string</code> | ApplePay - Required. Label to show to the customer. |
|
|
320
|
+
| [amount] | <code>string</code> | ApplePay - Required. New amount for shipping option. |
|
|
321
|
+
| [detail] | <code>string</code> | ApplePay - Optional detail for shipping option. |
|
|
322
|
+
| [date_components_range] | <code>object</code> | ApplePay - Object that contains the dates for shipping |
|
|
323
|
+
| [date_components_range.start_date_components] | <code>object</code> | ApplePay - Contains the start date object |
|
|
324
|
+
| [date_components_range.start_date_components.years] | <code>string</code> | ApplePay - Contains the start date year |
|
|
325
|
+
| [date_components_range.start_date_components.months] | <code>string</code> | ApplePay - Contains the start date month |
|
|
326
|
+
| [date_components_range.start_date_components.days] | <code>string</code> | ApplePay - Contains the start date day |
|
|
327
|
+
| [date_components_range.start_date_components.hours] | <code>string</code> | ApplePay - Contains the start date hour |
|
|
328
|
+
| [date_components_range.end_date_components] | <code>object</code> | ApplePay - Contains the end date year |
|
|
329
|
+
| [date_components_range.end_date_components.years] | <code>string</code> | ApplePay - Contains the end date year |
|
|
330
|
+
| [date_components_range.end_date_components.months] | <code>string</code> | ApplePay - Contains the end date month |
|
|
331
|
+
| [date_components_range.end_date_components.days] | <code>string</code> | ApplePay - Contains the end date day |
|
|
332
|
+
| [date_components_range.end_date_components.hours] | <code>string</code> | ApplePay - Contains the end date hour |
|
|
333
|
+
|
|
334
|
+
<a name="OnShippingOptionChangeEventData" id="OnShippingOptionChangeEventData" href="#OnShippingOptionChangeEventData"> </a>
|
|
335
|
+
|
|
336
|
+
## OnShippingOptionChangeEventData : <code>object</code>
|
|
337
|
+
Interface for OnShippingOptionChangeEventData.
|
|
338
|
+
|
|
339
|
+
**Kind**: global interface
|
|
340
|
+
|
|
341
|
+
| Param | Type | Description |
|
|
342
|
+
| --- | --- | --- |
|
|
343
|
+
| event | <code>string</code> | Event Name is 'onShippingOptionsChange' |
|
|
344
|
+
| chargeId | <code>string</code> | chargeId set after onClick event |
|
|
345
|
+
| [data.shipping_option_id] | <code>string</code> | PayPal and ApplePay - Selected shipping option id |
|
|
346
|
+
| [data.amount] | <code>string</code> | Paypal and ApplePay - Selected shipping option amount |
|
|
347
|
+
| [data.label] | <code>string</code> | ApplePay - Selected shipping option label |
|
|
348
|
+
| [data.detail] | <code>string</code> | ApplePay - Selected shipping option detail |
|
|
349
|
+
|
|
350
|
+
<a name="OnShippingOptionChangeEventResponse" id="OnShippingOptionChangeEventResponse" href="#OnShippingOptionChangeEventResponse"> </a>
|
|
351
|
+
|
|
352
|
+
## OnShippingOptionChangeEventResponse : <code>object</code>
|
|
353
|
+
Interface for OnShippingOptionChangeEventResponse.
|
|
354
|
+
|
|
355
|
+
**Kind**: global interface
|
|
356
|
+
|
|
357
|
+
| Param | Type | Description |
|
|
358
|
+
| --- | --- | --- |
|
|
359
|
+
| [token] | <code>string</code> | Updated Wallet Token if any |
|
|
360
|
+
| [label] | <code>string</code> | ApplePay - Required. Label to show to the customer. |
|
|
361
|
+
| [amount] | <code>string</code> | ApplePay - Required. New amount for shipping option. |
|
|
362
|
+
| [error] | <code>string</code> | PayPal - Error object in case of error when processing shipping option selection. |
|
|
363
|
+
| error.code | <code>string</code> | Possible values for Paypal are 'method_unavailable', 'store_unavailable' or any other string if none applies. |
|
|
364
|
+
|
|
365
|
+
<a name="IApplePayError" id="IApplePayError" href="#IApplePayError"> </a>
|
|
366
|
+
|
|
367
|
+
## IApplePayError : <code>object</code>
|
|
368
|
+
Interface for IApplePayError.
|
|
369
|
+
|
|
370
|
+
**Kind**: global interface
|
|
371
|
+
|
|
372
|
+
| Param | Type | Description |
|
|
373
|
+
| --- | --- | --- |
|
|
374
|
+
| 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. |
|
|
375
|
+
| contact_field | [<code>ContactFieldType</code>](#ContactFieldType) | The error code for this instance. |
|
|
376
|
+
| message | <code>string</code> \| <code>undefined</code> | TA localized, user-facing string that describes the error. |
|
|
377
|
+
|
|
231
378
|
<a name="ApplePayWalletButtonExpress" id="ApplePayWalletButtonExpress" href="#ApplePayWalletButtonExpress"> </a>
|
|
232
379
|
|
|
233
380
|
## ApplePayWalletButtonExpress ⇐ <code>BaseWalletButton</code>
|
|
@@ -246,6 +393,8 @@ Class ApplePayWalletButtonExpress to work with Apple Pay Wallet.
|
|
|
246
393
|
* [.onPaymentInReview([handler])](#BaseWalletButton+onPaymentInReview)
|
|
247
394
|
* [.onPaymentError([handler])](#BaseWalletButton+onPaymentError)
|
|
248
395
|
* [.onCheckoutClose(handler)](#BaseWalletButton+onCheckoutClose)
|
|
396
|
+
* [.onShippingAddressChange([handler])](#BaseWalletButton+onShippingAddressChange)
|
|
397
|
+
* [.onShippingOptionsChange([handler])](#BaseWalletButton+onShippingOptionsChange)
|
|
249
398
|
* [.onUnavailable(handler)](#BaseWalletButton+onUnavailable)
|
|
250
399
|
* [.onError(handler)](#BaseWalletButton+onError)
|
|
251
400
|
|
|
@@ -422,6 +571,52 @@ button.onCheckoutClose(() => {
|
|
|
422
571
|
console.log('Wallet checkout closes');
|
|
423
572
|
});
|
|
424
573
|
```
|
|
574
|
+
<a name="BaseWalletButton+onShippingAddressChange" id="BaseWalletButton+onShippingAddressChange" href="#BaseWalletButton+onShippingAddressChange"> </a>
|
|
575
|
+
|
|
576
|
+
### applePayWalletButtonExpress.onShippingAddressChange([handler])
|
|
577
|
+
If shipping address data is updated, the function passed as parameter will be called.
|
|
578
|
+
Use this method to listen for shipping address selection or input from customer when shipping is enabled.
|
|
579
|
+
The event handler needs to return a new token in case a backend to backend wallet update call was executed.
|
|
580
|
+
In addition, if any error occured, an error string must be supplied.
|
|
581
|
+
By default, the event handler will be processed successfuly if neither token nor error is returned.
|
|
582
|
+
|
|
583
|
+
**Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
|
|
584
|
+
**Overrides**: [<code>onShippingAddressChange</code>](#BaseWalletButton+onShippingAddressChange)
|
|
585
|
+
|
|
586
|
+
| Param | Type | Description |
|
|
587
|
+
| --- | --- | --- |
|
|
588
|
+
| [handler] | [<code>OnShippingAddressChangeCallback</code>](#OnShippingAddressChangeCallback) | Function to be called when the shipping address data is updated. |
|
|
589
|
+
|
|
590
|
+
**Example**
|
|
591
|
+
```js
|
|
592
|
+
button.onShippingAddressChange((data) => {
|
|
593
|
+
const responseData = await fetch('https://your-server.com/update-shipping-info');
|
|
594
|
+
return { error: null, token: responseData.walletToken };
|
|
595
|
+
});
|
|
596
|
+
```
|
|
597
|
+
<a name="BaseWalletButton+onShippingOptionsChange" id="BaseWalletButton+onShippingOptionsChange" href="#BaseWalletButton+onShippingOptionsChange"> </a>
|
|
598
|
+
|
|
599
|
+
### applePayWalletButtonExpress.onShippingOptionsChange([handler])
|
|
600
|
+
If shipping options data is updated, the function passed as parameter will be called.
|
|
601
|
+
Use this method to listen for shipping option selection from customer when shipping is enabled.
|
|
602
|
+
The event handler needs to return a new token in case a backend to backend wallet update call was executed.
|
|
603
|
+
In addition, if any error occured, an error string must be supplied.
|
|
604
|
+
By default, the event handler will be processed successfuly if neither token nor error is returned.
|
|
605
|
+
|
|
606
|
+
**Kind**: instance method of [<code>ApplePayWalletButtonExpress</code>](#ApplePayWalletButtonExpress)
|
|
607
|
+
**Overrides**: [<code>onShippingOptionsChange</code>](#BaseWalletButton+onShippingOptionsChange)
|
|
608
|
+
|
|
609
|
+
| Param | Type | Description |
|
|
610
|
+
| --- | --- | --- |
|
|
611
|
+
| [handler] | [<code>OnShippingOptionsChangeCallback</code>](#OnShippingOptionsChangeCallback) | Function to be called when the shipping options data is updated. |
|
|
612
|
+
|
|
613
|
+
**Example**
|
|
614
|
+
```js
|
|
615
|
+
button.onShippingOptionsChange((data) => {
|
|
616
|
+
const responseData = await fetch('https://your-server.com/update-shipping-info');
|
|
617
|
+
return { error: null, token: responseData.walletToken };
|
|
618
|
+
});
|
|
619
|
+
```
|
|
425
620
|
<a name="BaseWalletButton+onUnavailable" id="BaseWalletButton+onUnavailable" href="#BaseWalletButton+onUnavailable"> </a>
|
|
426
621
|
|
|
427
622
|
### applePayWalletButtonExpress.onUnavailable(handler)
|
|
@@ -477,6 +672,8 @@ Class PaypalWalletButtonExpress to work with Paypal Wallet.
|
|
|
477
672
|
* [.onPaymentInReview([handler])](#BaseWalletButton+onPaymentInReview)
|
|
478
673
|
* [.onPaymentError([handler])](#BaseWalletButton+onPaymentError)
|
|
479
674
|
* [.onCheckoutClose(handler)](#BaseWalletButton+onCheckoutClose)
|
|
675
|
+
* [.onShippingAddressChange([handler])](#BaseWalletButton+onShippingAddressChange)
|
|
676
|
+
* [.onShippingOptionsChange([handler])](#BaseWalletButton+onShippingOptionsChange)
|
|
480
677
|
* [.onUnavailable(handler)](#BaseWalletButton+onUnavailable)
|
|
481
678
|
* [.onError(handler)](#BaseWalletButton+onError)
|
|
482
679
|
|
|
@@ -653,6 +850,52 @@ button.onCheckoutClose(() => {
|
|
|
653
850
|
console.log('Wallet checkout closes');
|
|
654
851
|
});
|
|
655
852
|
```
|
|
853
|
+
<a name="BaseWalletButton+onShippingAddressChange" id="BaseWalletButton+onShippingAddressChange" href="#BaseWalletButton+onShippingAddressChange"> </a>
|
|
854
|
+
|
|
855
|
+
### paypalWalletButtonExpress.onShippingAddressChange([handler])
|
|
856
|
+
If shipping address data is updated, the function passed as parameter will be called.
|
|
857
|
+
Use this method to listen for shipping address selection or input from customer when shipping is enabled.
|
|
858
|
+
The event handler needs to return a new token in case a backend to backend wallet update call was executed.
|
|
859
|
+
In addition, if any error occured, an error string must be supplied.
|
|
860
|
+
By default, the event handler will be processed successfuly if neither token nor error is returned.
|
|
861
|
+
|
|
862
|
+
**Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
|
|
863
|
+
**Overrides**: [<code>onShippingAddressChange</code>](#BaseWalletButton+onShippingAddressChange)
|
|
864
|
+
|
|
865
|
+
| Param | Type | Description |
|
|
866
|
+
| --- | --- | --- |
|
|
867
|
+
| [handler] | [<code>OnShippingAddressChangeCallback</code>](#OnShippingAddressChangeCallback) | Function to be called when the shipping address data is updated. |
|
|
868
|
+
|
|
869
|
+
**Example**
|
|
870
|
+
```js
|
|
871
|
+
button.onShippingAddressChange((data) => {
|
|
872
|
+
const responseData = await fetch('https://your-server.com/update-shipping-info');
|
|
873
|
+
return { error: null, token: responseData.walletToken };
|
|
874
|
+
});
|
|
875
|
+
```
|
|
876
|
+
<a name="BaseWalletButton+onShippingOptionsChange" id="BaseWalletButton+onShippingOptionsChange" href="#BaseWalletButton+onShippingOptionsChange"> </a>
|
|
877
|
+
|
|
878
|
+
### paypalWalletButtonExpress.onShippingOptionsChange([handler])
|
|
879
|
+
If shipping options data is updated, the function passed as parameter will be called.
|
|
880
|
+
Use this method to listen for shipping option selection from customer when shipping is enabled.
|
|
881
|
+
The event handler needs to return a new token in case a backend to backend wallet update call was executed.
|
|
882
|
+
In addition, if any error occured, an error string must be supplied.
|
|
883
|
+
By default, the event handler will be processed successfuly if neither token nor error is returned.
|
|
884
|
+
|
|
885
|
+
**Kind**: instance method of [<code>PaypalWalletButtonExpress</code>](#PaypalWalletButtonExpress)
|
|
886
|
+
**Overrides**: [<code>onShippingOptionsChange</code>](#BaseWalletButton+onShippingOptionsChange)
|
|
887
|
+
|
|
888
|
+
| Param | Type | Description |
|
|
889
|
+
| --- | --- | --- |
|
|
890
|
+
| [handler] | [<code>OnShippingOptionsChangeCallback</code>](#OnShippingOptionsChangeCallback) | Function to be called when the shipping options data is updated. |
|
|
891
|
+
|
|
892
|
+
**Example**
|
|
893
|
+
```js
|
|
894
|
+
button.onShippingOptionsChange((data) => {
|
|
895
|
+
const responseData = await fetch('https://your-server.com/update-shipping-info');
|
|
896
|
+
return { error: null, token: responseData.walletToken };
|
|
897
|
+
});
|
|
898
|
+
```
|
|
656
899
|
<a name="BaseWalletButton+onUnavailable" id="BaseWalletButton+onUnavailable" href="#BaseWalletButton+onUnavailable"> </a>
|
|
657
900
|
|
|
658
901
|
### paypalWalletButtonExpress.onUnavailable(handler)
|
|
@@ -706,6 +949,28 @@ List of available event's name in the wallet button lifecycle
|
|
|
706
949
|
| PAYMENT_IN_REVIEW | <code>string</code> | <code>"paymentInReview"</code> |
|
|
707
950
|
| ON_CLICK | <code>string</code> | <code>"onClick"</code> |
|
|
708
951
|
| ON_CHECKOUT_CLOSE | <code>string</code> | <code>"onCheckoutClose"</code> |
|
|
952
|
+
| ON_SHIPPING_ADDRESS_CHANGE | <code>string</code> | <code>"onShippingAddressChange"</code> |
|
|
953
|
+
| ON_SHIPPING_OPTIONS_CHANGE | <code>string</code> | <code>"onShippingOptionsChange"</code> |
|
|
954
|
+
|
|
955
|
+
<a name="ContactFieldType" id="ContactFieldType" href="#ContactFieldType"> </a>
|
|
956
|
+
|
|
957
|
+
## ContactFieldType : <code>object</code>
|
|
958
|
+
List of available contact fields for ContactFieldType
|
|
959
|
+
|
|
960
|
+
**Kind**: global constant
|
|
961
|
+
|
|
962
|
+
| Param | Type |
|
|
963
|
+
| --- | --- |
|
|
964
|
+
| phone | <code>string</code> |
|
|
965
|
+
| email | <code>string</code> |
|
|
966
|
+
| name | <code>string</code> |
|
|
967
|
+
| phonetic_name | <code>string</code> |
|
|
968
|
+
| address_lines | <code>string</code> |
|
|
969
|
+
| address_city | <code>string</code> |
|
|
970
|
+
| address_postcode | <code>string</code> |
|
|
971
|
+
| address_state | <code>string</code> |
|
|
972
|
+
| address_country | <code>string</code> |
|
|
973
|
+
| address_country_code | <code>string</code> |
|
|
709
974
|
|
|
710
975
|
<a name="OnClickCallback" id="OnClickCallback" href="#OnClickCallback"> </a>
|
|
711
976
|
|
|
@@ -763,6 +1028,30 @@ Callback for onCheckoutClose method.
|
|
|
763
1028
|
| --- | --- |
|
|
764
1029
|
| data | [<code>OnCloseEventData</code>](#OnCloseEventData) |
|
|
765
1030
|
|
|
1031
|
+
<a name="OnShippingAddressChangeCallback" id="OnShippingAddressChangeCallback" href="#OnShippingAddressChangeCallback"> </a>
|
|
1032
|
+
|
|
1033
|
+
## OnShippingAddressChangeCallback ⇒ [<code>Promise.<OnShippingAddressChangeEventResponse></code>](#OnShippingAddressChangeEventResponse)
|
|
1034
|
+
Callback for onShippingAddressChange method.
|
|
1035
|
+
|
|
1036
|
+
**Kind**: global typedef
|
|
1037
|
+
**Returns**: [<code>Promise.<OnShippingAddressChangeEventResponse></code>](#OnShippingAddressChangeEventResponse) - Address update result
|
|
1038
|
+
|
|
1039
|
+
| Param | Type |
|
|
1040
|
+
| --- | --- |
|
|
1041
|
+
| data | [<code>OnShippingAddressChangeEventData</code>](#OnShippingAddressChangeEventData) |
|
|
1042
|
+
|
|
1043
|
+
<a name="OnShippingOptionsChangeCallback" id="OnShippingOptionsChangeCallback" href="#OnShippingOptionsChangeCallback"> </a>
|
|
1044
|
+
|
|
1045
|
+
## OnShippingOptionsChangeCallback ⇒ [<code>Promise.<OnShippingOptionChangeEventResponse></code>](#OnShippingOptionChangeEventResponse)
|
|
1046
|
+
Callback for onShippingOptionsChange method.
|
|
1047
|
+
|
|
1048
|
+
**Kind**: global typedef
|
|
1049
|
+
**Returns**: [<code>Promise.<OnShippingOptionChangeEventResponse></code>](#OnShippingOptionChangeEventResponse) - Address update result
|
|
1050
|
+
|
|
1051
|
+
| Param | Type |
|
|
1052
|
+
| --- | --- |
|
|
1053
|
+
| data | [<code>OnShippingOptionChangeEventData</code>](#OnShippingOptionChangeEventData) |
|
|
1054
|
+
|
|
766
1055
|
<a name="OnUnavailableCallback" id="OnUnavailableCallback" href="#OnUnavailableCallback"> </a>
|
|
767
1056
|
|
|
768
1057
|
## OnUnavailableCallback : <code>function</code>
|
package/docs/wallet-buttons.md
CHANGED
|
@@ -170,10 +170,12 @@ Interface of data used by the wallet checkout and payment proccess.
|
|
|
170
170
|
| [merchant_name] | <code>string</code> | Merchant Name used for GooglePay integration via MPGS. Required for [GooglePay]. N/A for other wallets. |
|
|
171
171
|
| [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. |
|
|
172
172
|
| [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]. |
|
|
173
|
-
| [style.button_type] | <code>object</code> | Used to select ApplePay button type (e.g: 'buy','donate', etc), check possible values
|
|
173
|
+
| [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. |
|
|
174
|
+
| [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. |
|
|
174
175
|
| [style.height] | <code>object</code> | Used to select Afterpay button height. Optional for [Afterpay]. N/A for other wallets. |
|
|
175
176
|
| [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. |
|
|
176
177
|
| [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]. |
|
|
178
|
+
| [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]. |
|
|
177
179
|
|
|
178
180
|
<a name="IApplePayShippingOption" id="IApplePayShippingOption" href="#IApplePayShippingOption"> </a>
|
|
179
181
|
|