@paydock/client-sdk 1.104.3-beta → 1.104.7-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 +729 -405
- package/bundles/index.cjs +29624 -8753
- package/bundles/index.cjs.d.ts +484 -381
- package/bundles/index.cjs.map +1 -1
- package/bundles/index.mjs +29624 -8753
- package/bundles/index.mjs.d.ts +484 -381
- package/bundles/index.mjs.map +1 -1
- package/bundles/types/api/api-base.d.ts +14 -6
- package/bundles/types/api/api-base.d.ts.map +1 -1
- package/bundles/types/api/api-service-internal.d.ts +2 -1
- package/bundles/types/api/api-service-internal.d.ts.map +1 -1
- package/bundles/types/api/api.d.ts +1 -1
- package/bundles/types/api/api.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts +1 -1
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts +3 -3
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -1
- package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts +1 -1
- package/bundles/types/checkout-button/afterpay/afterpay-checkout-button.d.ts.map +1 -1
- package/bundles/types/checkout-button/checkout-button.d.ts +1 -1
- package/bundles/types/checkout-button/checkout-button.d.ts.map +1 -1
- package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts +1 -1
- package/bundles/types/checkout-button/paypal/paypal-checkout-button.d.ts.map +1 -1
- package/bundles/types/checkout-button/runner/popup.runner.d.ts +1 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts +1 -1
- package/bundles/types/checkout-button/zipmoney/zipmoney-checkout-button.d.ts.map +1 -1
- package/bundles/types/components/container.d.ts +1 -0
- package/bundles/types/components/container.d.ts.map +1 -1
- package/bundles/types/components/http-core.d.ts.map +1 -1
- package/bundles/types/components/iframe-event.d.ts +17 -11
- package/bundles/types/components/iframe-event.d.ts.map +1 -1
- package/bundles/types/components/link.d.ts +3 -2
- package/bundles/types/components/link.d.ts.map +1 -1
- package/bundles/types/components/param.d.ts +6 -8
- package/bundles/types/components/param.d.ts.map +1 -1
- package/bundles/types/components/wallet-background.d.ts +2 -1
- package/bundles/types/components/wallet-background.d.ts.map +1 -1
- package/bundles/types/configs/env/environment.cba.d.ts +1 -1
- package/bundles/types/configs/env/environment.cba.d.ts.map +1 -1
- package/bundles/types/configs/env/environment.paydock.d.ts +1 -1
- package/bundles/types/configs/env/environment.paydock.d.ts.map +1 -1
- package/bundles/types/constants/validators.d.ts +45 -0
- package/bundles/types/constants/validators.d.ts.map +1 -0
- package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts +17 -13
- package/bundles/types/payment-source-widget/html-payment-source-widget.d.ts.map +1 -1
- package/bundles/types/payment-source-widget/payment-source-widget.d.ts +1 -1
- package/bundles/types/payment-source-widget/payment-source-widget.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/index.d.ts +102 -1
- package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/interfaces.d.ts +109 -32
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts +31 -0
- package/bundles/types/secure-remote-commerce/mastercard-secure-remote-commerce.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts +2 -0
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/index.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/providers/{visa-src/visa-src.d.ts → mastercard-src/mastercard-src.d.ts} +5 -8
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -0
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts +13 -91
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -1
- package/bundles/types/shared/http/http-request.d.ts +14 -0
- package/bundles/types/shared/http/http-request.d.ts.map +1 -0
- package/bundles/types/shared/http/index.d.ts +2 -0
- package/bundles/types/shared/http/index.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts +15 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.agent.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts +66 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.config.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts +14 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts +15 -0
- package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts +23 -0
- package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts +15 -0
- package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/repositories/index.d.ts +4 -0
- package/bundles/types/shared/services/instrumentation/repositories/index.d.ts.map +1 -0
- package/bundles/types/vault-display-widget/vault-display-widget.d.ts +1 -1
- package/bundles/types/vault-display-widget/vault-display-widget.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/apple.wallet-service.d.ts +2 -0
- package/bundles/types/wallet-buttons/apple.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts +8 -1
- package/bundles/types/wallet-buttons/flypay-v2.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/google.wallet-service.d.ts +7 -4
- package/bundles/types/wallet-buttons/google.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts +4 -0
- package/bundles/types/wallet-buttons/helpers/flypay-v2.helper.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/index.d.ts +126 -0
- package/bundles/types/wallet-buttons/index.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/interfaces.d.ts +3 -0
- package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/paypal.wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts +63 -121
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts +1 -1
- package/bundles/types/wallet-buttons/wallet-cba-buttons.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-service.d.ts +7 -0
- package/bundles/types/wallet-buttons/wallet-service.d.ts.map +1 -1
- package/bundles/types/widget/configuration.d.ts +1 -1
- package/bundles/types/widget/configuration.d.ts.map +1 -1
- package/bundles/types/widget/html-multi-widget.d.ts +147 -76
- package/bundles/types/widget/html-multi-widget.d.ts.map +1 -1
- package/bundles/types/widget/html-widget.d.ts +1 -1
- package/bundles/types/widget/html-widget.d.ts.map +1 -1
- package/bundles/types/widget/multi-widget.d.ts.map +1 -1
- package/bundles/widget.umd.js +29624 -8753
- package/bundles/widget.umd.js.d.ts +484 -381
- package/bundles/widget.umd.js.map +1 -1
- package/bundles/widget.umd.js.min.d.ts +484 -381
- package/bundles/widget.umd.min.js +62 -1
- package/bundles/widget.umd.min.js.map +1 -1
- package/docs/api-ps-widget.md +12 -12
- package/docs/api-widget.md +211 -156
- package/docs/license.md +1 -1
- package/docs/secure-remote-commerce-examples.md +75 -101
- package/docs/secure-remote-commerce.md +185 -114
- package/docs/wallet-buttons-examples.md +48 -19
- package/docs/wallet-buttons.md +197 -2
- package/examples/multi-html-widget/simple.html +2 -1
- package/package.json +18 -15
- package/slate.md +123 -120
- package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts +0 -8
- package/bundles/types/secure-remote-commerce/providers/visa-src/helper.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts +0 -2
- package/bundles/types/secure-remote-commerce/providers/visa-src/index.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.d.ts.map +0 -1
- package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +0 -9
- package/bundles/types/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts.map +0 -1
|
@@ -1,140 +1,217 @@
|
|
|
1
1
|
## Classes
|
|
2
2
|
|
|
3
3
|
<dl>
|
|
4
|
-
<dt><a href="#
|
|
5
|
-
<dd><p>Class
|
|
4
|
+
<dt><a href="#MastercardSRCClickToPay">MastercardSRCClickToPay</a> ⇐ <code>SRC</code></dt>
|
|
5
|
+
<dd><p>Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option</p>
|
|
6
6
|
</dd>
|
|
7
7
|
</dl>
|
|
8
8
|
|
|
9
9
|
## Interfaces
|
|
10
10
|
|
|
11
11
|
<dl>
|
|
12
|
-
<dt><a href="#
|
|
13
|
-
<dd><p>Interface of data used for the
|
|
12
|
+
<dt><a href="#IMastercardSRCMeta">IMastercardSRCMeta</a> : <code>object</code></dt>
|
|
13
|
+
<dd><p>Interface of data used for the Mastercard Checkout. For further information refer to <a href="https://developer.mastercard.com/unified-checkout-solutions/documentation/sdk-reference/init">the documentation</a>.</p>
|
|
14
|
+
</dd>
|
|
15
|
+
<dt><a href="#EventData">EventData</a> : <code>object</code></dt>
|
|
16
|
+
<dd><p>Interface for data returned in callbacks</p>
|
|
17
|
+
</dd>
|
|
18
|
+
<dt><a href="#EventDataCheckoutCompletedData">EventDataCheckoutCompletedData</a> : <code>object</code></dt>
|
|
19
|
+
<dd><p>Event data returned for checkoutCompleted callback, holding the One Time Token and the flow type completed.
|
|
20
|
+
When the flow type is src, masked checkoutData available is also returned</p>
|
|
21
|
+
</dd>
|
|
22
|
+
<dt><a href="#IStyles">IStyles</a> : <code>object</code></dt>
|
|
23
|
+
<dd><p>Interface for style configs inyected to the SRC checkout</p>
|
|
14
24
|
</dd>
|
|
15
25
|
</dl>
|
|
16
26
|
|
|
17
|
-
<a name="
|
|
27
|
+
<a name="IMastercardSRCMeta" id="IMastercardSRCMeta" href="#IMastercardSRCMeta"> </a>
|
|
18
28
|
|
|
19
|
-
##
|
|
20
|
-
Interface of data used for the
|
|
29
|
+
## IMastercardSRCMeta : <code>object</code>
|
|
30
|
+
Interface of data used for the Mastercard Checkout. For further information refer to [the documentation](https://developer.mastercard.com/unified-checkout-solutions/documentation/sdk-reference/init).
|
|
21
31
|
|
|
22
32
|
**Kind**: global interface
|
|
23
33
|
|
|
24
34
|
| Param | Type | Description |
|
|
25
35
|
| --- | --- | --- |
|
|
26
|
-
| [
|
|
36
|
+
| [disable_summary_screen] | <code>boolean</code> | Boolean flag that controls if a final summary screen is presented in the checkout flow. |
|
|
27
37
|
| [dpa_data] | <code>object</code> | Object where the DPA creation data is stored. |
|
|
28
|
-
| [dpa_data.dpa_presentation_name] | <code>string</code> | Name in which the DPA is presented
|
|
38
|
+
| [dpa_data.dpa_presentation_name] | <code>string</code> | Name in which the DPA is presented. |
|
|
29
39
|
| [dpa_data.dpa_uri] | <code>string</code> | Used for indicating the DPA URI. |
|
|
30
|
-
| [
|
|
40
|
+
| [dpa_data.dpa_address] | <code>string</code> | Address associated with the DPA. |
|
|
41
|
+
| [dpa_data.dpa_email_address] | <code>string</code> | Email address for DPA communication. |
|
|
42
|
+
| [dpa_data.dpa_phone_number] | <code>object</code> | Phone number structure for DPA communication. |
|
|
43
|
+
| [dpa_data.dpa_phone_number.country_code] | <code>string</code> | The country code of the phone number. |
|
|
44
|
+
| [dpa_data.dpa_phone_number.phone_number] | <code>string</code> | The phone number part of the phone number. |
|
|
45
|
+
| [dpa_data.dpa_logo_uri] | <code>string</code> | URI for the DPA logo. |
|
|
46
|
+
| [dpa_data.dpa_supported_email_address] | <code>string</code> | Supported email address for DPA support. |
|
|
47
|
+
| [dpa_data.dpa_supported_phone_number] | <code>object</code> | Supported phone number for DPA support. |
|
|
48
|
+
| [dpa_data.dpa_supported_phone_number.country_code] | <code>string</code> | The country code of the phone number. |
|
|
49
|
+
| [dpa_data.dpa_supported_phone_number.phone_number] | <code>string</code> | The phone number part of the phone number. |
|
|
50
|
+
| [dpa_data.dpa_support_uri] | <code>string</code> | URI for DPA support. |
|
|
51
|
+
| [dpa_data.application_type] | <code>string</code> | Application type, either 'WEB_BROWSER' or 'MOBILE_APP'. |
|
|
52
|
+
| [co_brand_names] | <code>Array.<string></code> | List of co-brand names associated with the SRC experience. |
|
|
53
|
+
| [checkout_experience] | <code>string</code> | Checkout experience type, either 'WITHIN_CHECKOUT' or 'PAYMENT_SETTINGS'. |
|
|
54
|
+
| [services] | <code>string</code> | Services offered, such as 'INLINE_CHECKOUT' or 'INLINE_INSTALLMENTS'. |
|
|
55
|
+
| [dpa_transaction_options] | <code>object</code> | Object that stores options for creating a transaction with DPA. |
|
|
31
56
|
| [dpa_transaction_options.dpa_locale] | <code>string</code> | DPA’s preferred locale, example en_US. |
|
|
32
|
-
| [dpa_transaction_options.dpa_accepted_billing_countries] | <code>Array
|
|
33
|
-
| [dpa_transaction_options.
|
|
34
|
-
| [dpa_transaction_options.
|
|
35
|
-
| [dpa_transaction_options.
|
|
36
|
-
| [dpa_transaction_options.
|
|
37
|
-
| [dpa_transaction_options.
|
|
38
|
-
| [dpa_transaction_options.
|
|
39
|
-
| [dpa_transaction_options.
|
|
40
|
-
| [dpa_transaction_options.
|
|
41
|
-
| [dpa_transaction_options.
|
|
42
|
-
| [dpa_transaction_options.
|
|
43
|
-
| [dpa_transaction_options.
|
|
44
|
-
| [dpa_transaction_options.
|
|
45
|
-
| [dpa_transaction_options.
|
|
46
|
-
| [dpa_transaction_options.
|
|
47
|
-
| [dpa_transaction_options.
|
|
48
|
-
| [dpa_transaction_options.transaction_amount.transaction_amount] | <code>number</code> | Used to indicate the amount of the transaction. |
|
|
49
|
-
| [dpa_transaction_options.transaction_amount.transaction_currency_code] | <code>string</code> | Used to indicate the currency code of the transaction. 3 letter ISO code format. |
|
|
50
|
-
| [dpa_transaction_options.merchant_order_id] | <code>string</code> | Used to indicate the merchants order Id. |
|
|
51
|
-
| [dpa_transaction_options.merchant_category_code] | <code>string</code> | Used to indicate the merchants category code. |
|
|
52
|
-
| [dpa_transaction_options.merchant_country_code] | <code>string</code> | Used to indicate the merchants country code. 2 letter ISO code format. |
|
|
57
|
+
| [dpa_transaction_options.dpa_accepted_billing_countries] | <code>Array.<string></code> | List of accepted billing countries for DPA in ISO 3166-1 alpha-2 format. |
|
|
58
|
+
| [dpa_transaction_options.dpa_billing_preference] | <code>string</code> | Billing preferences for DPA, options are 'FULL', 'POSTAL_COUNTRY', 'NONE'. |
|
|
59
|
+
| [dpa_transaction_options.payment_options] | <code>Array.<object></code> | Payment options included in the transaction. |
|
|
60
|
+
| [dpa_transaction_options.payment_options.dynamic_data_type] | <code>string</code> | Dynamic data types. |
|
|
61
|
+
| [dpa_transaction_options.order_type] | <code>string</code> | Type of the order, options are 'SPLIT_SHIPMENT', 'PREFERRED_CARD'. |
|
|
62
|
+
| [dpa_transaction_options.three_ds_preference] | <code>string</code> | Preference for 3DS usage in the transaction. |
|
|
63
|
+
| [dpa_transaction_options.confirm_payment] | <code>boolean</code> | Indicates if payment confirmation is required. |
|
|
64
|
+
| [dpa_transaction_options.consumer_name_requested] | <code>boolean</code> | Indicates if consumer name is requested. |
|
|
65
|
+
| [dpa_transaction_options.consumer_email_address_requested] | <code>boolean</code> | Indicates if consumer email address is requested. |
|
|
66
|
+
| [dpa_transaction_options.consumer_phone_number_requested] | <code>boolean</code> | Indicates if consumer phone number is requested. |
|
|
67
|
+
| [dpa_transaction_options.transaction_amount] | <code>object</code> | Details of the transaction amount. |
|
|
68
|
+
| [dpa_transaction_options.transaction_amount.transaction_amount] | <code>number</code> | Amount of the transaction. |
|
|
69
|
+
| [dpa_transaction_options.transaction_amount.transaction_currency_code] | <code>string</code> | Currency code of the transaction in 3 letter ISO code format. |
|
|
70
|
+
| [dpa_transaction_options.merchant_order_id] | <code>string</code> | Merchant's order ID. |
|
|
71
|
+
| [dpa_transaction_options.merchant_category_code] | <code>string</code> | Merchant's category code. |
|
|
72
|
+
| [dpa_transaction_options.merchant_country_code] | <code>string</code> | Merchant's country code in ISO 3166-1 alpha-2 format. |
|
|
53
73
|
| [customer] | <code>object</code> | Object where the customer data is stored to prefill in the checkout. |
|
|
54
74
|
| [customer.email] | <code>string</code> | Customer email. |
|
|
55
75
|
| [customer.first_name] | <code>string</code> | Customer first name. |
|
|
56
76
|
| [customer.last_name] | <code>string</code> | Customer last name. |
|
|
57
77
|
| [customer.phone] | <code>object</code> | Object where the customer phone is stored. |
|
|
58
|
-
| [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
|
|
78
|
+
| [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). // TODO: Confirm if it can be removed! |
|
|
59
79
|
| [customer.phone.phone] | <code>string</code> | Customer phone number. |
|
|
60
|
-
| [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
80
|
+
| [unaccepted_card_type] | <code>string</code> | Used to block a specific card type. Options are 'CREDIT', 'DEBIT'. |
|
|
81
|
+
|
|
82
|
+
<a name="EventData" id="EventData" href="#EventData"> </a>
|
|
83
|
+
|
|
84
|
+
## EventData : <code>object</code>
|
|
85
|
+
Interface for data returned in callbacks
|
|
86
|
+
|
|
87
|
+
**Kind**: global interface
|
|
67
88
|
|
|
68
|
-
|
|
89
|
+
| Param | Type | Description |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| type | [<code>EVENT\_DATA\_TYPE</code>](#EVENT_DATA_TYPE) | Event type of type [EVENT_DATA_TYPE](#EVENT_DATA_TYPE) |
|
|
92
|
+
| data | <code>string</code> \| [<code>EventDataCheckoutCompletedData</code>](#EventDataCheckoutCompletedData) | optional data returning a string for checkoutError event or [EventDataCheckoutCompletedData](#EventDataCheckoutCompletedData) for checkoutCompleted |
|
|
69
93
|
|
|
70
|
-
|
|
71
|
-
|
|
94
|
+
<a name="EventDataCheckoutCompletedData" id="EventDataCheckoutCompletedData" href="#EventDataCheckoutCompletedData"> </a>
|
|
95
|
+
|
|
96
|
+
## EventDataCheckoutCompletedData : <code>object</code>
|
|
97
|
+
Event data returned for checkoutCompleted callback, holding the One Time Token and the flow type completed.
|
|
98
|
+
When the flow type is src, masked checkoutData available is also returned
|
|
99
|
+
|
|
100
|
+
**Kind**: global interface
|
|
101
|
+
|
|
102
|
+
| Param | Type | Description |
|
|
103
|
+
| --- | --- | --- |
|
|
104
|
+
| type | <code>string</code> | type of the checkout, can be `src` or `manual`. |
|
|
105
|
+
| token | <code>string</code> | one time token value. |
|
|
106
|
+
| [checkoutData] | <code>object</code> | Optional checkout data related to the checkout information. Only available on src flow. |
|
|
107
|
+
| [checkoutData.card_number_bin] | <code>string</code> | The BIN of the card used for the transaction. |
|
|
108
|
+
| [checkoutData.card_number_last4] | <code>string</code> | The last four digits of the card number. |
|
|
109
|
+
| [checkoutData.card_scheme] | <code>string</code> | The card scheme. Values: visa, mastercard, amex, diners, discover. |
|
|
110
|
+
| [checkoutData.card_type] | <code>string</code> | The type of card. Values: credit, debit, prepaid, combo, flex. |
|
|
111
|
+
| [checkoutData.address_line1] | <code>string</code> | Address line 1 for billing address. |
|
|
112
|
+
| [checkoutData.address_line2] | <code>string</code> | Address line 2 for billing address. |
|
|
113
|
+
| [checkoutData.address_line3] | <code>string</code> | Address line 3 for billing address. |
|
|
114
|
+
| [checkoutData.address_city] | <code>string</code> | City for billing address. |
|
|
115
|
+
| [checkoutData.address_postcode] | <code>string</code> | Postal code for billing address. |
|
|
116
|
+
| [checkoutData.address_state] | <code>string</code> | State or province for billing address. |
|
|
117
|
+
| [checkoutData.address_country] | <code>string</code> | Country for billing address. |
|
|
118
|
+
| [checkoutData.shipping] | <code>object</code> | Optional shipping information. |
|
|
119
|
+
| [checkoutData.shipping.address_line1] | <code>string</code> | Address line 1 for shipping address. |
|
|
120
|
+
| [checkoutData.shipping.address_line2] | <code>string</code> | Address line 2 for shipping address. |
|
|
121
|
+
| [checkoutData.shipping.address_line3] | <code>string</code> | Address line 3 for shipping address. |
|
|
122
|
+
| [checkoutData.shipping.address_city] | <code>string</code> | City for shipping address. |
|
|
123
|
+
| [checkoutData.shipping.address_postcode] | <code>string</code> | Postal code for shipping address. |
|
|
124
|
+
| [checkoutData.shipping.address_state] | <code>string</code> | State or province for shipping address. |
|
|
125
|
+
| [checkoutData.shipping.address_country] | <code>string</code> | Country for shipping address. |
|
|
126
|
+
|
|
127
|
+
<a name="IStyles" id="IStyles" href="#IStyles"> </a>
|
|
128
|
+
|
|
129
|
+
## IStyles : <code>object</code>
|
|
130
|
+
Interface for style configs inyected to the SRC checkout
|
|
131
|
+
|
|
132
|
+
**Kind**: global interface
|
|
133
|
+
|
|
134
|
+
| Param | Type | Description |
|
|
135
|
+
| --- | --- | --- |
|
|
136
|
+
| [primary_button_color] | <code>string</code> | Color Code for primary button. |
|
|
137
|
+
| [primary_button_text_color] | <code>string</code> | Color Code for primary button text. |
|
|
138
|
+
| [secondary_button_color] | <code>string</code> | Color Code for secondary button. |
|
|
139
|
+
| [secondary_button_text_color] | <code>string</code> | Color Code for secondary button text. |
|
|
140
|
+
| [font_family] | <code>string</code> | Font family to be used. |
|
|
141
|
+
| [enable_src_popup] | <code>boolean</code> | Boolean flag to make the SRC checkout show in a popup window instead of embedded in iframe. |
|
|
142
|
+
|
|
143
|
+
<a name="MastercardSRCClickToPay" id="MastercardSRCClickToPay" href="#MastercardSRCClickToPay"> </a>
|
|
144
|
+
|
|
145
|
+
## MastercardSRCClickToPay ⇐ <code>SRC</code>
|
|
146
|
+
Class MastercardSRCClickToPay include methods for interacting with the MastercardSRC checkout and Manual Card option
|
|
72
147
|
|
|
73
148
|
**Kind**: global class
|
|
149
|
+
**Extends**: <code>SRC</code>
|
|
74
150
|
|
|
75
|
-
* [
|
|
76
|
-
* [new
|
|
151
|
+
* [MastercardSRCClickToPay](#MastercardSRCClickToPay) ⇐ <code>SRC</code>
|
|
152
|
+
* [new MastercardSRCClickToPay(iframe_selector, service_id, public_key_or_access_token, meta)](#new_MastercardSRCClickToPay_new)
|
|
153
|
+
* [.load()](#MastercardSRCClickToPay+load)
|
|
77
154
|
* [.setStyles(fields)](#SRC+setStyles)
|
|
78
|
-
* [.load()](#SRC+load)
|
|
79
155
|
* [.setEnv(env, [alias])](#SRC+setEnv)
|
|
80
156
|
* [.getEnv()](#SRC+getEnv)
|
|
81
157
|
* [.on(eventName, [cb])](#SRC+on) ⇒ <code>Promise.<any></code> \| <code>void</code>
|
|
82
|
-
* [.hideButton([saveSize])](#SRC+hideButton)
|
|
83
|
-
* [.showButton()](#SRC+showButton)
|
|
84
158
|
* [.hideCheckout([saveSize])](#SRC+hideCheckout)
|
|
85
159
|
* [.showCheckout()](#SRC+showCheckout)
|
|
86
160
|
* [.reload()](#SRC+reload)
|
|
87
161
|
* [.useAutoResize()](#SRC+useAutoResize)
|
|
88
162
|
|
|
89
|
-
<a name="
|
|
163
|
+
<a name="new_MastercardSRCClickToPay_new" id="new_MastercardSRCClickToPay_new" href="#new_MastercardSRCClickToPay_new"> </a>
|
|
90
164
|
|
|
91
|
-
### new
|
|
165
|
+
### new MastercardSRCClickToPay(iframe_selector, service_id, public_key_or_access_token, meta)
|
|
92
166
|
|
|
93
167
|
| Param | Type | Description |
|
|
94
168
|
| --- | --- | --- |
|
|
95
|
-
| button_selector | <code>string</code> | Selector of html element. Container for SRC checkout button. |
|
|
96
169
|
| iframe_selector | <code>string</code> | Selector of html element. Container for SRC checkout iFrame. |
|
|
97
170
|
| service_id | <code>string</code> | Card Scheme Service ID |
|
|
98
171
|
| public_key_or_access_token | <code>string</code> | Paydock public key or Access Token |
|
|
99
|
-
| meta | [<code>
|
|
172
|
+
| meta | [<code>IMastercardSRCMeta</code>](#IMastercardSRCMeta) | Data that configures the SRC checkout |
|
|
100
173
|
|
|
101
174
|
**Example**
|
|
102
175
|
```js
|
|
103
|
-
var
|
|
176
|
+
var mastercardSRC = new MastercardSRCClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
|
|
104
177
|
```
|
|
178
|
+
<a name="MastercardSRCClickToPay+load" id="MastercardSRCClickToPay+load" href="#MastercardSRCClickToPay+load"> </a>
|
|
179
|
+
|
|
180
|
+
### mastercardSRCClickToPay.load()
|
|
181
|
+
The final method after configuring the SRC to start the load process of SRC checkout
|
|
182
|
+
|
|
183
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
105
184
|
<a name="SRC+setStyles" id="SRC+setStyles" href="#SRC+setStyles"> </a>
|
|
106
185
|
|
|
107
|
-
###
|
|
186
|
+
### mastercardSRCClickToPay.setStyles(fields)
|
|
108
187
|
Object contain styles for widget - call before `.load()`.
|
|
109
188
|
|
|
110
|
-
**Kind**: instance method of [<code>
|
|
189
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
190
|
+
**Overrides**: [<code>setStyles</code>](#SRC+setStyles)
|
|
111
191
|
|
|
112
192
|
| Param | Type | Description |
|
|
113
193
|
| --- | --- | --- |
|
|
114
|
-
| fields | <code>IStyles</code> | name of styles which can be shown in widget [STYLE](STYLE) |
|
|
194
|
+
| fields | [<code>IStyles</code>](#IStyles) | name of styles which can be shown in widget [STYLE](STYLE) |
|
|
115
195
|
|
|
116
196
|
**Example**
|
|
117
197
|
```js
|
|
118
198
|
widget.setStyles({
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
199
|
+
enable_src_popup: true
|
|
200
|
+
primary_button_color: 'red',
|
|
201
|
+
secondary_button_color: 'blue',
|
|
202
|
+
primary_button_text_color: 'white',
|
|
203
|
+
secondary_button_text_color: 'white',
|
|
204
|
+
font_family: 'Arial',
|
|
205
|
+
});
|
|
124
206
|
```
|
|
125
|
-
<a name="SRC+load" id="SRC+load" href="#SRC+load"> </a>
|
|
126
|
-
|
|
127
|
-
### srC.load()
|
|
128
|
-
The final method after configuring the SRC to start the load process of SRC checkout
|
|
129
|
-
|
|
130
|
-
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
131
207
|
<a name="SRC+setEnv" id="SRC+setEnv" href="#SRC+setEnv"> </a>
|
|
132
208
|
|
|
133
|
-
###
|
|
209
|
+
### mastercardSRCClickToPay.setEnv(env, [alias])
|
|
134
210
|
Current method can change environment. By default environment = sandbox.
|
|
135
211
|
Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
136
212
|
|
|
137
|
-
**Kind**: instance method of [<code>
|
|
213
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
214
|
+
**Overrides**: [<code>setEnv</code>](#SRC+setEnv)
|
|
138
215
|
|
|
139
216
|
| Param | Type | Description |
|
|
140
217
|
| --- | --- | --- |
|
|
@@ -147,25 +224,27 @@ SRC.setEnv('production');
|
|
|
147
224
|
```
|
|
148
225
|
<a name="SRC+getEnv" id="SRC+getEnv" href="#SRC+getEnv"> </a>
|
|
149
226
|
|
|
150
|
-
###
|
|
227
|
+
### mastercardSRCClickToPay.getEnv()
|
|
151
228
|
Method to read the current environment
|
|
152
229
|
|
|
153
|
-
**Kind**: instance method of [<code>
|
|
230
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
231
|
+
**Overrides**: [<code>getEnv</code>](#SRC+getEnv)
|
|
154
232
|
**Example**
|
|
155
233
|
```js
|
|
156
234
|
SRC.getEnv();
|
|
157
235
|
```
|
|
158
236
|
<a name="SRC+on" id="SRC+on" href="#SRC+on"> </a>
|
|
159
237
|
|
|
160
|
-
###
|
|
238
|
+
### mastercardSRCClickToPay.on(eventName, [cb]) ⇒ <code>Promise.<any></code> \| <code>void</code>
|
|
161
239
|
Listen to events of SRC
|
|
162
240
|
|
|
163
|
-
**Kind**: instance method of [<code>
|
|
241
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
242
|
+
**Overrides**: [<code>on</code>](#SRC+on)
|
|
164
243
|
|
|
165
244
|
| Param | Type | Description |
|
|
166
245
|
| --- | --- | --- |
|
|
167
246
|
| eventName | <code>string</code> | Available event names [EVENT](#EVENT) |
|
|
168
|
-
| [cb] | <code>listener</code> |
|
|
247
|
+
| [cb] | <code>listener</code> | The callback to handle the event. When available, it will send back data of type [EventData](#EventData) |
|
|
169
248
|
|
|
170
249
|
**Example**
|
|
171
250
|
```js
|
|
@@ -177,37 +256,13 @@ SRC.on('checkoutCompleted').then(function (token) {
|
|
|
177
256
|
console.log(token);
|
|
178
257
|
});
|
|
179
258
|
```
|
|
180
|
-
<a name="SRC+hideButton" id="SRC+hideButton" href="#SRC+hideButton"> </a>
|
|
181
|
-
|
|
182
|
-
### srC.hideButton([saveSize])
|
|
183
|
-
Using this method you can hide button
|
|
184
|
-
|
|
185
|
-
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
186
|
-
|
|
187
|
-
| Param | Type | Default | Description |
|
|
188
|
-
| --- | --- | --- | --- |
|
|
189
|
-
| [saveSize] | <code>boolean</code> | <code>false</code> | using this param you can save iframe's size (if applicable) |
|
|
190
|
-
|
|
191
|
-
**Example**
|
|
192
|
-
```js
|
|
193
|
-
SRC.hideButton();
|
|
194
|
-
```
|
|
195
|
-
<a name="SRC+showButton" id="SRC+showButton" href="#SRC+showButton"> </a>
|
|
196
|
-
|
|
197
|
-
### srC.showButton()
|
|
198
|
-
Using this method you can show the SRC button after using hideButton method
|
|
199
|
-
|
|
200
|
-
**Kind**: instance method of [<code>SRC</code>](#SRC)
|
|
201
|
-
**Example**
|
|
202
|
-
```js
|
|
203
|
-
SRC.showButton();
|
|
204
|
-
```
|
|
205
259
|
<a name="SRC+hideCheckout" id="SRC+hideCheckout" href="#SRC+hideCheckout"> </a>
|
|
206
260
|
|
|
207
|
-
###
|
|
261
|
+
### mastercardSRCClickToPay.hideCheckout([saveSize])
|
|
208
262
|
Using this method you can hide checkout after load and button click
|
|
209
263
|
|
|
210
|
-
**Kind**: instance method of [<code>
|
|
264
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
265
|
+
**Overrides**: [<code>hideCheckout</code>](#SRC+hideCheckout)
|
|
211
266
|
|
|
212
267
|
| Param | Type | Default | Description |
|
|
213
268
|
| --- | --- | --- | --- |
|
|
@@ -219,30 +274,33 @@ SRC.hideCheckout();
|
|
|
219
274
|
```
|
|
220
275
|
<a name="SRC+showCheckout" id="SRC+showCheckout" href="#SRC+showCheckout"> </a>
|
|
221
276
|
|
|
222
|
-
###
|
|
277
|
+
### mastercardSRCClickToPay.showCheckout()
|
|
223
278
|
Using this method you can show checkout after using hideCheckout method
|
|
224
279
|
|
|
225
|
-
**Kind**: instance method of [<code>
|
|
280
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
281
|
+
**Overrides**: [<code>showCheckout</code>](#SRC+showCheckout)
|
|
226
282
|
**Example**
|
|
227
283
|
```js
|
|
228
284
|
SRC.showCheckout()
|
|
229
285
|
```
|
|
230
286
|
<a name="SRC+reload" id="SRC+reload" href="#SRC+reload"> </a>
|
|
231
287
|
|
|
232
|
-
###
|
|
288
|
+
### mastercardSRCClickToPay.reload()
|
|
233
289
|
Using this method you can reload the whole checkout
|
|
234
290
|
|
|
235
|
-
**Kind**: instance method of [<code>
|
|
291
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
292
|
+
**Overrides**: [<code>reload</code>](#SRC+reload)
|
|
236
293
|
**Example**
|
|
237
294
|
```js
|
|
238
295
|
SRC.reload()
|
|
239
296
|
```
|
|
240
297
|
<a name="SRC+useAutoResize" id="SRC+useAutoResize" href="#SRC+useAutoResize"> </a>
|
|
241
298
|
|
|
242
|
-
###
|
|
299
|
+
### mastercardSRCClickToPay.useAutoResize()
|
|
243
300
|
Use this method for resize checkout iFrame according to content height, if applicable
|
|
244
301
|
|
|
245
|
-
**Kind**: instance method of [<code>
|
|
302
|
+
**Kind**: instance method of [<code>MastercardSRCClickToPay</code>](#MastercardSRCClickToPay)
|
|
303
|
+
**Overrides**: [<code>useAutoResize</code>](#SRC+useAutoResize)
|
|
246
304
|
**Example**
|
|
247
305
|
```js
|
|
248
306
|
SRC.useAutoResize();
|
|
@@ -254,12 +312,25 @@ List of available event's name in the SRC checkout lifecycle
|
|
|
254
312
|
|
|
255
313
|
**Kind**: global enum
|
|
256
314
|
|
|
257
|
-
| Param | Type | Default |
|
|
258
|
-
| --- | --- | --- |
|
|
259
|
-
|
|
|
260
|
-
|
|
|
261
|
-
|
|
|
262
|
-
|
|
|
263
|
-
| CHECKOUT_COMPLETED | <code>string</code> | <code>"checkoutCompleted"</code> |
|
|
264
|
-
| CHECKOUT_ERROR | <code>string</code> | <code>"checkoutError"</code> |
|
|
315
|
+
| Param | Type | Default | Description |
|
|
316
|
+
| --- | --- | --- | --- |
|
|
317
|
+
| IFRAME_LOADED | <code>string</code> | <code>"iframeLoaded"</code> | Initial event sent when IFrame is initially loaded. |
|
|
318
|
+
| CHECKOUT_READY | <code>string</code> | <code>"checkoutReady"</code> | Event sent when checkout is loaded and ready to be used by customer. Leverage alongside [showCheckout](#SRC+showCheckout) and [hideCheckout](#SRC+hideCheckout). |
|
|
319
|
+
| CHECKOUT_POPUP_OPEN | <code>string</code> | <code>"checkoutPopupOpen"</code> | Event sent when SRC Checkout flow is started, regardless of embedded or windowed mode. |
|
|
320
|
+
| CHECKOUT_POPUP_CLOSE | <code>string</code> | <code>"checkoutPopupClose"</code> | Event sent when SRC Checkout flow is closed, regardless of embedded or windowed mode. |
|
|
321
|
+
| CHECKOUT_COMPLETED | <code>string</code> | <code>"checkoutCompleted"</code> | Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information. |
|
|
322
|
+
| CHECKOUT_ERROR | <code>string</code> | <code>"checkoutError"</code> | Event sent on error checkout by customer. Check [data](#EventData) for more information. |
|
|
323
|
+
|
|
324
|
+
<a name="EVENT_DATA_TYPE" id="EVENT_DATA_TYPE" href="#EVENT_DATA_TYPE"> </a>
|
|
325
|
+
|
|
326
|
+
## EVENT\_DATA\_TYPE : <code>enum</code>
|
|
327
|
+
List of available event data types
|
|
328
|
+
|
|
329
|
+
**Kind**: global enum
|
|
330
|
+
|
|
331
|
+
| Param | Type | Default | Description |
|
|
332
|
+
| --- | --- | --- | --- |
|
|
333
|
+
| CRITICAL_ERROR | <code>string</code> | <code>"CriticalError"</code> | in this error scenario the checkout is understood to be in a non-recoverable state and should be closed by the merchant and give alternate payment options to the user |
|
|
334
|
+
| USER_ERROR | <code>string</code> | <code>"UserError"</code> | in this error scenario the error in likely a user input error and the checkout is in a recoverable state, so the user will be kept within the checkout and can retry the flow |
|
|
335
|
+
| SUCCESS | <code>string</code> | <code>"Success"</code> | |
|
|
265
336
|
|
|
@@ -150,6 +150,14 @@ In some situations you may want to forcibly close the checkout so that your user
|
|
|
150
150
|
button.close();
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
+
### Performing actions when the wallet button is clicked
|
|
154
|
+
|
|
155
|
+
In some situations you may want to perform some validations or actions when the user clicks on the wallet button, for which you can use this method. Currently supported by Paypal, ApplePay and GooglePay wallets.
|
|
156
|
+
|
|
157
|
+
```javascript
|
|
158
|
+
button.onClick(() => console.log("Perform actions on button click"));
|
|
159
|
+
```
|
|
160
|
+
|
|
153
161
|
### Performing actions when shipping info is updated
|
|
154
162
|
|
|
155
163
|
In Flypay, Paypal, ApplePay via MPGS and GooglePay via MPGS integrations after each shipping info update the `onUpdate(data)` will be called with the selected shipping address information, plus selected shipping method when applicable for Paypal, ApplePay and GooglePay. Merchants should handle this callback, recalculate shipping costs in their server by analyzing the new data, and submit a backend to backend request to `POST charges/:id` with the new total amount and shipping amount (you can find the documentation of this call in the PayDock API documentation).
|
|
@@ -277,30 +285,51 @@ _(Required `meta` fields: - . Optional `meta` fields: `request_shipping`, `pay_l
|
|
|
277
285
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.min.js" ></script>
|
|
278
286
|
<script>
|
|
279
287
|
let button = new paydock.WalletButtons(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
288
|
+
"#widget",
|
|
289
|
+
charge_token,
|
|
290
|
+
{
|
|
291
|
+
request_shipping: true,
|
|
292
|
+
pay_later: true,
|
|
293
|
+
standalone: false,
|
|
294
|
+
style: {
|
|
295
|
+
layout: 'horizontal',
|
|
296
|
+
color: 'blue',
|
|
297
|
+
shape: 'rect',
|
|
298
|
+
label: 'paypal',
|
|
299
|
+
},
|
|
300
|
+
}
|
|
301
|
+
);
|
|
294
302
|
button.setEnv('sandbox');
|
|
295
303
|
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
296
304
|
button.onUpdate((data) => {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
305
|
+
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
306
|
+
// call `POST charges/:id` to modify charge
|
|
307
|
+
button.update({ success: true });
|
|
308
|
+
});
|
|
301
309
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
302
310
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
303
311
|
button.onPaymentInReview((data) => console.log("The payment is on fraud review"));
|
|
312
|
+
|
|
313
|
+
// Example 1: Asynchronous onClick handler
|
|
314
|
+
const asyncLogic = async () => {
|
|
315
|
+
// Perform asynchronous logic. Expectation is that a Promise is returned and attached to response via `attachResult`,
|
|
316
|
+
// and resolve or reject of it will dictate how wallet behaves.
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
button.onClick(({ data: { attachResult } }) => {
|
|
320
|
+
// Promise is attached to the result. On Paypal, when promise is resolved, the user Journey will continue.
|
|
321
|
+
// If no promise is attached then the Paypal journey will not depend on the promise being resolved or rejected
|
|
322
|
+
attachResult(asyncLogic());
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
// Example 2: Synchronous onClick handler
|
|
326
|
+
// button.onClick(({ data: { attachResult } }) => {
|
|
327
|
+
// // Perform synchronous logic
|
|
328
|
+
// console.log("Synchronous onClick: Button clicked");
|
|
329
|
+
// // Optionally return a boolean flag to halt the operation
|
|
330
|
+
// attachResult(false);
|
|
331
|
+
// });
|
|
332
|
+
|
|
304
333
|
button.load();
|
|
305
334
|
</script>
|
|
306
335
|
</html>
|
|
@@ -434,6 +463,7 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
434
463
|
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
435
464
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
436
465
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
466
|
+
button.onClick(() => console.log("On WalletButton Click"));
|
|
437
467
|
button.onUpdate((data) => {
|
|
438
468
|
console.log("Updating amount via a backend to backend call to POST charges/:id");
|
|
439
469
|
// call `POST charges/:id` to modify charge
|
|
@@ -466,7 +496,6 @@ _(Required `meta` fields: `amount_label`, `country`. Optional `meta` fields: `ra
|
|
|
466
496
|
Also, for **ApplePay via MPGS** you can initialize the `ApplePayPaymentRequest` with your own values instead of using the default ones. Below you can see an example on how to initialize the `ApplePayPaymentRequest` with the `raw_data_initialization` meta field.
|
|
467
497
|
|
|
468
498
|
Similarly, for **GooglePay via MPGS** you can initialize the `PaymentMethodSpecification` with your own values instead of using the default ones. Below you can see an example on how to initialize the `PaymentMethodSpecification` with the `raw_data_initialization` meta field.
|
|
469
|
-
|
|
470
499
|
### ApplePay and GooglePay via MPGS Raw data initialization example
|
|
471
500
|
|
|
472
501
|
```html
|