@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
package/docs/api-widget.md
CHANGED
|
@@ -51,6 +51,12 @@
|
|
|
51
51
|
<dt><a href="#user-content-w_STYLABLE_ELEMENT_STATE">STYLABLE_ELEMENT_STATE</a> : <code>object</code></dt>
|
|
52
52
|
<dd><p>Current constant include available states of element for styling</p>
|
|
53
53
|
</dd>
|
|
54
|
+
<dt><a href="#user-content-w_CARD_VALIDATORS">CARD_VALIDATORS</a> : <code>Record.<string, string></code></dt>
|
|
55
|
+
<dd><p>List of available form field validators dedicated to cards and their definition</p>
|
|
56
|
+
</dd>
|
|
57
|
+
<dt><a href="#user-content-w_GENERIC_VALIDATORS">GENERIC_VALIDATORS</a> : <code>Record.<string, string></code></dt>
|
|
58
|
+
<dd><p>List of available generic form field validators and their definition</p>
|
|
59
|
+
</dd>
|
|
54
60
|
<dt><a href="#user-content-w_TRIGGER">TRIGGER</a> : <code>object</code></dt>
|
|
55
61
|
<dd><p>List of available triggers</p>
|
|
56
62
|
</dd>
|
|
@@ -63,7 +69,8 @@
|
|
|
63
69
|
<dd><p>Interface of data from validation event.</p>
|
|
64
70
|
</dd>
|
|
65
71
|
<dt><a href="#user-content-w_IEventMetaData">IEventMetaData</a></dt>
|
|
66
|
-
<dd><p>
|
|
72
|
+
<dd><p>Contains basic information associated with the event and additional meta data
|
|
73
|
+
specific to the event. E.g., card info, gateway info, etc.</p>
|
|
67
74
|
</dd>
|
|
68
75
|
<dt><a href="#user-content-w_IEventAfterLoadData">IEventAfterLoadData</a></dt>
|
|
69
76
|
<dd><p>Interface of data from event.</p>
|
|
@@ -112,33 +119,34 @@ Interface of data from validation event.
|
|
|
112
119
|
|
|
113
120
|
| Param | Type | Description |
|
|
114
121
|
| --- | --- | --- |
|
|
115
|
-
| event | <code>string</code> |
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
| [ref_id] | <code>string</code> | Custom value
|
|
119
|
-
| [form_valid] | <code>boolean</code> |
|
|
120
|
-
| [invalid_fields] | <code>
|
|
121
|
-
| [invalid_showed_fields] | <code>
|
|
122
|
-
| [validators] | <code>
|
|
122
|
+
| event | <code>string</code> | The name of the event. |
|
|
123
|
+
| message_source | <code>string</code> | A system variable that identifies the event source. |
|
|
124
|
+
| purpose | <code>string</code> | A system variable that states the purpose of the event. |
|
|
125
|
+
| [ref_id] | <code>string</code> | Custom unique value that identifies result of processed operation. |
|
|
126
|
+
| [form_valid] | <code>boolean</code> | Indicates wether or not the form is valid. |
|
|
127
|
+
| [invalid_fields] | <code>Array.<string></code> | Names of form fields with invalid data. |
|
|
128
|
+
| [invalid_showed_fields] | <code>Array.<string></code> | Names of invalid form fields which are already displaying the error. |
|
|
129
|
+
| [validators] | <code>Partial.<Record.<(CardValidatorValue\|GenericValidatorValue), Array.<string>>></code> | Object containing validator identifiers as keys and the fields subject to that validator as an array of form field names. See list of available [Generic Vallidators](#user-content-w_GENERIC_VALIDATORS) and [Card Validators](#user-content-w_CARD_VALIDATORS), |
|
|
123
130
|
|
|
124
131
|
<a name="w_IEventMetaData" id="w_IEventMetaData" href="#user-content-w_IEventMetaData"> </a>
|
|
125
132
|
|
|
126
133
|
## IEventMetaData
|
|
127
|
-
|
|
134
|
+
Contains basic information associated with the event and additional meta data
|
|
135
|
+
specific to the event. E.g., card info, gateway info, etc.
|
|
128
136
|
|
|
129
137
|
**Kind**: global interface
|
|
130
138
|
|
|
131
139
|
| Param | Type | Description |
|
|
132
140
|
| --- | --- | --- |
|
|
133
|
-
| event | <code>string</code> |
|
|
134
|
-
| purpose | <code>string</code> |
|
|
135
|
-
| message_source | <code>string</code> |
|
|
136
|
-
| [ref_id] | <code>string</code> | Custom value
|
|
141
|
+
| event | <code>string</code> | The name of the event. |
|
|
142
|
+
| purpose | <code>string</code> | A system variable that states the purpose of the event. |
|
|
143
|
+
| message_source | <code>string</code> | A system variable that identifies the event source. |
|
|
144
|
+
| [ref_id] | <code>string</code> | Custom unique value that identifies result of processed operation. |
|
|
137
145
|
| configuration_token | <code>string</code> | Token received from our API with widget data |
|
|
138
146
|
| type | <code>string</code> | Payment type 'card', 'bank_account' |
|
|
139
147
|
| gateway_type | <code>string</code> | Gateway type |
|
|
140
148
|
| [card_number_last4] | <code>string</code> | Last 4 digit of your card |
|
|
141
|
-
| [card_scheme] | <code>string</code> | Card scheme |
|
|
149
|
+
| [card_scheme] | <code>string</code> | Card scheme, e.g., (Visa, Mastercard and American Express (AmEx)) |
|
|
142
150
|
| [card_number_length] | <code>number</code> | Card number length |
|
|
143
151
|
| [account_name] | <code>string</code> | Bank account account name |
|
|
144
152
|
| [account_number] | <code>string</code> | Bank account account number |
|
|
@@ -152,10 +160,10 @@ Interface of data from event.
|
|
|
152
160
|
|
|
153
161
|
| Param | Type | Description |
|
|
154
162
|
| --- | --- | --- |
|
|
155
|
-
| event | <code>string</code> |
|
|
156
|
-
| purpose | <code>string</code> |
|
|
157
|
-
| message_source | <code>string</code> |
|
|
158
|
-
| [ref_id] | <code>string</code> | Custom value
|
|
163
|
+
| event | <code>string</code> | The name of the event. |
|
|
164
|
+
| purpose | <code>string</code> | A system variable that states the purpose of the event. |
|
|
165
|
+
| message_source | <code>string</code> | A system variable that identifies the event source. |
|
|
166
|
+
| [ref_id] | <code>string</code> | Custom unique value that identifies result of processed operation. |
|
|
159
167
|
|
|
160
168
|
<a name="w_IEventFinishData" id="w_IEventFinishData" href="#user-content-w_IEventFinishData"> </a>
|
|
161
169
|
|
|
@@ -166,10 +174,10 @@ Interface of data from event.
|
|
|
166
174
|
|
|
167
175
|
| Param | Type | Description |
|
|
168
176
|
| --- | --- | --- |
|
|
169
|
-
| event | <code>string</code> |
|
|
170
|
-
| purpose | <code>string</code> |
|
|
171
|
-
| message_source | <code>string</code> |
|
|
172
|
-
| [ref_id] | <code>string</code> | Custom value
|
|
177
|
+
| event | <code>string</code> | The name of the event. |
|
|
178
|
+
| purpose | <code>string</code> | A system variable that states the purpose of the event. |
|
|
179
|
+
| message_source | <code>string</code> | A system variable that identifies the event source. |
|
|
180
|
+
| [ref_id] | <code>string</code> | Custom unique value that identifies result of processed operation. |
|
|
173
181
|
| payment_source | <code>string</code> | One time token. Result from this endpoint [API docs](https://docs.paydock.com/#tokens) |
|
|
174
182
|
|
|
175
183
|
<a name="w_IPayPalMeta" id="w_IPayPalMeta" href="#user-content-w_IPayPalMeta"> </a>
|
|
@@ -383,7 +391,7 @@ Class Widget include method for working on html and include extended by HtmlMult
|
|
|
383
391
|
* [.setFormElements(elements)](#user-content-w_HtmlWidget+setFormElements)
|
|
384
392
|
* [.setMeta(object)](#user-content-w_HtmlWidget+setMeta)
|
|
385
393
|
* [.load()](#user-content-w_HtmlMultiWidget+load)
|
|
386
|
-
* [.
|
|
394
|
+
* [.afterLoad()](#user-content-w_HtmlMultiWidget+afterLoad)
|
|
387
395
|
* [.trigger(triggers, data)](#user-content-w_HtmlMultiWidget+trigger)
|
|
388
396
|
* [.getValidationState()](#user-content-w_HtmlMultiWidget+getValidationState) ⇒ [<code>IFormValidation</code>](#user-content-w_IFormValidation)
|
|
389
397
|
* [.isValidForm()](#user-content-w_HtmlMultiWidget+isValidForm) ⇒ <code>boolean</code>
|
|
@@ -396,6 +404,7 @@ Class Widget include method for working on html and include extended by HtmlMult
|
|
|
396
404
|
* [.hideElements(elements)](#user-content-w_HtmlMultiWidget+hideElements)
|
|
397
405
|
* [.showElements(elements)](#user-content-w_HtmlMultiWidget+showElements)
|
|
398
406
|
* [.updateFormValues(fieldValues)](#user-content-w_HtmlMultiWidget+updateFormValues)
|
|
407
|
+
* [.updateFormValue(key, value)](#user-content-w_HtmlMultiWidget+updateFormValue)
|
|
399
408
|
* [.onFinishInsert(selector, dataType)](#user-content-w_HtmlMultiWidget+onFinishInsert)
|
|
400
409
|
* [.interceptSubmitForm(selector)](#user-content-w_HtmlMultiWidget+interceptSubmitForm)
|
|
401
410
|
* [.useCheckoutAutoSubmit()](#user-content-w_HtmlMultiWidget+useCheckoutAutoSubmit)
|
|
@@ -560,51 +569,38 @@ config.setMeta({
|
|
|
560
569
|
<a name="w_HtmlMultiWidget+load" id="w_HtmlMultiWidget+load" href="#user-content-w_HtmlMultiWidget+load"> </a>
|
|
561
570
|
|
|
562
571
|
### htmlWidget.load()
|
|
563
|
-
|
|
572
|
+
Loads the widget.
|
|
573
|
+
|
|
574
|
+
Calling this method results in an iframe element being inserted and rendered in the DOM.
|
|
564
575
|
|
|
565
576
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
566
577
|
**Overrides**: [<code>load</code>](#user-content-w_HtmlMultiWidget+load)
|
|
567
|
-
<a name="w_HtmlMultiWidget+
|
|
578
|
+
<a name="w_HtmlMultiWidget+afterLoad" id="w_HtmlMultiWidget+afterLoad" href="#user-content-w_HtmlMultiWidget+afterLoad"> </a>
|
|
568
579
|
|
|
569
|
-
### htmlWidget.
|
|
570
|
-
|
|
580
|
+
### htmlWidget.afterLoad()
|
|
581
|
+
Registers a form validation callback for validation events.
|
|
571
582
|
|
|
572
583
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
573
|
-
**Overrides**: [<code>
|
|
574
|
-
|
|
575
|
-
| Param | Type | Description |
|
|
576
|
-
| --- | --- | --- |
|
|
577
|
-
| eventName | <code>string</code> | Available event names [EVENT](#user-content-w_EVENT) |
|
|
578
|
-
| [cb] | <code>listener</code> | |
|
|
579
|
-
|
|
580
|
-
**Example**
|
|
581
|
-
|
|
582
|
-
```javascript
|
|
583
|
-
widget.on('form_submit', function (data) {
|
|
584
|
-
console.log(data);
|
|
585
|
-
});
|
|
586
|
-
// or
|
|
587
|
-
widget.on('form_submit').then(function (data) {
|
|
588
|
-
console.log(data);
|
|
589
|
-
});
|
|
590
|
-
```
|
|
584
|
+
**Overrides**: [<code>afterLoad</code>](#user-content-w_HtmlMultiWidget+afterLoad)
|
|
591
585
|
<a name="w_HtmlMultiWidget+trigger" id="w_HtmlMultiWidget+trigger" href="#user-content-w_HtmlMultiWidget+trigger"> </a>
|
|
592
586
|
|
|
593
587
|
### htmlWidget.trigger(triggers, data)
|
|
594
|
-
|
|
588
|
+
Registers callback that will be invoked for every trigger.
|
|
595
589
|
|
|
596
590
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
597
591
|
**Overrides**: [<code>trigger</code>](#user-content-w_HtmlMultiWidget+trigger)
|
|
598
592
|
|
|
599
593
|
| Param | Type | Description |
|
|
600
594
|
| --- | --- | --- |
|
|
601
|
-
| triggers | <code>
|
|
602
|
-
| data | [<code>ITriggerData</code>](#user-content-w_ITriggerData) |
|
|
595
|
+
| triggers | <code>'submit\_form'</code> \| <code>'tab'</code> | The Widget element identifier that caused the trigger. |
|
|
596
|
+
| data | [<code>ITriggerData</code>](#user-content-w_ITriggerData) | Data that will be sent to the widget when the trigger occurs. |
|
|
603
597
|
|
|
604
598
|
<a name="w_HtmlMultiWidget+getValidationState" id="w_HtmlMultiWidget+getValidationState" href="#user-content-w_HtmlMultiWidget+getValidationState"> </a>
|
|
605
599
|
|
|
606
600
|
### htmlWidget.getValidationState() ⇒ [<code>IFormValidation</code>](#user-content-w_IFormValidation)
|
|
607
|
-
|
|
601
|
+
Gets a reference to the form current validation state.
|
|
602
|
+
|
|
603
|
+
!Warning: do not directly modify the values of the returned object.
|
|
608
604
|
|
|
609
605
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
610
606
|
**Overrides**: [<code>getValidationState</code>](#user-content-w_HtmlMultiWidget+getValidationState)
|
|
@@ -612,11 +608,13 @@ Using this method you can get validation state information
|
|
|
612
608
|
<a name="w_HtmlMultiWidget+isValidForm" id="w_HtmlMultiWidget+isValidForm" href="#user-content-w_HtmlMultiWidget+isValidForm"> </a>
|
|
613
609
|
|
|
614
610
|
### htmlWidget.isValidForm() ⇒ <code>boolean</code>
|
|
615
|
-
|
|
611
|
+
Checks if a given form is valid.
|
|
612
|
+
|
|
613
|
+
A form is valid if all form fields are valid.
|
|
616
614
|
|
|
617
615
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
618
616
|
**Overrides**: [<code>isValidForm</code>](#user-content-w_HtmlMultiWidget+isValidForm)
|
|
619
|
-
**Returns**: <code>boolean</code> -
|
|
617
|
+
**Returns**: <code>boolean</code> - Indicates wether or not form is valid.
|
|
620
618
|
<a name="w_HtmlMultiWidget+isInvalidField" id="w_HtmlMultiWidget+isInvalidField" href="#user-content-w_HtmlMultiWidget+isInvalidField"> </a>
|
|
621
619
|
|
|
622
620
|
### htmlWidget.isInvalidField(field) ⇒ <code>boolean</code>
|
|
@@ -633,92 +631,96 @@ Using this method you can check if a specific form field is invalid
|
|
|
633
631
|
<a name="w_HtmlMultiWidget+isFieldErrorShowed" id="w_HtmlMultiWidget+isFieldErrorShowed" href="#user-content-w_HtmlMultiWidget+isFieldErrorShowed"> </a>
|
|
634
632
|
|
|
635
633
|
### htmlWidget.isFieldErrorShowed(field) ⇒ <code>boolean</code>
|
|
636
|
-
|
|
634
|
+
Checks if a given form field is displaying an error.
|
|
637
635
|
|
|
638
636
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
639
637
|
**Overrides**: [<code>isFieldErrorShowed</code>](#user-content-w_HtmlMultiWidget+isFieldErrorShowed)
|
|
640
|
-
**Returns**: <code>boolean</code> - Error is
|
|
638
|
+
**Returns**: <code>boolean</code> - Indicates wether or not the Error message is being displayed on the associated field.
|
|
641
639
|
|
|
642
640
|
| Param | Type | Description |
|
|
643
641
|
| --- | --- | --- |
|
|
644
|
-
| field | <code>string</code> |
|
|
642
|
+
| field | <code>string</code> | The form field name |
|
|
645
643
|
|
|
646
644
|
<a name="w_HtmlMultiWidget+isInvalidFieldByValidator" id="w_HtmlMultiWidget+isInvalidFieldByValidator" href="#user-content-w_HtmlMultiWidget+isInvalidFieldByValidator"> </a>
|
|
647
645
|
|
|
648
646
|
### htmlWidget.isInvalidFieldByValidator(field, validator) ⇒ <code>boolean</code>
|
|
649
|
-
|
|
647
|
+
Checks if a given form field is valid or invalid by name.
|
|
650
648
|
|
|
651
649
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
652
650
|
**Overrides**: [<code>isInvalidFieldByValidator</code>](#user-content-w_HtmlMultiWidget+isInvalidFieldByValidator)
|
|
653
|
-
**Returns**: <code>boolean</code> -
|
|
651
|
+
**Returns**: <code>boolean</code> - Indicates wether or not the field is invalid based on validator intepretation.
|
|
654
652
|
|
|
655
653
|
| Param | Type | Description |
|
|
656
654
|
| --- | --- | --- |
|
|
657
|
-
| field | <code>string</code> |
|
|
658
|
-
| validator |
|
|
655
|
+
| field | <code>string</code> | The form field name |
|
|
656
|
+
| validator | | The name of the validator. |
|
|
659
657
|
|
|
660
658
|
<a name="w_HtmlMultiWidget+hide" id="w_HtmlMultiWidget+hide" href="#user-content-w_HtmlMultiWidget+hide"> </a>
|
|
661
659
|
|
|
662
660
|
### htmlWidget.hide([saveSize])
|
|
663
|
-
|
|
661
|
+
Hides the widget.
|
|
662
|
+
|
|
663
|
+
E.g., use this method to hide the widget after it loads.
|
|
664
664
|
|
|
665
665
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
666
666
|
**Overrides**: [<code>hide</code>](#user-content-w_HtmlMultiWidget+hide)
|
|
667
667
|
|
|
668
668
|
| Param | Type | Default | Description |
|
|
669
669
|
| --- | --- | --- | --- |
|
|
670
|
-
| [saveSize] | <code>boolean</code> | <code>false</code> |
|
|
670
|
+
| [saveSize] | <code>boolean</code> | <code>false</code> | Wether the original iframe element size should be saved before being hidden. |
|
|
671
671
|
|
|
672
672
|
<a name="w_HtmlMultiWidget+show" id="w_HtmlMultiWidget+show" href="#user-content-w_HtmlMultiWidget+show"> </a>
|
|
673
673
|
|
|
674
674
|
### htmlWidget.show()
|
|
675
|
-
|
|
675
|
+
Shows the widget.
|
|
676
|
+
|
|
677
|
+
E.g., use this method to show the widget after it was explicitly hidden.
|
|
676
678
|
|
|
677
679
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
678
680
|
**Overrides**: [<code>show</code>](#user-content-w_HtmlMultiWidget+show)
|
|
679
681
|
<a name="w_HtmlMultiWidget+reload" id="w_HtmlMultiWidget+reload" href="#user-content-w_HtmlMultiWidget+reload"> </a>
|
|
680
682
|
|
|
681
683
|
### htmlWidget.reload()
|
|
682
|
-
|
|
684
|
+
Reloads the widget.
|
|
683
685
|
|
|
684
686
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
685
687
|
**Overrides**: [<code>reload</code>](#user-content-w_HtmlMultiWidget+reload)
|
|
686
688
|
<a name="w_HtmlMultiWidget+hideElements" id="w_HtmlMultiWidget+hideElements" href="#user-content-w_HtmlMultiWidget+hideElements"> </a>
|
|
687
689
|
|
|
688
690
|
### htmlWidget.hideElements(elements)
|
|
689
|
-
|
|
691
|
+
Hides the specified Widget elements by their identifier.
|
|
690
692
|
|
|
691
693
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
692
694
|
**Overrides**: [<code>hideElements</code>](#user-content-w_HtmlMultiWidget+hideElements)
|
|
693
695
|
|
|
694
696
|
| Param | Type | Description |
|
|
695
697
|
| --- | --- | --- |
|
|
696
|
-
| elements | <code>Array.<string></code> |
|
|
698
|
+
| elements | <code>Array.<string></code> | List of element which can be hidden [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
697
699
|
|
|
698
700
|
**Example**
|
|
699
|
-
|
|
700
701
|
```javascript
|
|
701
702
|
widget.hideElements(['submit_button', 'email']);
|
|
702
703
|
```
|
|
703
704
|
<a name="w_HtmlMultiWidget+showElements" id="w_HtmlMultiWidget+showElements" href="#user-content-w_HtmlMultiWidget+showElements"> </a>
|
|
704
705
|
|
|
705
706
|
### htmlWidget.showElements(elements)
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
* @example
|
|
709
|
-
widget.showElements(['submit_button', 'email']);
|
|
707
|
+
Shows the specified Widget elements by their identifier.
|
|
710
708
|
|
|
711
709
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
712
710
|
**Overrides**: [<code>showElements</code>](#user-content-w_HtmlMultiWidget+showElements)
|
|
713
711
|
|
|
714
712
|
| Param | Type | Description |
|
|
715
713
|
| --- | --- | --- |
|
|
716
|
-
| elements | <code>Array.<string></code> |
|
|
714
|
+
| elements | <code>Array.<string></code> | List of elements which can be showed [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
717
715
|
|
|
716
|
+
**Example**
|
|
717
|
+
```javascript
|
|
718
|
+
widget.showElements(['submit_button', 'email']);
|
|
719
|
+
```
|
|
718
720
|
<a name="w_HtmlMultiWidget+updateFormValues" id="w_HtmlMultiWidget+updateFormValues" href="#user-content-w_HtmlMultiWidget+updateFormValues"> </a>
|
|
719
721
|
|
|
720
722
|
### htmlWidget.updateFormValues(fieldValues)
|
|
721
|
-
|
|
723
|
+
Updates the form field values inside the widget.
|
|
722
724
|
|
|
723
725
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
724
726
|
**Overrides**: [<code>updateFormValues</code>](#user-content-w_HtmlMultiWidget+updateFormValues)
|
|
@@ -728,53 +730,71 @@ Method for update values for form fields inside the widget
|
|
|
728
730
|
| fieldValues | <code>IFormValues</code> | Fields with values |
|
|
729
731
|
|
|
730
732
|
**Example**
|
|
731
|
-
|
|
732
733
|
```javascript
|
|
733
734
|
widget.updateFormValues({
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
735
|
+
email: 'predefined@email.com',
|
|
736
|
+
card_name: 'Houston'
|
|
737
|
+
});
|
|
738
|
+
```
|
|
739
|
+
<a name="w_HtmlMultiWidget+updateFormValue" id="w_HtmlMultiWidget+updateFormValue" href="#user-content-w_HtmlMultiWidget+updateFormValue"> </a>
|
|
740
|
+
|
|
741
|
+
### htmlWidget.updateFormValue(key, value)
|
|
742
|
+
Updates a single form field values inside the widget by the form field name.
|
|
743
|
+
|
|
744
|
+
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
745
|
+
**Overrides**: [<code>updateFormValue</code>](#user-content-w_HtmlMultiWidget+updateFormValue)
|
|
746
|
+
|
|
747
|
+
| Param | Type | Description |
|
|
748
|
+
| --- | --- | --- |
|
|
749
|
+
| key | <code>string</code> | The form field name |
|
|
750
|
+
| value | <code>string</code> | The form field value |
|
|
751
|
+
|
|
752
|
+
**Example**
|
|
753
|
+
```javascript
|
|
754
|
+
widget.updateFormValue("card_name", "John Doe");
|
|
737
755
|
```
|
|
738
756
|
<a name="w_HtmlMultiWidget+onFinishInsert" id="w_HtmlMultiWidget+onFinishInsert" href="#user-content-w_HtmlMultiWidget+onFinishInsert"> </a>
|
|
739
757
|
|
|
740
758
|
### htmlWidget.onFinishInsert(selector, dataType)
|
|
741
|
-
|
|
759
|
+
Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
|
|
742
760
|
|
|
743
761
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
744
762
|
**Overrides**: [<code>onFinishInsert</code>](#user-content-w_HtmlMultiWidget+onFinishInsert)
|
|
745
763
|
|
|
746
764
|
| Param | Type | Description |
|
|
747
765
|
| --- | --- | --- |
|
|
748
|
-
| selector | <code>string</code> |
|
|
749
|
-
| dataType | <code>string</code> | data type of IEventData object. |
|
|
766
|
+
| selector | <code>string</code> | A CSS selector. E.g., ".my-class", "#my-id", or others |
|
|
767
|
+
| dataType | <code>string</code> | The data type of IEventData object. |
|
|
750
768
|
|
|
751
769
|
<a name="w_HtmlMultiWidget+interceptSubmitForm" id="w_HtmlMultiWidget+interceptSubmitForm" href="#user-content-w_HtmlMultiWidget+interceptSubmitForm"> </a>
|
|
752
770
|
|
|
753
771
|
### htmlWidget.interceptSubmitForm(selector)
|
|
754
|
-
|
|
772
|
+
Intercepts a form submission and delegates processing to the widget.
|
|
755
773
|
|
|
756
|
-
|
|
774
|
+
An simplified example of the process:
|
|
775
|
+
- User clicks submit button in your form
|
|
776
|
+
- This implicitly triggers a submission to the widget
|
|
777
|
+
- The widget submits your form
|
|
757
778
|
|
|
758
779
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
759
780
|
**Overrides**: [<code>interceptSubmitForm</code>](#user-content-w_HtmlMultiWidget+interceptSubmitForm)
|
|
760
|
-
**Note**: submit button
|
|
781
|
+
**Note**: The widget's submit button will be hidden.
|
|
761
782
|
|
|
762
783
|
| Param | Type | Description |
|
|
763
784
|
| --- | --- | --- |
|
|
764
785
|
| selector | <code>string</code> | css selector of your form |
|
|
765
786
|
|
|
766
787
|
**Example**
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
<form id="myForm">
|
|
788
|
+
```html
|
|
789
|
+
<body>
|
|
790
|
+
<form id="myForm">
|
|
770
791
|
<input name="amount">
|
|
771
792
|
<button type="submit">Submit</button>
|
|
772
793
|
</form>
|
|
773
|
-
|
|
774
|
-
-->
|
|
775
|
-
<script>
|
|
794
|
+
<script>
|
|
776
795
|
widget.interceptSubmitForm('#myForm');
|
|
777
|
-
</script>
|
|
796
|
+
</script>
|
|
797
|
+
</body>
|
|
778
798
|
```
|
|
779
799
|
<a name="w_HtmlMultiWidget+useCheckoutAutoSubmit" id="w_HtmlMultiWidget+useCheckoutAutoSubmit" href="#user-content-w_HtmlMultiWidget+useCheckoutAutoSubmit"> </a>
|
|
780
800
|
|
|
@@ -791,7 +811,6 @@ Use this method for resize iFrame according content height
|
|
|
791
811
|
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
792
812
|
**Overrides**: [<code>useAutoResize</code>](#user-content-w_HtmlMultiWidget+useAutoResize)
|
|
793
813
|
**Example**
|
|
794
|
-
|
|
795
814
|
```javascript
|
|
796
815
|
widget.useAutoResize();
|
|
797
816
|
```
|
|
@@ -1096,7 +1115,7 @@ Class HtmlMultiWidget include method for working with html
|
|
|
1096
1115
|
* [HtmlMultiWidget](#user-content-w_HtmlMultiWidget) ⇐ [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
1097
1116
|
* [new HtmlMultiWidget(selector, publicKey, conf)](#user-content-w_new_HtmlMultiWidget_new)
|
|
1098
1117
|
* [.load()](#user-content-w_HtmlMultiWidget+load)
|
|
1099
|
-
* [.
|
|
1118
|
+
* [.afterLoad()](#user-content-w_HtmlMultiWidget+afterLoad)
|
|
1100
1119
|
* [.trigger(triggers, data)](#user-content-w_HtmlMultiWidget+trigger)
|
|
1101
1120
|
* [.getValidationState()](#user-content-w_HtmlMultiWidget+getValidationState) ⇒ [<code>IFormValidation</code>](#user-content-w_IFormValidation)
|
|
1102
1121
|
* [.isValidForm()](#user-content-w_HtmlMultiWidget+isValidForm) ⇒ <code>boolean</code>
|
|
@@ -1109,6 +1128,7 @@ Class HtmlMultiWidget include method for working with html
|
|
|
1109
1128
|
* [.hideElements(elements)](#user-content-w_HtmlMultiWidget+hideElements)
|
|
1110
1129
|
* [.showElements(elements)](#user-content-w_HtmlMultiWidget+showElements)
|
|
1111
1130
|
* [.updateFormValues(fieldValues)](#user-content-w_HtmlMultiWidget+updateFormValues)
|
|
1131
|
+
* [.updateFormValue(key, value)](#user-content-w_HtmlMultiWidget+updateFormValue)
|
|
1112
1132
|
* [.onFinishInsert(selector, dataType)](#user-content-w_HtmlMultiWidget+onFinishInsert)
|
|
1113
1133
|
* [.interceptSubmitForm(selector)](#user-content-w_HtmlMultiWidget+interceptSubmitForm)
|
|
1114
1134
|
* [.useCheckoutAutoSubmit()](#user-content-w_HtmlMultiWidget+useCheckoutAutoSubmit)
|
|
@@ -1159,58 +1179,47 @@ var widget = new MultiWidget('#widget', 'publicKey',[ With Configurations
|
|
|
1159
1179
|
<a name="w_HtmlMultiWidget+load" id="w_HtmlMultiWidget+load" href="#user-content-w_HtmlMultiWidget+load"> </a>
|
|
1160
1180
|
|
|
1161
1181
|
### htmlMultiWidget.load()
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1165
|
-
<a name="w_HtmlMultiWidget+on" id="w_HtmlMultiWidget+on" href="#user-content-w_HtmlMultiWidget+on"> </a>
|
|
1182
|
+
Loads the widget.
|
|
1166
1183
|
|
|
1167
|
-
|
|
1168
|
-
Listen to events of widget
|
|
1184
|
+
Calling this method results in an iframe element being inserted and rendered in the DOM.
|
|
1169
1185
|
|
|
1170
1186
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1187
|
+
<a name="w_HtmlMultiWidget+afterLoad" id="w_HtmlMultiWidget+afterLoad" href="#user-content-w_HtmlMultiWidget+afterLoad"> </a>
|
|
1171
1188
|
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
| eventName | <code>string</code> | Available event names [EVENT](#user-content-w_EVENT) |
|
|
1175
|
-
| [cb] | <code>listener</code> | |
|
|
1176
|
-
|
|
1177
|
-
**Example**
|
|
1189
|
+
### htmlMultiWidget.afterLoad()
|
|
1190
|
+
Registers a form validation callback for validation events.
|
|
1178
1191
|
|
|
1179
|
-
|
|
1180
|
-
widget.on('form_submit', function (data) {
|
|
1181
|
-
console.log(data);
|
|
1182
|
-
});
|
|
1183
|
-
// or
|
|
1184
|
-
widget.on('form_submit').then(function (data) {
|
|
1185
|
-
console.log(data);
|
|
1186
|
-
});
|
|
1187
|
-
```
|
|
1192
|
+
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1188
1193
|
<a name="w_HtmlMultiWidget+trigger" id="w_HtmlMultiWidget+trigger" href="#user-content-w_HtmlMultiWidget+trigger"> </a>
|
|
1189
1194
|
|
|
1190
1195
|
### htmlMultiWidget.trigger(triggers, data)
|
|
1191
|
-
|
|
1196
|
+
Registers callback that will be invoked for every trigger.
|
|
1192
1197
|
|
|
1193
1198
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1194
1199
|
|
|
1195
1200
|
| Param | Type | Description |
|
|
1196
1201
|
| --- | --- | --- |
|
|
1197
|
-
| triggers | <code>
|
|
1198
|
-
| data | [<code>ITriggerData</code>](#user-content-w_ITriggerData) |
|
|
1202
|
+
| triggers | <code>'submit\_form'</code> \| <code>'tab'</code> | The Widget element identifier that caused the trigger. |
|
|
1203
|
+
| data | [<code>ITriggerData</code>](#user-content-w_ITriggerData) | Data that will be sent to the widget when the trigger occurs. |
|
|
1199
1204
|
|
|
1200
1205
|
<a name="w_HtmlMultiWidget+getValidationState" id="w_HtmlMultiWidget+getValidationState" href="#user-content-w_HtmlMultiWidget+getValidationState"> </a>
|
|
1201
1206
|
|
|
1202
1207
|
### htmlMultiWidget.getValidationState() ⇒ [<code>IFormValidation</code>](#user-content-w_IFormValidation)
|
|
1203
|
-
|
|
1208
|
+
Gets a reference to the form current validation state.
|
|
1209
|
+
|
|
1210
|
+
!Warning: do not directly modify the values of the returned object.
|
|
1204
1211
|
|
|
1205
1212
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1206
1213
|
**Returns**: [<code>IFormValidation</code>](#user-content-w_IFormValidation) - Form validation object
|
|
1207
1214
|
<a name="w_HtmlMultiWidget+isValidForm" id="w_HtmlMultiWidget+isValidForm" href="#user-content-w_HtmlMultiWidget+isValidForm"> </a>
|
|
1208
1215
|
|
|
1209
1216
|
### htmlMultiWidget.isValidForm() ⇒ <code>boolean</code>
|
|
1210
|
-
|
|
1217
|
+
Checks if a given form is valid.
|
|
1218
|
+
|
|
1219
|
+
A form is valid if all form fields are valid.
|
|
1211
1220
|
|
|
1212
1221
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1213
|
-
**Returns**: <code>boolean</code> -
|
|
1222
|
+
**Returns**: <code>boolean</code> - Indicates wether or not form is valid.
|
|
1214
1223
|
<a name="w_HtmlMultiWidget+isInvalidField" id="w_HtmlMultiWidget+isInvalidField" href="#user-content-w_HtmlMultiWidget+isInvalidField"> </a>
|
|
1215
1224
|
|
|
1216
1225
|
### htmlMultiWidget.isInvalidField(field) ⇒ <code>boolean</code>
|
|
@@ -1226,85 +1235,89 @@ Using this method you can check if a specific form field is invalid
|
|
|
1226
1235
|
<a name="w_HtmlMultiWidget+isFieldErrorShowed" id="w_HtmlMultiWidget+isFieldErrorShowed" href="#user-content-w_HtmlMultiWidget+isFieldErrorShowed"> </a>
|
|
1227
1236
|
|
|
1228
1237
|
### htmlMultiWidget.isFieldErrorShowed(field) ⇒ <code>boolean</code>
|
|
1229
|
-
|
|
1238
|
+
Checks if a given form field is displaying an error.
|
|
1230
1239
|
|
|
1231
1240
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1232
|
-
**Returns**: <code>boolean</code> - Error is
|
|
1241
|
+
**Returns**: <code>boolean</code> - Indicates wether or not the Error message is being displayed on the associated field.
|
|
1233
1242
|
|
|
1234
1243
|
| Param | Type | Description |
|
|
1235
1244
|
| --- | --- | --- |
|
|
1236
|
-
| field | <code>string</code> |
|
|
1245
|
+
| field | <code>string</code> | The form field name |
|
|
1237
1246
|
|
|
1238
1247
|
<a name="w_HtmlMultiWidget+isInvalidFieldByValidator" id="w_HtmlMultiWidget+isInvalidFieldByValidator" href="#user-content-w_HtmlMultiWidget+isInvalidFieldByValidator"> </a>
|
|
1239
1248
|
|
|
1240
1249
|
### htmlMultiWidget.isInvalidFieldByValidator(field, validator) ⇒ <code>boolean</code>
|
|
1241
|
-
|
|
1250
|
+
Checks if a given form field is valid or invalid by name.
|
|
1242
1251
|
|
|
1243
1252
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1244
|
-
**Returns**: <code>boolean</code> -
|
|
1253
|
+
**Returns**: <code>boolean</code> - Indicates wether or not the field is invalid based on validator intepretation.
|
|
1245
1254
|
|
|
1246
1255
|
| Param | Type | Description |
|
|
1247
1256
|
| --- | --- | --- |
|
|
1248
|
-
| field | <code>string</code> |
|
|
1249
|
-
| validator |
|
|
1257
|
+
| field | <code>string</code> | The form field name |
|
|
1258
|
+
| validator | | The name of the validator. |
|
|
1250
1259
|
|
|
1251
1260
|
<a name="w_HtmlMultiWidget+hide" id="w_HtmlMultiWidget+hide" href="#user-content-w_HtmlMultiWidget+hide"> </a>
|
|
1252
1261
|
|
|
1253
1262
|
### htmlMultiWidget.hide([saveSize])
|
|
1254
|
-
|
|
1263
|
+
Hides the widget.
|
|
1264
|
+
|
|
1265
|
+
E.g., use this method to hide the widget after it loads.
|
|
1255
1266
|
|
|
1256
1267
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1257
1268
|
|
|
1258
1269
|
| Param | Type | Default | Description |
|
|
1259
1270
|
| --- | --- | --- | --- |
|
|
1260
|
-
| [saveSize] | <code>boolean</code> | <code>false</code> |
|
|
1271
|
+
| [saveSize] | <code>boolean</code> | <code>false</code> | Wether the original iframe element size should be saved before being hidden. |
|
|
1261
1272
|
|
|
1262
1273
|
<a name="w_HtmlMultiWidget+show" id="w_HtmlMultiWidget+show" href="#user-content-w_HtmlMultiWidget+show"> </a>
|
|
1263
1274
|
|
|
1264
1275
|
### htmlMultiWidget.show()
|
|
1265
|
-
|
|
1276
|
+
Shows the widget.
|
|
1277
|
+
|
|
1278
|
+
E.g., use this method to show the widget after it was explicitly hidden.
|
|
1266
1279
|
|
|
1267
1280
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1268
1281
|
<a name="w_HtmlMultiWidget+reload" id="w_HtmlMultiWidget+reload" href="#user-content-w_HtmlMultiWidget+reload"> </a>
|
|
1269
1282
|
|
|
1270
1283
|
### htmlMultiWidget.reload()
|
|
1271
|
-
|
|
1284
|
+
Reloads the widget.
|
|
1272
1285
|
|
|
1273
1286
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1274
1287
|
<a name="w_HtmlMultiWidget+hideElements" id="w_HtmlMultiWidget+hideElements" href="#user-content-w_HtmlMultiWidget+hideElements"> </a>
|
|
1275
1288
|
|
|
1276
1289
|
### htmlMultiWidget.hideElements(elements)
|
|
1277
|
-
|
|
1290
|
+
Hides the specified Widget elements by their identifier.
|
|
1278
1291
|
|
|
1279
1292
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1280
1293
|
|
|
1281
1294
|
| Param | Type | Description |
|
|
1282
1295
|
| --- | --- | --- |
|
|
1283
|
-
| elements | <code>Array.<string></code> |
|
|
1296
|
+
| elements | <code>Array.<string></code> | List of element which can be hidden [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
1284
1297
|
|
|
1285
1298
|
**Example**
|
|
1286
|
-
|
|
1287
1299
|
```javascript
|
|
1288
1300
|
widget.hideElements(['submit_button', 'email']);
|
|
1289
1301
|
```
|
|
1290
1302
|
<a name="w_HtmlMultiWidget+showElements" id="w_HtmlMultiWidget+showElements" href="#user-content-w_HtmlMultiWidget+showElements"> </a>
|
|
1291
1303
|
|
|
1292
1304
|
### htmlMultiWidget.showElements(elements)
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
* @example
|
|
1296
|
-
widget.showElements(['submit_button', 'email']);
|
|
1305
|
+
Shows the specified Widget elements by their identifier.
|
|
1297
1306
|
|
|
1298
1307
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1299
1308
|
|
|
1300
1309
|
| Param | Type | Description |
|
|
1301
1310
|
| --- | --- | --- |
|
|
1302
|
-
| elements | <code>Array.<string></code> |
|
|
1311
|
+
| elements | <code>Array.<string></code> | List of elements which can be showed [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
1303
1312
|
|
|
1313
|
+
**Example**
|
|
1314
|
+
```javascript
|
|
1315
|
+
widget.showElements(['submit_button', 'email']);
|
|
1316
|
+
```
|
|
1304
1317
|
<a name="w_HtmlMultiWidget+updateFormValues" id="w_HtmlMultiWidget+updateFormValues" href="#user-content-w_HtmlMultiWidget+updateFormValues"> </a>
|
|
1305
1318
|
|
|
1306
1319
|
### htmlMultiWidget.updateFormValues(fieldValues)
|
|
1307
|
-
|
|
1320
|
+
Updates the form field values inside the widget.
|
|
1308
1321
|
|
|
1309
1322
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1310
1323
|
|
|
@@ -1313,51 +1326,68 @@ Method for update values for form fields inside the widget
|
|
|
1313
1326
|
| fieldValues | <code>IFormValues</code> | Fields with values |
|
|
1314
1327
|
|
|
1315
1328
|
**Example**
|
|
1316
|
-
|
|
1317
1329
|
```javascript
|
|
1318
1330
|
widget.updateFormValues({
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1331
|
+
email: 'predefined@email.com',
|
|
1332
|
+
card_name: 'Houston'
|
|
1333
|
+
});
|
|
1334
|
+
```
|
|
1335
|
+
<a name="w_HtmlMultiWidget+updateFormValue" id="w_HtmlMultiWidget+updateFormValue" href="#user-content-w_HtmlMultiWidget+updateFormValue"> </a>
|
|
1336
|
+
|
|
1337
|
+
### htmlMultiWidget.updateFormValue(key, value)
|
|
1338
|
+
Updates a single form field values inside the widget by the form field name.
|
|
1339
|
+
|
|
1340
|
+
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1341
|
+
|
|
1342
|
+
| Param | Type | Description |
|
|
1343
|
+
| --- | --- | --- |
|
|
1344
|
+
| key | <code>string</code> | The form field name |
|
|
1345
|
+
| value | <code>string</code> | The form field value |
|
|
1346
|
+
|
|
1347
|
+
**Example**
|
|
1348
|
+
```javascript
|
|
1349
|
+
widget.updateFormValue("card_name", "John Doe");
|
|
1322
1350
|
```
|
|
1323
1351
|
<a name="w_HtmlMultiWidget+onFinishInsert" id="w_HtmlMultiWidget+onFinishInsert" href="#user-content-w_HtmlMultiWidget+onFinishInsert"> </a>
|
|
1324
1352
|
|
|
1325
1353
|
### htmlMultiWidget.onFinishInsert(selector, dataType)
|
|
1326
|
-
|
|
1354
|
+
Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
|
|
1327
1355
|
|
|
1328
1356
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1329
1357
|
|
|
1330
1358
|
| Param | Type | Description |
|
|
1331
1359
|
| --- | --- | --- |
|
|
1332
|
-
| selector | <code>string</code> |
|
|
1333
|
-
| dataType | <code>string</code> | data type of IEventData object. |
|
|
1360
|
+
| selector | <code>string</code> | A CSS selector. E.g., ".my-class", "#my-id", or others |
|
|
1361
|
+
| dataType | <code>string</code> | The data type of IEventData object. |
|
|
1334
1362
|
|
|
1335
1363
|
<a name="w_HtmlMultiWidget+interceptSubmitForm" id="w_HtmlMultiWidget+interceptSubmitForm" href="#user-content-w_HtmlMultiWidget+interceptSubmitForm"> </a>
|
|
1336
1364
|
|
|
1337
1365
|
### htmlMultiWidget.interceptSubmitForm(selector)
|
|
1338
|
-
|
|
1366
|
+
Intercepts a form submission and delegates processing to the widget.
|
|
1339
1367
|
|
|
1340
|
-
|
|
1368
|
+
An simplified example of the process:
|
|
1369
|
+
- User clicks submit button in your form
|
|
1370
|
+
- This implicitly triggers a submission to the widget
|
|
1371
|
+
- The widget submits your form
|
|
1341
1372
|
|
|
1342
1373
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1343
|
-
**Note**: submit button
|
|
1374
|
+
**Note**: The widget's submit button will be hidden.
|
|
1344
1375
|
|
|
1345
1376
|
| Param | Type | Description |
|
|
1346
1377
|
| --- | --- | --- |
|
|
1347
1378
|
| selector | <code>string</code> | css selector of your form |
|
|
1348
1379
|
|
|
1349
1380
|
**Example**
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
<form id="myForm">
|
|
1381
|
+
```html
|
|
1382
|
+
<body>
|
|
1383
|
+
<form id="myForm">
|
|
1353
1384
|
<input name="amount">
|
|
1354
1385
|
<button type="submit">Submit</button>
|
|
1355
1386
|
</form>
|
|
1356
|
-
|
|
1357
|
-
-->
|
|
1358
|
-
<script>
|
|
1387
|
+
<script>
|
|
1359
1388
|
widget.interceptSubmitForm('#myForm');
|
|
1360
|
-
</script>
|
|
1389
|
+
</script>
|
|
1390
|
+
</body>
|
|
1361
1391
|
```
|
|
1362
1392
|
<a name="w_HtmlMultiWidget+useCheckoutAutoSubmit" id="w_HtmlMultiWidget+useCheckoutAutoSubmit" href="#user-content-w_HtmlMultiWidget+useCheckoutAutoSubmit"> </a>
|
|
1363
1393
|
|
|
@@ -1372,7 +1402,6 @@ Use this method for resize iFrame according content height
|
|
|
1372
1402
|
|
|
1373
1403
|
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1374
1404
|
**Example**
|
|
1375
|
-
|
|
1376
1405
|
```javascript
|
|
1377
1406
|
widget.useAutoResize();
|
|
1378
1407
|
```
|
|
@@ -2425,6 +2454,32 @@ Current constant include available states of element for styling
|
|
|
2425
2454
|
| FOCUS | <code>string</code> | <code>"focus"</code> | focus. This state applies to: input |
|
|
2426
2455
|
| HOVER | <code>string</code> | <code>"hover"</code> | focus. This state applies to: submit_button |
|
|
2427
2456
|
|
|
2457
|
+
<a name="w_CARD_VALIDATORS" id="w_CARD_VALIDATORS" href="#user-content-w_CARD_VALIDATORS"> </a>
|
|
2458
|
+
|
|
2459
|
+
## CARD\_VALIDATORS : <code>Record.<string, string></code>
|
|
2460
|
+
List of available form field validators dedicated to cards and their definition
|
|
2461
|
+
|
|
2462
|
+
**Kind**: global constant
|
|
2463
|
+
|
|
2464
|
+
| Param | Type | Default | Description |
|
|
2465
|
+
| --- | --- | --- | --- |
|
|
2466
|
+
| CVV | <code>string</code> | <code>"cardCvvValidation"</code> | Asserts that CVV contains zero or more digits and is a number |
|
|
2467
|
+
| EXPIRY_DATE | <code>string</code> | <code>"expireDateValidation"</code> | Asserts value is a date in the future with format MM/YY |
|
|
2468
|
+
| HOLDER_NAME | <code>string</code> | <code>"cardHoldernameValidation"</code> | Asserts value is a name that respects the ITU-T T.50 standard (@see https://www.itu.int/rec/T-REC-T.50/en) |
|
|
2469
|
+
| NUMBER | <code>string</code> | <code>"cardNumberValidation"</code> | Asserts the value matches a known card scheme and as a the correct length. E.g., matches a 13, 16 or 19 digit bank card, **or**, a 13 to 25 digit Vii Gift card |
|
|
2470
|
+
| PIN | <code>string</code> | <code>"cardPinValidation"</code> | Asserts the value is a number with exactly 4 digits |
|
|
2471
|
+
|
|
2472
|
+
<a name="w_GENERIC_VALIDATORS" id="w_GENERIC_VALIDATORS" href="#user-content-w_GENERIC_VALIDATORS"> </a>
|
|
2473
|
+
|
|
2474
|
+
## GENERIC\_VALIDATORS : <code>Record.<string, string></code>
|
|
2475
|
+
List of available generic form field validators and their definition
|
|
2476
|
+
|
|
2477
|
+
**Kind**: global constant
|
|
2478
|
+
|
|
2479
|
+
| Param | Type | Default | Description |
|
|
2480
|
+
| --- | --- | --- | --- |
|
|
2481
|
+
| REQUIRED | <code>string</code> | <code>"required"</code> | Asserts the input or form field has a value defined truthy value |
|
|
2482
|
+
|
|
2428
2483
|
<a name="w_TRIGGER" id="w_TRIGGER" href="#user-content-w_TRIGGER"> </a>
|
|
2429
2484
|
|
|
2430
2485
|
## TRIGGER : <code>object</code>
|