@paydock/client-sdk 1.127.0 → 1.128.2
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 +1136 -3960
- package/bundles/index.cjs +292 -85
- package/bundles/index.cjs.d.ts +48 -3
- package/bundles/index.mjs +292 -85
- package/bundles/index.mjs.d.ts +48 -3
- package/bundles/types/checkout/checkout.d.ts +4 -4
- package/bundles/types/checkout/checkout.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/additionals.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/payment-template.d.ts.map +1 -1
- package/bundles/types/components/param.d.ts +2 -0
- package/bundles/types/components/param.d.ts.map +1 -1
- package/bundles/types/components/trigger.d.ts +2 -0
- package/bundles/types/components/trigger.d.ts.map +1 -1
- package/bundles/types/index-cba.d.ts +11 -11
- package/bundles/types/index-cba.d.ts.map +1 -1
- package/bundles/types/index.d.ts +11 -11
- package/bundles/types/index.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +24 -2
- package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/index.d.ts +7 -1
- package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/interfaces.d.ts +10 -2
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts +15 -4
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts +2 -0
- package/bundles/types/secure-remote-commerce/providers/src-provider.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/services/performance.service.d.ts +32 -0
- package/bundles/types/secure-remote-commerce/services/performance.service.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/index.d.ts +6 -6
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/index.d.ts +3 -3
- package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-response.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-shipping-option-change-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts +2 -2
- package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +5 -5
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-data.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-method.type.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +1 -1
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/types/shipping-event-to-response.type.d.ts +4 -4
- package/bundles/types/wallet-buttons-express/types/shipping-event-to-response.type.d.ts.map +1 -1
- package/bundles/types/widget/multi-widget.d.ts +8 -0
- package/bundles/types/widget/multi-widget.d.ts.map +1 -1
- package/bundles/widget.umd.js +292 -85
- package/bundles/widget.umd.js.d.ts +48 -3
- package/bundles/widget.umd.js.min.d.ts +48 -3
- package/bundles/widget.umd.min.js +1 -1
- package/docs/api-checkout-button.md +0 -370
- package/docs/api-widget.md +1 -2110
- package/docs/checkout-examples.md +2 -127
- package/docs/click-to-pay-examples.md +109 -0
- package/docs/click-to-pay.md +31 -1
- package/docs/license.md +1 -1
- package/docs/wallet-buttons-examples.md +3 -134
- package/docs/wallet-buttons.md +10 -10
- package/docs/wallet-cba-buttons-examples.md +1 -1
- package/package.json +1 -1
- package/slate.md +114 -524
- package/docs/api-vault-display.md +0 -94
package/docs/api-widget.md
CHANGED
|
@@ -1,40 +1,6 @@
|
|
|
1
|
-
## Classes
|
|
2
|
-
|
|
3
|
-
<dl>
|
|
4
|
-
<dt><a href="#user-content-w_HtmlWidget">HtmlWidget</a> ⇐ <code><a href="#user-content-w_HtmlMultiWidget">HtmlMultiWidget</a></code></dt>
|
|
5
|
-
<dd><p>Class Widget include method for working on html and include extended by HtmlMultiWidget methods</p>
|
|
6
|
-
</dd>
|
|
7
|
-
<dt><a href="#user-content-w_HtmlMultiWidget">HtmlMultiWidget</a> ⇐ <code><a href="#user-content-w_MultiWidget">MultiWidget</a></code></dt>
|
|
8
|
-
<dd><p>Class HtmlMultiWidget include method for working with html</p>
|
|
9
|
-
</dd>
|
|
10
|
-
<dt><a href="#user-content-w_Configuration">Configuration</a></dt>
|
|
11
|
-
<dd><p>Class Configuration include methods for creating configuration token</p>
|
|
12
|
-
</dd>
|
|
13
|
-
<dt><a href="#user-content-w_MultiWidget">MultiWidget</a></dt>
|
|
14
|
-
<dd><p>Class MultiWidget include method for for creating iframe url</p>
|
|
15
|
-
</dd>
|
|
16
|
-
</dl>
|
|
17
|
-
|
|
18
|
-
## Members
|
|
19
|
-
|
|
20
|
-
<dl>
|
|
21
|
-
<dt><a href="#user-content-w_PURPOSE">PURPOSE</a> : <code>object</code></dt>
|
|
22
|
-
<dd><p>Purposes</p>
|
|
23
|
-
</dd>
|
|
24
|
-
</dl>
|
|
25
|
-
|
|
26
1
|
## Constants
|
|
27
2
|
|
|
28
3
|
<dl>
|
|
29
|
-
<dt><a href="#user-content-w_EVENT">EVENT</a> : <code>object</code></dt>
|
|
30
|
-
<dd><p>List of available event's name</p>
|
|
31
|
-
</dd>
|
|
32
|
-
<dt><a href="#user-content-w_VAULT_DISPLAY_EVENT">VAULT_DISPLAY_EVENT</a> : <code>object</code></dt>
|
|
33
|
-
<dd><p>List of available event's name</p>
|
|
34
|
-
</dd>
|
|
35
|
-
<dt><a href="#user-content-w_PAYMENT_TYPE">PAYMENT_TYPE</a> : <code>object</code></dt>
|
|
36
|
-
<dd><p>List of available payment source types</p>
|
|
37
|
-
</dd>
|
|
38
4
|
<dt><a href="#user-content-w_FORM_FIELD">FORM_FIELD</a> : <code>object</code></dt>
|
|
39
5
|
<dd><p>Current constant include available type of fields which can be included to widget</p>
|
|
40
6
|
</dd>
|
|
@@ -70,19 +36,6 @@
|
|
|
70
36
|
## Interfaces
|
|
71
37
|
|
|
72
38
|
<dl>
|
|
73
|
-
<dt><a href="#user-content-w_IFormValidation">IFormValidation</a></dt>
|
|
74
|
-
<dd><p>Interface of data from validation event.</p>
|
|
75
|
-
</dd>
|
|
76
|
-
<dt><a href="#user-content-w_IEventMetaData">IEventMetaData</a></dt>
|
|
77
|
-
<dd><p>Contains basic information associated with the event and additional meta data
|
|
78
|
-
specific to the event. E.g., card info, gateway info, etc.</p>
|
|
79
|
-
</dd>
|
|
80
|
-
<dt><a href="#user-content-w_IEventAfterLoadData">IEventAfterLoadData</a></dt>
|
|
81
|
-
<dd><p>Interface of data from event.</p>
|
|
82
|
-
</dd>
|
|
83
|
-
<dt><a href="#user-content-w_IEventFinishData">IEventFinishData</a></dt>
|
|
84
|
-
<dd><p>Interface of data from event.</p>
|
|
85
|
-
</dd>
|
|
86
39
|
<dt><a href="#user-content-w_IPayPalMeta">IPayPalMeta</a></dt>
|
|
87
40
|
<dd><p>Interface for PayPal checkout meta information</p>
|
|
88
41
|
</dd>
|
|
@@ -115,76 +68,6 @@ specific to the event. E.g., card info, gateway info, etc.</p>
|
|
|
115
68
|
</dd>
|
|
116
69
|
</dl>
|
|
117
70
|
|
|
118
|
-
<a name="w_IFormValidation" id="w_IFormValidation" href="#user-content-w_IFormValidation"> </a>
|
|
119
|
-
|
|
120
|
-
## IFormValidation
|
|
121
|
-
Interface of data from validation event.
|
|
122
|
-
|
|
123
|
-
**Kind**: global interface
|
|
124
|
-
|
|
125
|
-
| Param | Type | Description |
|
|
126
|
-
| --- | --- | --- |
|
|
127
|
-
| event | <code>string</code> | The name of the event. |
|
|
128
|
-
| message_source | <code>string</code> | A system variable that identifies the event source. |
|
|
129
|
-
| purpose | <code>string</code> | A system variable that states the purpose of the event. |
|
|
130
|
-
| [ref_id] | <code>string</code> | Custom unique value that identifies result of processed operation. |
|
|
131
|
-
| [form_valid] | <code>boolean</code> | Indicates wether or not the form is valid. |
|
|
132
|
-
| [invalid_fields] | <code>Array.<string></code> | Names of form fields with invalid data. |
|
|
133
|
-
| [invalid_showed_fields] | <code>Array.<string></code> | Names of invalid form fields which are already displaying the error. |
|
|
134
|
-
| [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), |
|
|
135
|
-
|
|
136
|
-
<a name="w_IEventMetaData" id="w_IEventMetaData" href="#user-content-w_IEventMetaData"> </a>
|
|
137
|
-
|
|
138
|
-
## IEventMetaData
|
|
139
|
-
Contains basic information associated with the event and additional meta data
|
|
140
|
-
specific to the event. E.g., card info, gateway info, etc.
|
|
141
|
-
|
|
142
|
-
**Kind**: global interface
|
|
143
|
-
|
|
144
|
-
| Param | Type | Description |
|
|
145
|
-
| --- | --- | --- |
|
|
146
|
-
| event | <code>string</code> | The name of the event. |
|
|
147
|
-
| purpose | <code>string</code> | A system variable that states the purpose of the event. |
|
|
148
|
-
| message_source | <code>string</code> | A system variable that identifies the event source. |
|
|
149
|
-
| [ref_id] | <code>string</code> | Custom unique value that identifies result of processed operation. |
|
|
150
|
-
| configuration_token | <code>string</code> | Token received from our API with widget data |
|
|
151
|
-
| type | <code>string</code> | Payment type 'card', 'bank_account' |
|
|
152
|
-
| gateway_type | <code>string</code> | Gateway type |
|
|
153
|
-
| [card_number_last4] | <code>string</code> | Last 4 digit of your card |
|
|
154
|
-
| [card_scheme] | <code>string</code> | Card scheme, e.g., (Visa, Mastercard and American Express (AmEx)) |
|
|
155
|
-
| [card_number_length] | <code>number</code> | Card number length |
|
|
156
|
-
| [account_name] | <code>string</code> | Bank account account name |
|
|
157
|
-
| [account_number] | <code>string</code> | Bank account account number |
|
|
158
|
-
|
|
159
|
-
<a name="w_IEventAfterLoadData" id="w_IEventAfterLoadData" href="#user-content-w_IEventAfterLoadData"> </a>
|
|
160
|
-
|
|
161
|
-
## IEventAfterLoadData
|
|
162
|
-
Interface of data from event.
|
|
163
|
-
|
|
164
|
-
**Kind**: global interface
|
|
165
|
-
|
|
166
|
-
| Param | Type | Description |
|
|
167
|
-
| --- | --- | --- |
|
|
168
|
-
| event | <code>string</code> | The name of the event. |
|
|
169
|
-
| purpose | <code>string</code> | A system variable that states the purpose of the event. |
|
|
170
|
-
| message_source | <code>string</code> | A system variable that identifies the event source. |
|
|
171
|
-
| [ref_id] | <code>string</code> | Custom unique value that identifies result of processed operation. |
|
|
172
|
-
|
|
173
|
-
<a name="w_IEventFinishData" id="w_IEventFinishData" href="#user-content-w_IEventFinishData"> </a>
|
|
174
|
-
|
|
175
|
-
## IEventFinishData
|
|
176
|
-
Interface of data from event.
|
|
177
|
-
|
|
178
|
-
**Kind**: global interface
|
|
179
|
-
|
|
180
|
-
| Param | Type | Description |
|
|
181
|
-
| --- | --- | --- |
|
|
182
|
-
| event | <code>string</code> | The name of the event. |
|
|
183
|
-
| purpose | <code>string</code> | A system variable that states the purpose of the event. |
|
|
184
|
-
| message_source | <code>string</code> | A system variable that identifies the event source. |
|
|
185
|
-
| [ref_id] | <code>string</code> | Custom unique value that identifies result of processed operation. |
|
|
186
|
-
| payment_source | <code>string</code> | One time token. Result from this endpoint [API docs](https://docs.paydock.com/#tokens) |
|
|
187
|
-
|
|
188
71
|
<a name="w_IPayPalMeta" id="w_IPayPalMeta" href="#user-content-w_IPayPalMeta"> </a>
|
|
189
72
|
|
|
190
73
|
## IPayPalMeta
|
|
@@ -379,1999 +262,6 @@ Interface for classes that represent a trigger data.
|
|
|
379
262
|
| [elements] | <code>string</code> |
|
|
380
263
|
| [form_values] | <code>string</code> |
|
|
381
264
|
|
|
382
|
-
<a name="w_HtmlWidget" id="w_HtmlWidget" href="#user-content-w_HtmlWidget"> </a>
|
|
383
|
-
|
|
384
|
-
## HtmlWidget ⇐ [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
385
|
-
Class Widget include method for working on html and include extended by HtmlMultiWidget methods
|
|
386
|
-
|
|
387
|
-
**Kind**: global class
|
|
388
|
-
**Extends**: [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget), [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
389
|
-
|
|
390
|
-
* [HtmlWidget](#user-content-w_HtmlWidget) ⇐ [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
391
|
-
* [new HtmlWidget(selector, publicKey, [gatewayID], [paymentType], [purpose])](#user-content-w_new_HtmlWidget_new)
|
|
392
|
-
* [.setWebHookDestination(url)](#user-content-w_HtmlWidget+setWebHookDestination)
|
|
393
|
-
* [.setSuccessRedirectUrl(url)](#user-content-w_HtmlWidget+setSuccessRedirectUrl)
|
|
394
|
-
* [.setErrorRedirectUrl(url)](#user-content-w_HtmlWidget+setErrorRedirectUrl)
|
|
395
|
-
* [.setFormFields(fields)](#user-content-w_HtmlWidget+setFormFields)
|
|
396
|
-
* [.setFormElements(elements)](#user-content-w_HtmlWidget+setFormElements)
|
|
397
|
-
* [.setMeta(object)](#user-content-w_HtmlWidget+setMeta)
|
|
398
|
-
* [.load()](#user-content-w_HtmlMultiWidget+load)
|
|
399
|
-
* [.afterLoad()](#user-content-w_HtmlMultiWidget+afterLoad)
|
|
400
|
-
* [.trigger(triggers, data)](#user-content-w_HtmlMultiWidget+trigger)
|
|
401
|
-
* [.getValidationState()](#user-content-w_HtmlMultiWidget+getValidationState) ⇒ [<code>IFormValidation</code>](#user-content-w_IFormValidation)
|
|
402
|
-
* [.isValidForm()](#user-content-w_HtmlMultiWidget+isValidForm) ⇒ <code>boolean</code>
|
|
403
|
-
* [.isInvalidField(field)](#user-content-w_HtmlMultiWidget+isInvalidField) ⇒ <code>boolean</code>
|
|
404
|
-
* [.isFieldErrorShowed(field)](#user-content-w_HtmlMultiWidget+isFieldErrorShowed) ⇒ <code>boolean</code>
|
|
405
|
-
* [.isInvalidFieldByValidator(field, validator)](#user-content-w_HtmlMultiWidget+isInvalidFieldByValidator) ⇒ <code>boolean</code>
|
|
406
|
-
* [.hide([saveSize])](#user-content-w_HtmlMultiWidget+hide)
|
|
407
|
-
* [.show()](#user-content-w_HtmlMultiWidget+show)
|
|
408
|
-
* [.reload()](#user-content-w_HtmlMultiWidget+reload)
|
|
409
|
-
* [.hideElements(elements)](#user-content-w_HtmlMultiWidget+hideElements)
|
|
410
|
-
* [.showElements(elements)](#user-content-w_HtmlMultiWidget+showElements)
|
|
411
|
-
* [.updateFormValues(fieldValues)](#user-content-w_HtmlMultiWidget+updateFormValues)
|
|
412
|
-
* [.updateFormValue(key, value)](#user-content-w_HtmlMultiWidget+updateFormValue)
|
|
413
|
-
* [.onFinishInsert(selector, dataType)](#user-content-w_HtmlMultiWidget+onFinishInsert)
|
|
414
|
-
* [.interceptSubmitForm(selector)](#user-content-w_HtmlMultiWidget+interceptSubmitForm)
|
|
415
|
-
* [.useCheckoutAutoSubmit()](#user-content-w_HtmlMultiWidget+useCheckoutAutoSubmit)
|
|
416
|
-
* [.useAutoResize()](#user-content-w_HtmlMultiWidget+useAutoResize)
|
|
417
|
-
* [.setStyles(fields)](#user-content-w_MultiWidget+setStyles)
|
|
418
|
-
* [.usePhoneCountryMask([options])](#user-content-w_MultiWidget+usePhoneCountryMask)
|
|
419
|
-
* [.setTexts(fields)](#user-content-w_MultiWidget+setTexts)
|
|
420
|
-
* [.setElementStyle(element, [state], styles)](#user-content-w_MultiWidget+setElementStyle)
|
|
421
|
-
* [.setFormValues(fieldValues)](#user-content-w_MultiWidget+setFormValues)
|
|
422
|
-
* [.setFormLabels(fieldLabels)](#user-content-w_MultiWidget+setFormLabels)
|
|
423
|
-
* [.setFormPlaceholders(fieldPlaceholders)](#user-content-w_MultiWidget+setFormPlaceholders)
|
|
424
|
-
* ~~[.setIcons()](#user-content-w_MultiWidget+setIcons)~~
|
|
425
|
-
* [.setHiddenElements(elements)](#user-content-w_MultiWidget+setHiddenElements)
|
|
426
|
-
* [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
|
|
427
|
-
* [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
428
|
-
* [.setSupportedCardIcons(elements, validateCardNumberInput)](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
429
|
-
* [.hideUiErrors()](#user-content-w_MultiWidget+hideUiErrors)
|
|
430
|
-
* [.setEnv(env, [alias])](#user-content-w_MultiWidget+setEnv)
|
|
431
|
-
* [.loadIFrameUrl()](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
432
|
-
* [.setLanguage(code)](#user-content-w_MultiWidget+setLanguage)
|
|
433
|
-
|
|
434
|
-
<a name="w_new_HtmlWidget_new" id="w_new_HtmlWidget_new" href="#user-content-w_new_HtmlWidget_new"> </a>
|
|
435
|
-
|
|
436
|
-
### new HtmlWidget(selector, publicKey, [gatewayID], [paymentType], [purpose])
|
|
437
|
-
|
|
438
|
-
| Param | Type | Default | Description |
|
|
439
|
-
| --- | --- | --- | --- |
|
|
440
|
-
| selector | <code>string</code> | | Selector of html element. Container for widget |
|
|
441
|
-
| publicKey | <code>string</code> | | PayDock users public key |
|
|
442
|
-
| [gatewayID] | <code>string</code> | <code>"default"</code> | ID of a gateway connected to PayDock. By default or if put 'default', it will use the selected default gateway. If put 'not_configured', it won’t use gateway to create downstream token. |
|
|
443
|
-
| [paymentType] | <code>string</code> | <code>"card"</code> | Type of payment source which shows in widget form. Available parameters : “card”, “bank_account”. |
|
|
444
|
-
| [purpose] | <code>string</code> | <code>"payment_source"</code> | Purpose of widget form. Available parameters: ‘payment_source’, ‘card_payment_source_with_cvv’, ‘card_payment_source_without_cvv’ |
|
|
445
|
-
|
|
446
|
-
**Example**
|
|
447
|
-
|
|
448
|
-
```javascript
|
|
449
|
-
var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID'); // short
|
|
450
|
-
|
|
451
|
-
var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID', 'bank_account', 'payment_source'); // extend
|
|
452
|
-
|
|
453
|
-
var widget = new HtmlWidget('#widget', 'publicKey', 'not_configured'); // without gateway
|
|
454
|
-
```
|
|
455
|
-
<a name="w_HtmlWidget+setWebHookDestination" id="w_HtmlWidget+setWebHookDestination" href="#user-content-w_HtmlWidget+setWebHookDestination"> </a>
|
|
456
|
-
|
|
457
|
-
### htmlWidget.setWebHookDestination(url)
|
|
458
|
-
Destination, where customer will receive all successful responses.
|
|
459
|
-
Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
|
|
460
|
-
|
|
461
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
462
|
-
|
|
463
|
-
| Param | Type | Description |
|
|
464
|
-
| --- | --- | --- |
|
|
465
|
-
| url | <code>string</code> | Your endpoint for post request. |
|
|
466
|
-
|
|
467
|
-
**Example**
|
|
468
|
-
|
|
469
|
-
```javascript
|
|
470
|
-
widget.setWebHookDestination('http://google.com');
|
|
471
|
-
```
|
|
472
|
-
<a name="w_HtmlWidget+setSuccessRedirectUrl" id="w_HtmlWidget+setSuccessRedirectUrl" href="#user-content-w_HtmlWidget+setSuccessRedirectUrl"> </a>
|
|
473
|
-
|
|
474
|
-
### htmlWidget.setSuccessRedirectUrl(url)
|
|
475
|
-
URL to which the Customer will be redirected to after the success finish
|
|
476
|
-
|
|
477
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
478
|
-
|
|
479
|
-
| Param | Type |
|
|
480
|
-
| --- | --- |
|
|
481
|
-
| url | <code>string</code> |
|
|
482
|
-
|
|
483
|
-
**Example**
|
|
484
|
-
|
|
485
|
-
```javascript
|
|
486
|
-
widget.setSuccessRedirectUrl('google.com/search?q=success');
|
|
487
|
-
```
|
|
488
|
-
<a name="w_HtmlWidget+setErrorRedirectUrl" id="w_HtmlWidget+setErrorRedirectUrl" href="#user-content-w_HtmlWidget+setErrorRedirectUrl"> </a>
|
|
489
|
-
|
|
490
|
-
### htmlWidget.setErrorRedirectUrl(url)
|
|
491
|
-
URL to which the Customer will be redirected to if an error is triggered in the process of operation
|
|
492
|
-
|
|
493
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
494
|
-
|
|
495
|
-
| Param | Type |
|
|
496
|
-
| --- | --- |
|
|
497
|
-
| url | <code>string</code> |
|
|
498
|
-
|
|
499
|
-
**Example**
|
|
500
|
-
|
|
501
|
-
```javascript
|
|
502
|
-
widget.setErrorRedirectUrl('google.com/search?q=error');
|
|
503
|
-
```
|
|
504
|
-
<a name="w_HtmlWidget+setFormFields" id="w_HtmlWidget+setFormFields" href="#user-content-w_HtmlWidget+setFormFields"> </a>
|
|
505
|
-
|
|
506
|
-
### htmlWidget.setFormFields(fields)
|
|
507
|
-
Set list with widget form field, which will be shown in form. Also you can set the required validation for these fields
|
|
508
|
-
|
|
509
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
510
|
-
|
|
511
|
-
| Param | Type | Description |
|
|
512
|
-
| --- | --- | --- |
|
|
513
|
-
| fields | <code>Array.<string></code> | name of fields which can be shown in a widget. If after a name of a field, you put “*”, this field will be required on client-side. (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
514
|
-
|
|
515
|
-
**Example**
|
|
516
|
-
|
|
517
|
-
```javascript
|
|
518
|
-
widget.setFormFields(['phone', 'email', 'first_name*']);
|
|
519
|
-
```
|
|
520
|
-
<a name="w_HtmlWidget+setFormElements" id="w_HtmlWidget+setFormElements" href="#user-content-w_HtmlWidget+setFormElements"> </a>
|
|
521
|
-
|
|
522
|
-
### htmlWidget.setFormElements(elements)
|
|
523
|
-
The method to set the full configuration for the all specific form elements (visibility, required, label, placeholder, value)
|
|
524
|
-
You can also use the other method for the partial configuration like: setFormFields, setFormValues, setFormPlaceholder, setFormLabel
|
|
525
|
-
|
|
526
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
527
|
-
**Overrides**: [<code>setFormElements</code>](#user-content-w_MultiWidget+setFormElements)
|
|
528
|
-
|
|
529
|
-
| Param | Type | Description |
|
|
530
|
-
| --- | --- | --- |
|
|
531
|
-
| elements | <code>Array.<Object></code> | List of elements |
|
|
532
|
-
| elements[].field | <code>string</code> | Field name of element. If after a name of a field, you put “*”, this field will be required on client-side. (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
533
|
-
| elements[].placeholder | <code>string</code> | Set custom placeholders in form fields |
|
|
534
|
-
| elements[].label | <code>string</code> | Set a custom labels near the form field |
|
|
535
|
-
| elements[].value | <code>string</code> | Set predefined values for the form field |
|
|
536
|
-
|
|
537
|
-
**Example**
|
|
538
|
-
|
|
539
|
-
```javascript
|
|
540
|
-
widget.setFormElements([
|
|
541
|
-
{
|
|
542
|
-
field: 'card_name*',
|
|
543
|
-
placeholder: 'Input your card holder name...',
|
|
544
|
-
label: 'Card Holder Name',
|
|
545
|
-
value: 'Houston',
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
field: 'email',
|
|
549
|
-
placeholder: 'Input your email, like test@example.com',
|
|
550
|
-
label: 'Email for the receipt',
|
|
551
|
-
value: 'predefined@email.com',
|
|
552
|
-
},
|
|
553
|
-
])
|
|
554
|
-
```
|
|
555
|
-
<a name="w_HtmlWidget+setMeta" id="w_HtmlWidget+setMeta" href="#user-content-w_HtmlWidget+setMeta"> </a>
|
|
556
|
-
|
|
557
|
-
### htmlWidget.setMeta(object)
|
|
558
|
-
The method to set meta information for the checkout page
|
|
559
|
-
|
|
560
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
561
|
-
|
|
562
|
-
| Param | Type | Description |
|
|
563
|
-
| --- | --- | --- |
|
|
564
|
-
| object | [<code>IPayPalMeta</code>](#user-content-w_IPayPalMeta) \| [<code>IBamboraMeta</code>](#user-content-w_IBamboraMeta) | data which can be shown on checkout page [IPayPalMeta](#user-content-w_IPayPalMeta) [IBamboraMeta](#user-content-w_IBamboraMeta) |
|
|
565
|
-
|
|
566
|
-
**Example**
|
|
567
|
-
|
|
568
|
-
```javascript
|
|
569
|
-
config.setMeta({
|
|
570
|
-
brand_name: 'paydock',
|
|
571
|
-
reference: '15',
|
|
572
|
-
email: 'wault@paydock.com'
|
|
573
|
-
});
|
|
574
|
-
```
|
|
575
|
-
<a name="w_HtmlMultiWidget+load" id="w_HtmlMultiWidget+load" href="#user-content-w_HtmlMultiWidget+load"> </a>
|
|
576
|
-
|
|
577
|
-
### htmlWidget.load()
|
|
578
|
-
Loads the widget.
|
|
579
|
-
|
|
580
|
-
Calling this method results in an iframe element being inserted and rendered in the DOM.
|
|
581
|
-
|
|
582
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
583
|
-
**Overrides**: [<code>load</code>](#user-content-w_HtmlMultiWidget+load)
|
|
584
|
-
<a name="w_HtmlMultiWidget+afterLoad" id="w_HtmlMultiWidget+afterLoad" href="#user-content-w_HtmlMultiWidget+afterLoad"> </a>
|
|
585
|
-
|
|
586
|
-
### htmlWidget.afterLoad()
|
|
587
|
-
Registers a form validation callback for validation events.
|
|
588
|
-
|
|
589
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
590
|
-
**Overrides**: [<code>afterLoad</code>](#user-content-w_HtmlMultiWidget+afterLoad)
|
|
591
|
-
<a name="w_HtmlMultiWidget+trigger" id="w_HtmlMultiWidget+trigger" href="#user-content-w_HtmlMultiWidget+trigger"> </a>
|
|
592
|
-
|
|
593
|
-
### htmlWidget.trigger(triggers, data)
|
|
594
|
-
Registers callback that will be invoked for every trigger.
|
|
595
|
-
|
|
596
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
597
|
-
**Overrides**: [<code>trigger</code>](#user-content-w_HtmlMultiWidget+trigger)
|
|
598
|
-
|
|
599
|
-
| Param | Type | Description |
|
|
600
|
-
| --- | --- | --- |
|
|
601
|
-
| triggers | <code>'submit\_form'</code> \| <code>'tab'</code> | The Widget element identifier that caused the trigger. |
|
|
602
|
-
| data | [<code>ITriggerData</code>](#user-content-w_ITriggerData) | Data that will be sent to the widget when the trigger occurs. |
|
|
603
|
-
|
|
604
|
-
<a name="w_HtmlMultiWidget+getValidationState" id="w_HtmlMultiWidget+getValidationState" href="#user-content-w_HtmlMultiWidget+getValidationState"> </a>
|
|
605
|
-
|
|
606
|
-
### htmlWidget.getValidationState() ⇒ [<code>IFormValidation</code>](#user-content-w_IFormValidation)
|
|
607
|
-
Gets a reference to the form current validation state.
|
|
608
|
-
|
|
609
|
-
!Warning: do not directly modify the values of the returned object.
|
|
610
|
-
|
|
611
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
612
|
-
**Overrides**: [<code>getValidationState</code>](#user-content-w_HtmlMultiWidget+getValidationState)
|
|
613
|
-
**Returns**: [<code>IFormValidation</code>](#user-content-w_IFormValidation) - Form validation object
|
|
614
|
-
<a name="w_HtmlMultiWidget+isValidForm" id="w_HtmlMultiWidget+isValidForm" href="#user-content-w_HtmlMultiWidget+isValidForm"> </a>
|
|
615
|
-
|
|
616
|
-
### htmlWidget.isValidForm() ⇒ <code>boolean</code>
|
|
617
|
-
Checks if a given form is valid.
|
|
618
|
-
|
|
619
|
-
A form is valid if all form fields are valid.
|
|
620
|
-
|
|
621
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
622
|
-
**Overrides**: [<code>isValidForm</code>](#user-content-w_HtmlMultiWidget+isValidForm)
|
|
623
|
-
**Returns**: <code>boolean</code> - Indicates wether or not form is valid.
|
|
624
|
-
<a name="w_HtmlMultiWidget+isInvalidField" id="w_HtmlMultiWidget+isInvalidField" href="#user-content-w_HtmlMultiWidget+isInvalidField"> </a>
|
|
625
|
-
|
|
626
|
-
### htmlWidget.isInvalidField(field) ⇒ <code>boolean</code>
|
|
627
|
-
Using this method you can check if a specific form field is invalid
|
|
628
|
-
|
|
629
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
630
|
-
**Overrides**: [<code>isInvalidField</code>](#user-content-w_HtmlMultiWidget+isInvalidField)
|
|
631
|
-
**Returns**: <code>boolean</code> - Field is invalid
|
|
632
|
-
|
|
633
|
-
| Param | Type | Description |
|
|
634
|
-
| --- | --- | --- |
|
|
635
|
-
| field | <code>string</code> | Field name |
|
|
636
|
-
|
|
637
|
-
<a name="w_HtmlMultiWidget+isFieldErrorShowed" id="w_HtmlMultiWidget+isFieldErrorShowed" href="#user-content-w_HtmlMultiWidget+isFieldErrorShowed"> </a>
|
|
638
|
-
|
|
639
|
-
### htmlWidget.isFieldErrorShowed(field) ⇒ <code>boolean</code>
|
|
640
|
-
Checks if a given form field is displaying an error.
|
|
641
|
-
|
|
642
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
643
|
-
**Overrides**: [<code>isFieldErrorShowed</code>](#user-content-w_HtmlMultiWidget+isFieldErrorShowed)
|
|
644
|
-
**Returns**: <code>boolean</code> - Indicates wether or not the Error message is being displayed on the associated field.
|
|
645
|
-
|
|
646
|
-
| Param | Type | Description |
|
|
647
|
-
| --- | --- | --- |
|
|
648
|
-
| field | <code>string</code> | The form field name |
|
|
649
|
-
|
|
650
|
-
<a name="w_HtmlMultiWidget+isInvalidFieldByValidator" id="w_HtmlMultiWidget+isInvalidFieldByValidator" href="#user-content-w_HtmlMultiWidget+isInvalidFieldByValidator"> </a>
|
|
651
|
-
|
|
652
|
-
### htmlWidget.isInvalidFieldByValidator(field, validator) ⇒ <code>boolean</code>
|
|
653
|
-
Checks if a given form field is valid or invalid by name.
|
|
654
|
-
|
|
655
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
656
|
-
**Overrides**: [<code>isInvalidFieldByValidator</code>](#user-content-w_HtmlMultiWidget+isInvalidFieldByValidator)
|
|
657
|
-
**Returns**: <code>boolean</code> - Indicates wether or not the field is invalid based on validator intepretation.
|
|
658
|
-
|
|
659
|
-
| Param | Type | Description |
|
|
660
|
-
| --- | --- | --- |
|
|
661
|
-
| field | <code>string</code> | The form field name |
|
|
662
|
-
| validator | | The name of the validator. |
|
|
663
|
-
|
|
664
|
-
<a name="w_HtmlMultiWidget+hide" id="w_HtmlMultiWidget+hide" href="#user-content-w_HtmlMultiWidget+hide"> </a>
|
|
665
|
-
|
|
666
|
-
### htmlWidget.hide([saveSize])
|
|
667
|
-
Hides the widget.
|
|
668
|
-
|
|
669
|
-
E.g., use this method to hide the widget after it loads.
|
|
670
|
-
|
|
671
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
672
|
-
**Overrides**: [<code>hide</code>](#user-content-w_HtmlMultiWidget+hide)
|
|
673
|
-
|
|
674
|
-
| Param | Type | Default | Description |
|
|
675
|
-
| --- | --- | --- | --- |
|
|
676
|
-
| [saveSize] | <code>boolean</code> | <code>false</code> | Wether the original iframe element size should be saved before being hidden. |
|
|
677
|
-
|
|
678
|
-
<a name="w_HtmlMultiWidget+show" id="w_HtmlMultiWidget+show" href="#user-content-w_HtmlMultiWidget+show"> </a>
|
|
679
|
-
|
|
680
|
-
### htmlWidget.show()
|
|
681
|
-
Shows the widget.
|
|
682
|
-
|
|
683
|
-
E.g., use this method to show the widget after it was explicitly hidden.
|
|
684
|
-
|
|
685
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
686
|
-
**Overrides**: [<code>show</code>](#user-content-w_HtmlMultiWidget+show)
|
|
687
|
-
<a name="w_HtmlMultiWidget+reload" id="w_HtmlMultiWidget+reload" href="#user-content-w_HtmlMultiWidget+reload"> </a>
|
|
688
|
-
|
|
689
|
-
### htmlWidget.reload()
|
|
690
|
-
Reloads the widget.
|
|
691
|
-
|
|
692
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
693
|
-
**Overrides**: [<code>reload</code>](#user-content-w_HtmlMultiWidget+reload)
|
|
694
|
-
<a name="w_HtmlMultiWidget+hideElements" id="w_HtmlMultiWidget+hideElements" href="#user-content-w_HtmlMultiWidget+hideElements"> </a>
|
|
695
|
-
|
|
696
|
-
### htmlWidget.hideElements(elements)
|
|
697
|
-
Hides the specified Widget elements by their identifier.
|
|
698
|
-
|
|
699
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
700
|
-
**Overrides**: [<code>hideElements</code>](#user-content-w_HtmlMultiWidget+hideElements)
|
|
701
|
-
|
|
702
|
-
| Param | Type | Description |
|
|
703
|
-
| --- | --- | --- |
|
|
704
|
-
| elements | <code>Array.<string></code> | List of element which can be hidden [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
705
|
-
|
|
706
|
-
**Example**
|
|
707
|
-
```javascript
|
|
708
|
-
widget.hideElements(['submit_button', 'email']);
|
|
709
|
-
```
|
|
710
|
-
<a name="w_HtmlMultiWidget+showElements" id="w_HtmlMultiWidget+showElements" href="#user-content-w_HtmlMultiWidget+showElements"> </a>
|
|
711
|
-
|
|
712
|
-
### htmlWidget.showElements(elements)
|
|
713
|
-
Shows the specified Widget elements by their identifier.
|
|
714
|
-
|
|
715
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
716
|
-
**Overrides**: [<code>showElements</code>](#user-content-w_HtmlMultiWidget+showElements)
|
|
717
|
-
|
|
718
|
-
| Param | Type | Description |
|
|
719
|
-
| --- | --- | --- |
|
|
720
|
-
| elements | <code>Array.<string></code> | List of elements which can be showed [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
721
|
-
|
|
722
|
-
**Example**
|
|
723
|
-
```javascript
|
|
724
|
-
widget.showElements(['submit_button', 'email']);
|
|
725
|
-
```
|
|
726
|
-
<a name="w_HtmlMultiWidget+updateFormValues" id="w_HtmlMultiWidget+updateFormValues" href="#user-content-w_HtmlMultiWidget+updateFormValues"> </a>
|
|
727
|
-
|
|
728
|
-
### htmlWidget.updateFormValues(fieldValues)
|
|
729
|
-
Updates the form field values inside the widget.
|
|
730
|
-
|
|
731
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
732
|
-
**Overrides**: [<code>updateFormValues</code>](#user-content-w_HtmlMultiWidget+updateFormValues)
|
|
733
|
-
|
|
734
|
-
| Param | Type | Description |
|
|
735
|
-
| --- | --- | --- |
|
|
736
|
-
| fieldValues | <code>IFormValues</code> | Fields with values |
|
|
737
|
-
|
|
738
|
-
**Example**
|
|
739
|
-
```javascript
|
|
740
|
-
widget.updateFormValues({
|
|
741
|
-
email: 'predefined@email.com',
|
|
742
|
-
card_name: 'Houston'
|
|
743
|
-
});
|
|
744
|
-
```
|
|
745
|
-
<a name="w_HtmlMultiWidget+updateFormValue" id="w_HtmlMultiWidget+updateFormValue" href="#user-content-w_HtmlMultiWidget+updateFormValue"> </a>
|
|
746
|
-
|
|
747
|
-
### htmlWidget.updateFormValue(key, value)
|
|
748
|
-
Updates a single form field values inside the widget by the form field name.
|
|
749
|
-
|
|
750
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
751
|
-
**Overrides**: [<code>updateFormValue</code>](#user-content-w_HtmlMultiWidget+updateFormValue)
|
|
752
|
-
|
|
753
|
-
| Param | Type | Description |
|
|
754
|
-
| --- | --- | --- |
|
|
755
|
-
| key | <code>string</code> | The form field name |
|
|
756
|
-
| value | <code>string</code> | The form field value |
|
|
757
|
-
|
|
758
|
-
**Example**
|
|
759
|
-
```javascript
|
|
760
|
-
widget.updateFormValue("card_name", "John Doe");
|
|
761
|
-
```
|
|
762
|
-
<a name="w_HtmlMultiWidget+onFinishInsert" id="w_HtmlMultiWidget+onFinishInsert" href="#user-content-w_HtmlMultiWidget+onFinishInsert"> </a>
|
|
763
|
-
|
|
764
|
-
### htmlWidget.onFinishInsert(selector, dataType)
|
|
765
|
-
Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
|
|
766
|
-
|
|
767
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
768
|
-
**Overrides**: [<code>onFinishInsert</code>](#user-content-w_HtmlMultiWidget+onFinishInsert)
|
|
769
|
-
|
|
770
|
-
| Param | Type | Description |
|
|
771
|
-
| --- | --- | --- |
|
|
772
|
-
| selector | <code>string</code> | A CSS selector. E.g., ".my-class", "#my-id", or others |
|
|
773
|
-
| dataType | <code>string</code> | The data type of IEventData object. |
|
|
774
|
-
|
|
775
|
-
<a name="w_HtmlMultiWidget+interceptSubmitForm" id="w_HtmlMultiWidget+interceptSubmitForm" href="#user-content-w_HtmlMultiWidget+interceptSubmitForm"> </a>
|
|
776
|
-
|
|
777
|
-
### htmlWidget.interceptSubmitForm(selector)
|
|
778
|
-
Intercepts a form submission and delegates processing to the widget.
|
|
779
|
-
|
|
780
|
-
An simplified example of the process:
|
|
781
|
-
- User clicks submit button in your form
|
|
782
|
-
- This implicitly triggers a submission to the widget
|
|
783
|
-
- The widget submits your form
|
|
784
|
-
|
|
785
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
786
|
-
**Overrides**: [<code>interceptSubmitForm</code>](#user-content-w_HtmlMultiWidget+interceptSubmitForm)
|
|
787
|
-
**Note**: The widget's submit button will be hidden.
|
|
788
|
-
|
|
789
|
-
| Param | Type | Description |
|
|
790
|
-
| --- | --- | --- |
|
|
791
|
-
| selector | <code>string</code> | css selector of your form |
|
|
792
|
-
|
|
793
|
-
**Example**
|
|
794
|
-
```html
|
|
795
|
-
<body>
|
|
796
|
-
<form id="myForm">
|
|
797
|
-
<input name="amount">
|
|
798
|
-
<button type="submit">Submit</button>
|
|
799
|
-
</form>
|
|
800
|
-
<script>
|
|
801
|
-
widget.interceptSubmitForm('#myForm');
|
|
802
|
-
</script>
|
|
803
|
-
</body>
|
|
804
|
-
```
|
|
805
|
-
<a name="w_HtmlMultiWidget+useCheckoutAutoSubmit" id="w_HtmlMultiWidget+useCheckoutAutoSubmit" href="#user-content-w_HtmlMultiWidget+useCheckoutAutoSubmit"> </a>
|
|
806
|
-
|
|
807
|
-
### htmlWidget.useCheckoutAutoSubmit()
|
|
808
|
-
This method hides a submit button and automatically execute form submit
|
|
809
|
-
|
|
810
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
811
|
-
**Overrides**: [<code>useCheckoutAutoSubmit</code>](#user-content-w_HtmlMultiWidget+useCheckoutAutoSubmit)
|
|
812
|
-
<a name="w_HtmlMultiWidget+useAutoResize" id="w_HtmlMultiWidget+useAutoResize" href="#user-content-w_HtmlMultiWidget+useAutoResize"> </a>
|
|
813
|
-
|
|
814
|
-
### htmlWidget.useAutoResize()
|
|
815
|
-
Use this method for resize iFrame according content height
|
|
816
|
-
|
|
817
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
818
|
-
**Overrides**: [<code>useAutoResize</code>](#user-content-w_HtmlMultiWidget+useAutoResize)
|
|
819
|
-
**Example**
|
|
820
|
-
```javascript
|
|
821
|
-
widget.useAutoResize();
|
|
822
|
-
```
|
|
823
|
-
<a name="w_MultiWidget+setStyles" id="w_MultiWidget+setStyles" href="#user-content-w_MultiWidget+setStyles"> </a>
|
|
824
|
-
|
|
825
|
-
### htmlWidget.setStyles(fields)
|
|
826
|
-
Object contain styles for widget
|
|
827
|
-
|
|
828
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
829
|
-
**Overrides**: [<code>setStyles</code>](#user-content-w_MultiWidget+setStyles)
|
|
830
|
-
|
|
831
|
-
| Param | Type | Description |
|
|
832
|
-
| --- | --- | --- |
|
|
833
|
-
| fields | [<code>IStyles</code>](#user-content-w_IStyles) | name of styles which can be shown in widget [STYLE](#user-content-w_STYLE) |
|
|
834
|
-
|
|
835
|
-
**Example**
|
|
836
|
-
|
|
837
|
-
```javascript
|
|
838
|
-
widget.setStyles({
|
|
839
|
-
background_color: 'rgb(0, 0, 0)',
|
|
840
|
-
border_color: 'yellow',
|
|
841
|
-
text_color: '#FFFFAA',
|
|
842
|
-
button_color: 'rgba(255, 255, 255, 0.9)',
|
|
843
|
-
font_size: '20px'
|
|
844
|
-
fort_family: 'fantasy'
|
|
845
|
-
});
|
|
846
|
-
```
|
|
847
|
-
<a name="w_MultiWidget+usePhoneCountryMask" id="w_MultiWidget+usePhoneCountryMask" href="#user-content-w_MultiWidget+usePhoneCountryMask"> </a>
|
|
848
|
-
|
|
849
|
-
### htmlWidget.usePhoneCountryMask([options])
|
|
850
|
-
Method to set a country code mask for the phone input.
|
|
851
|
-
|
|
852
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
853
|
-
**Overrides**: [<code>usePhoneCountryMask</code>](#user-content-w_MultiWidget+usePhoneCountryMask)
|
|
854
|
-
|
|
855
|
-
| Param | Type | Description |
|
|
856
|
-
| --- | --- | --- |
|
|
857
|
-
| [options] | <code>object</code> | Options for configure the phone mask. |
|
|
858
|
-
| [options.default_country] | <code>string</code> | Set a default country for the mask. |
|
|
859
|
-
| [options.preferred_countries] | <code>Array.<string></code> | Set list of preferred countries for the top of the select box . |
|
|
860
|
-
| [options.only_countries] | <code>Array.<string></code> | Set list of countries to show in the select box. |
|
|
861
|
-
|
|
862
|
-
**Example**
|
|
863
|
-
|
|
864
|
-
```javascript
|
|
865
|
-
widget.usePhoneCountryMask();
|
|
866
|
-
```
|
|
867
|
-
**Example**
|
|
868
|
-
|
|
869
|
-
```javascript
|
|
870
|
-
widget.usePhoneCountryMask({
|
|
871
|
-
default_country: 'au',
|
|
872
|
-
preferred_countries: ['au', 'gb'],
|
|
873
|
-
only_countries: ['au', 'gb', 'us', 'ua']
|
|
874
|
-
});
|
|
875
|
-
```
|
|
876
|
-
<a name="w_MultiWidget+setTexts" id="w_MultiWidget+setTexts" href="#user-content-w_MultiWidget+setTexts"> </a>
|
|
877
|
-
|
|
878
|
-
### htmlWidget.setTexts(fields)
|
|
879
|
-
Method for set different texts inside the widget
|
|
880
|
-
|
|
881
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
882
|
-
**Overrides**: [<code>setTexts</code>](#user-content-w_MultiWidget+setTexts)
|
|
883
|
-
|
|
884
|
-
| Param | Type | Description |
|
|
885
|
-
| --- | --- | --- |
|
|
886
|
-
| fields | [<code>ITexts</code>](#user-content-w_ITexts) | name of text items which can be shown in widget [TEXT](#user-content-w_TEXT) |
|
|
887
|
-
|
|
888
|
-
**Example**
|
|
889
|
-
|
|
890
|
-
```javascript
|
|
891
|
-
widget.setTexts({
|
|
892
|
-
title: 'Your card',
|
|
893
|
-
finish_text: 'Payment resource was successfully accepted',
|
|
894
|
-
title_description: '* indicates required field',
|
|
895
|
-
submit_button: 'Save',
|
|
896
|
-
submit_button_processing: 'Load...',
|
|
897
|
-
});
|
|
898
|
-
```
|
|
899
|
-
<a name="w_MultiWidget+setElementStyle" id="w_MultiWidget+setElementStyle" href="#user-content-w_MultiWidget+setElementStyle"> </a>
|
|
900
|
-
|
|
901
|
-
### htmlWidget.setElementStyle(element, [state], styles)
|
|
902
|
-
Method for set styles for different elements and states
|
|
903
|
-
|
|
904
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
905
|
-
**Overrides**: [<code>setElementStyle</code>](#user-content-w_MultiWidget+setElementStyle)
|
|
906
|
-
|
|
907
|
-
| Param | Type | Description |
|
|
908
|
-
| --- | --- | --- |
|
|
909
|
-
| element | <code>string</code> | type of element for styling. These elements are available [STYLABLE_ELEMENT](#user-content-w_STYLABLE_ELEMENT) |
|
|
910
|
-
| [state] | <code>string</code> | state of element for styling. These states are available [STYLABLE_ELEMENT_STATE](#user-content-w_STYLABLE_ELEMENT_STATE) |
|
|
911
|
-
| styles | [<code>IElementStyleInput</code>](#user-content-w_IElementStyleInput) \| [<code>IElementStyleSubmitButton</code>](#user-content-w_IElementStyleSubmitButton) \| [<code>IElementStyleLabel</code>](#user-content-w_IElementStyleLabel) \| [<code>IElementStyleTitle</code>](#user-content-w_IElementStyleTitle) \| [<code>IElementStyleTitleDescription</code>](#user-content-w_IElementStyleTitleDescription) | styles list |
|
|
912
|
-
|
|
913
|
-
**Example**
|
|
914
|
-
|
|
915
|
-
```javascript
|
|
916
|
-
widget.setElementStyle('input', {
|
|
917
|
-
border: 'green solid 1px'
|
|
918
|
-
});
|
|
919
|
-
|
|
920
|
-
widget.setElementStyle('input', 'focus', {
|
|
921
|
-
border: 'blue solid 1px'
|
|
922
|
-
});
|
|
923
|
-
|
|
924
|
-
widget.setElementStyle('input', 'error', {
|
|
925
|
-
border: 'red solid 1px'
|
|
926
|
-
});
|
|
927
|
-
```
|
|
928
|
-
<a name="w_MultiWidget+setFormValues" id="w_MultiWidget+setFormValues" href="#user-content-w_MultiWidget+setFormValues"> </a>
|
|
929
|
-
|
|
930
|
-
### htmlWidget.setFormValues(fieldValues)
|
|
931
|
-
The method to set the predefined values for the form fields inside the widget
|
|
932
|
-
|
|
933
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
934
|
-
**Overrides**: [<code>setFormValues</code>](#user-content-w_MultiWidget+setFormValues)
|
|
935
|
-
|
|
936
|
-
| Param | Type | Description |
|
|
937
|
-
| --- | --- | --- |
|
|
938
|
-
| fieldValues | <code>Object</code> | Key of object is one of [FORM_FIELD](#user-content-w_FORM_FIELD), The object value is what we are expecting |
|
|
939
|
-
|
|
940
|
-
**Example**
|
|
941
|
-
|
|
942
|
-
```javascript
|
|
943
|
-
widget.setFormValues({
|
|
944
|
-
email: 'predefined@email.com',
|
|
945
|
-
card_name: 'Houston'
|
|
946
|
-
});
|
|
947
|
-
```
|
|
948
|
-
<a name="w_MultiWidget+setFormLabels" id="w_MultiWidget+setFormLabels" href="#user-content-w_MultiWidget+setFormLabels"> </a>
|
|
949
|
-
|
|
950
|
-
### htmlWidget.setFormLabels(fieldLabels)
|
|
951
|
-
The method to set custom form field labels
|
|
952
|
-
|
|
953
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
954
|
-
**Overrides**: [<code>setFormLabels</code>](#user-content-w_MultiWidget+setFormLabels)
|
|
955
|
-
|
|
956
|
-
| Param | Type | Description |
|
|
957
|
-
| --- | --- | --- |
|
|
958
|
-
| fieldLabels | <code>Object</code> | Key of object is one of [FORM_FIELD](#user-content-w_FORM_FIELD), The object value is what we are expecting |
|
|
959
|
-
|
|
960
|
-
**Example**
|
|
961
|
-
|
|
962
|
-
```javascript
|
|
963
|
-
widget.setFormPlaceholders({
|
|
964
|
-
card_name: 'Card Holder Name',
|
|
965
|
-
email: 'Email For Receipt'
|
|
966
|
-
})
|
|
967
|
-
```
|
|
968
|
-
<a name="w_MultiWidget+setFormPlaceholders" id="w_MultiWidget+setFormPlaceholders" href="#user-content-w_MultiWidget+setFormPlaceholders"> </a>
|
|
969
|
-
|
|
970
|
-
### htmlWidget.setFormPlaceholders(fieldPlaceholders)
|
|
971
|
-
The method to set custom form fields placeholders
|
|
972
|
-
|
|
973
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
974
|
-
**Overrides**: [<code>setFormPlaceholders</code>](#user-content-w_MultiWidget+setFormPlaceholders)
|
|
975
|
-
|
|
976
|
-
| Param | Type | Description |
|
|
977
|
-
| --- | --- | --- |
|
|
978
|
-
| fieldPlaceholders | <code>Object</code> | Key of object is one of [FORM_FIELD](#user-content-w_FORM_FIELD), Value of object is expected placeholder |
|
|
979
|
-
|
|
980
|
-
**Example**
|
|
981
|
-
|
|
982
|
-
```javascript
|
|
983
|
-
widget.setFormPlaceholders({
|
|
984
|
-
card_name: 'Input your card holder name...',
|
|
985
|
-
email: 'Input your email, like test@example.com'
|
|
986
|
-
})
|
|
987
|
-
```
|
|
988
|
-
<a name="w_MultiWidget+setIcons" id="w_MultiWidget+setIcons" href="#user-content-w_MultiWidget+setIcons"> </a>
|
|
989
|
-
|
|
990
|
-
### ~~htmlWidget.setIcons()~~
|
|
991
|
-
***Deprecated***
|
|
992
|
-
|
|
993
|
-
The method to change the widget icons
|
|
994
|
-
|
|
995
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
996
|
-
**Overrides**: [<code>setIcons</code>](#user-content-w_MultiWidget+setIcons)
|
|
997
|
-
<a name="w_MultiWidget+setHiddenElements" id="w_MultiWidget+setHiddenElements" href="#user-content-w_MultiWidget+setHiddenElements"> </a>
|
|
998
|
-
|
|
999
|
-
### htmlWidget.setHiddenElements(elements)
|
|
1000
|
-
Using this method you can set hidden elements inside widget
|
|
1001
|
-
|
|
1002
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
1003
|
-
**Overrides**: [<code>setHiddenElements</code>](#user-content-w_MultiWidget+setHiddenElements)
|
|
1004
|
-
|
|
1005
|
-
| Param | Type | Description |
|
|
1006
|
-
| --- | --- | --- |
|
|
1007
|
-
| elements | <code>Array.<string></code> | list of element which can be hidden [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
1008
|
-
|
|
1009
|
-
**Example**
|
|
1010
|
-
|
|
1011
|
-
```javascript
|
|
1012
|
-
widget.setHiddenElements(['submit_button', 'email']);
|
|
1013
|
-
```
|
|
1014
|
-
<a name="w_MultiWidget+setRefId" id="w_MultiWidget+setRefId" href="#user-content-w_MultiWidget+setRefId"> </a>
|
|
1015
|
-
|
|
1016
|
-
### htmlWidget.setRefId(refId)
|
|
1017
|
-
Current method can set custom ID to identify the data in the future
|
|
1018
|
-
|
|
1019
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
1020
|
-
**Overrides**: [<code>setRefId</code>](#user-content-w_MultiWidget+setRefId)
|
|
1021
|
-
|
|
1022
|
-
| Param | Type | Description |
|
|
1023
|
-
| --- | --- | --- |
|
|
1024
|
-
| refId | <code>string</code> | custom id |
|
|
1025
|
-
|
|
1026
|
-
**Example**
|
|
1027
|
-
|
|
1028
|
-
```javascript
|
|
1029
|
-
widget.setRefId('id');
|
|
1030
|
-
```
|
|
1031
|
-
<a name="w_MultiWidget+useGatewayFieldValidation" id="w_MultiWidget+useGatewayFieldValidation" href="#user-content-w_MultiWidget+useGatewayFieldValidation"> </a>
|
|
1032
|
-
|
|
1033
|
-
### htmlWidget.useGatewayFieldValidation()
|
|
1034
|
-
Current method can add visual validation from gateway to widget's form fields
|
|
1035
|
-
|
|
1036
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
1037
|
-
**Overrides**: [<code>useGatewayFieldValidation</code>](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
1038
|
-
**Example**
|
|
1039
|
-
|
|
1040
|
-
```javascript
|
|
1041
|
-
widget.useGatewayFieldValidation();
|
|
1042
|
-
```
|
|
1043
|
-
<a name="w_MultiWidget+setSupportedCardIcons" id="w_MultiWidget+setSupportedCardIcons" href="#user-content-w_MultiWidget+setSupportedCardIcons"> </a>
|
|
1044
|
-
|
|
1045
|
-
### htmlWidget.setSupportedCardIcons(elements, validateCardNumberInput)
|
|
1046
|
-
Current method can set icons of supported card types
|
|
1047
|
-
|
|
1048
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
1049
|
-
**Overrides**: [<code>setSupportedCardIcons</code>](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
1050
|
-
|
|
1051
|
-
| Param | Type | Description |
|
|
1052
|
-
| --- | --- | --- |
|
|
1053
|
-
| elements | <code>Array.<string></code> | [SUPPORTED_CARD_TYPES](#user-content-w_SUPPORTED_CARD_TYPES) |
|
|
1054
|
-
| validateCardNumberInput | <code>boolean</code> | [validateCardNumberInput=false] - using this param you allow validation for card number input on supported card types |
|
|
1055
|
-
|
|
1056
|
-
**Example**
|
|
1057
|
-
|
|
1058
|
-
```javascript
|
|
1059
|
-
widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
|
|
1060
|
-
```
|
|
1061
|
-
<a name="w_MultiWidget+hideUiErrors" id="w_MultiWidget+hideUiErrors" href="#user-content-w_MultiWidget+hideUiErrors"> </a>
|
|
1062
|
-
|
|
1063
|
-
### htmlWidget.hideUiErrors()
|
|
1064
|
-
Current method can hide prevent the widget from showing the error messages
|
|
1065
|
-
|
|
1066
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
1067
|
-
**Overrides**: [<code>hideUiErrors</code>](#user-content-w_MultiWidget+hideUiErrors)
|
|
1068
|
-
**Example**
|
|
1069
|
-
|
|
1070
|
-
```javascript
|
|
1071
|
-
widget.hideUiErrors('id');
|
|
1072
|
-
```
|
|
1073
|
-
<a name="w_MultiWidget+setEnv" id="w_MultiWidget+setEnv" href="#user-content-w_MultiWidget+setEnv"> </a>
|
|
1074
|
-
|
|
1075
|
-
### htmlWidget.setEnv(env, [alias])
|
|
1076
|
-
Current method can change environment. By default environment = sandbox.
|
|
1077
|
-
Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
1078
|
-
|
|
1079
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
1080
|
-
**Overrides**: [<code>setEnv</code>](#user-content-w_MultiWidget+setEnv)
|
|
1081
|
-
|
|
1082
|
-
| Param | Type | Description |
|
|
1083
|
-
| --- | --- | --- |
|
|
1084
|
-
| env | <code>string</code> | sandbox, production |
|
|
1085
|
-
| [alias] | <code>string</code> | Own domain alias |
|
|
1086
|
-
|
|
1087
|
-
**Example**
|
|
1088
|
-
|
|
1089
|
-
```javascript
|
|
1090
|
-
widget.setEnv('production', 'paydock.com');
|
|
1091
|
-
```
|
|
1092
|
-
<a name="w_MultiWidget+loadIFrameUrl" id="w_MultiWidget+loadIFrameUrl" href="#user-content-w_MultiWidget+loadIFrameUrl"> </a>
|
|
1093
|
-
|
|
1094
|
-
### htmlWidget.loadIFrameUrl()
|
|
1095
|
-
Method for creating iframe url
|
|
1096
|
-
|
|
1097
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
1098
|
-
**Overrides**: [<code>loadIFrameUrl</code>](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
1099
|
-
**Example**
|
|
1100
|
-
|
|
1101
|
-
```javascript
|
|
1102
|
-
widget.loadIFrameUrl(function (url) {
|
|
1103
|
-
console.log(url);
|
|
1104
|
-
}, function (errors) {
|
|
1105
|
-
console.log(errors);
|
|
1106
|
-
});
|
|
1107
|
-
```
|
|
1108
|
-
<a name="w_MultiWidget+setLanguage" id="w_MultiWidget+setLanguage" href="#user-content-w_MultiWidget+setLanguage"> </a>
|
|
1109
|
-
|
|
1110
|
-
### htmlWidget.setLanguage(code)
|
|
1111
|
-
Method for setting a custom language code
|
|
1112
|
-
|
|
1113
|
-
**Kind**: instance method of [<code>HtmlWidget</code>](#user-content-w_HtmlWidget)
|
|
1114
|
-
**Overrides**: [<code>setLanguage</code>](#user-content-w_MultiWidget+setLanguage)
|
|
1115
|
-
|
|
1116
|
-
| Param | Type | Description |
|
|
1117
|
-
| --- | --- | --- |
|
|
1118
|
-
| code | <code>string</code> | ISO 639-1 |
|
|
1119
|
-
|
|
1120
|
-
**Example**
|
|
1121
|
-
|
|
1122
|
-
```javascript
|
|
1123
|
-
config.setLanguage('en');
|
|
1124
|
-
```
|
|
1125
|
-
<a name="w_HtmlMultiWidget" id="w_HtmlMultiWidget" href="#user-content-w_HtmlMultiWidget"> </a>
|
|
1126
|
-
|
|
1127
|
-
## HtmlMultiWidget ⇐ [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
1128
|
-
Class HtmlMultiWidget include method for working with html
|
|
1129
|
-
|
|
1130
|
-
**Kind**: global class
|
|
1131
|
-
**Extends**: [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
1132
|
-
|
|
1133
|
-
* [HtmlMultiWidget](#user-content-w_HtmlMultiWidget) ⇐ [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
1134
|
-
* [new HtmlMultiWidget(selector, publicKey, conf)](#user-content-w_new_HtmlMultiWidget_new)
|
|
1135
|
-
* [.load()](#user-content-w_HtmlMultiWidget+load)
|
|
1136
|
-
* [.afterLoad()](#user-content-w_HtmlMultiWidget+afterLoad)
|
|
1137
|
-
* [.trigger(triggers, data)](#user-content-w_HtmlMultiWidget+trigger)
|
|
1138
|
-
* [.getValidationState()](#user-content-w_HtmlMultiWidget+getValidationState) ⇒ [<code>IFormValidation</code>](#user-content-w_IFormValidation)
|
|
1139
|
-
* [.isValidForm()](#user-content-w_HtmlMultiWidget+isValidForm) ⇒ <code>boolean</code>
|
|
1140
|
-
* [.isInvalidField(field)](#user-content-w_HtmlMultiWidget+isInvalidField) ⇒ <code>boolean</code>
|
|
1141
|
-
* [.isFieldErrorShowed(field)](#user-content-w_HtmlMultiWidget+isFieldErrorShowed) ⇒ <code>boolean</code>
|
|
1142
|
-
* [.isInvalidFieldByValidator(field, validator)](#user-content-w_HtmlMultiWidget+isInvalidFieldByValidator) ⇒ <code>boolean</code>
|
|
1143
|
-
* [.hide([saveSize])](#user-content-w_HtmlMultiWidget+hide)
|
|
1144
|
-
* [.show()](#user-content-w_HtmlMultiWidget+show)
|
|
1145
|
-
* [.reload()](#user-content-w_HtmlMultiWidget+reload)
|
|
1146
|
-
* [.hideElements(elements)](#user-content-w_HtmlMultiWidget+hideElements)
|
|
1147
|
-
* [.showElements(elements)](#user-content-w_HtmlMultiWidget+showElements)
|
|
1148
|
-
* [.updateFormValues(fieldValues)](#user-content-w_HtmlMultiWidget+updateFormValues)
|
|
1149
|
-
* [.updateFormValue(key, value)](#user-content-w_HtmlMultiWidget+updateFormValue)
|
|
1150
|
-
* [.onFinishInsert(selector, dataType)](#user-content-w_HtmlMultiWidget+onFinishInsert)
|
|
1151
|
-
* [.interceptSubmitForm(selector)](#user-content-w_HtmlMultiWidget+interceptSubmitForm)
|
|
1152
|
-
* [.useCheckoutAutoSubmit()](#user-content-w_HtmlMultiWidget+useCheckoutAutoSubmit)
|
|
1153
|
-
* [.useAutoResize()](#user-content-w_HtmlMultiWidget+useAutoResize)
|
|
1154
|
-
* [.setStyles(fields)](#user-content-w_MultiWidget+setStyles)
|
|
1155
|
-
* [.usePhoneCountryMask([options])](#user-content-w_MultiWidget+usePhoneCountryMask)
|
|
1156
|
-
* [.setTexts(fields)](#user-content-w_MultiWidget+setTexts)
|
|
1157
|
-
* [.setElementStyle(element, [state], styles)](#user-content-w_MultiWidget+setElementStyle)
|
|
1158
|
-
* [.setFormValues(fieldValues)](#user-content-w_MultiWidget+setFormValues)
|
|
1159
|
-
* [.setFormLabels(fieldLabels)](#user-content-w_MultiWidget+setFormLabels)
|
|
1160
|
-
* [.setFormPlaceholders(fieldPlaceholders)](#user-content-w_MultiWidget+setFormPlaceholders)
|
|
1161
|
-
* [.setFormElements(elements)](#user-content-w_MultiWidget+setFormElements)
|
|
1162
|
-
* ~~[.setIcons()](#user-content-w_MultiWidget+setIcons)~~
|
|
1163
|
-
* [.setHiddenElements(elements)](#user-content-w_MultiWidget+setHiddenElements)
|
|
1164
|
-
* [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
|
|
1165
|
-
* [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
1166
|
-
* [.setSupportedCardIcons(elements, validateCardNumberInput)](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
1167
|
-
* [.hideUiErrors()](#user-content-w_MultiWidget+hideUiErrors)
|
|
1168
|
-
* [.setEnv(env, [alias])](#user-content-w_MultiWidget+setEnv)
|
|
1169
|
-
* [.loadIFrameUrl()](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
1170
|
-
* [.setLanguage(code)](#user-content-w_MultiWidget+setLanguage)
|
|
1171
|
-
|
|
1172
|
-
<a name="w_new_HtmlMultiWidget_new" id="w_new_HtmlMultiWidget_new" href="#user-content-w_new_HtmlMultiWidget_new"> </a>
|
|
1173
|
-
|
|
1174
|
-
### new HtmlMultiWidget(selector, publicKey, conf)
|
|
1175
|
-
|
|
1176
|
-
| Param | Type | Description |
|
|
1177
|
-
| --- | --- | --- |
|
|
1178
|
-
| selector | <code>string</code> | Selector of html element. Container for widget |
|
|
1179
|
-
| publicKey | <code>string</code> | PayDock users public key |
|
|
1180
|
-
| conf | [<code>Configuration</code>](#user-content-w_Configuration) \| <code>string</code> \| [<code>Array.<Configuration></code>](#user-content-w_Configuration) \| <code>Array.<string></code> | exemplar[s] Configuration class OR configuration token |
|
|
1181
|
-
|
|
1182
|
-
**Example**
|
|
1183
|
-
|
|
1184
|
-
```javascript
|
|
1185
|
-
var widget = new MultiWidget('#widget', 'publicKey','configurationToken'); // With a pre-created configuration token
|
|
1186
|
-
|
|
1187
|
-
var widget = new MultiWidget('#widget', 'publicKey',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
|
|
1188
|
-
|
|
1189
|
-
var widget = new MultiWidget('#widget', 'publicKey', new Configuration('gatewayId')); With Configuration
|
|
1190
|
-
|
|
1191
|
-
var widget = new MultiWidget('#widget', 'publicKey',[ With Configurations
|
|
1192
|
-
Configuration(), // default gateway_id,
|
|
1193
|
-
Configuration('not_configured'), // without gateway,
|
|
1194
|
-
Configuration('gatewayId'),
|
|
1195
|
-
Configuration('gatewayId', 'bank_account')
|
|
1196
|
-
]);
|
|
1197
|
-
```
|
|
1198
|
-
<a name="w_HtmlMultiWidget+load" id="w_HtmlMultiWidget+load" href="#user-content-w_HtmlMultiWidget+load"> </a>
|
|
1199
|
-
|
|
1200
|
-
### htmlMultiWidget.load()
|
|
1201
|
-
Loads the widget.
|
|
1202
|
-
|
|
1203
|
-
Calling this method results in an iframe element being inserted and rendered in the DOM.
|
|
1204
|
-
|
|
1205
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1206
|
-
<a name="w_HtmlMultiWidget+afterLoad" id="w_HtmlMultiWidget+afterLoad" href="#user-content-w_HtmlMultiWidget+afterLoad"> </a>
|
|
1207
|
-
|
|
1208
|
-
### htmlMultiWidget.afterLoad()
|
|
1209
|
-
Registers a form validation callback for validation events.
|
|
1210
|
-
|
|
1211
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1212
|
-
<a name="w_HtmlMultiWidget+trigger" id="w_HtmlMultiWidget+trigger" href="#user-content-w_HtmlMultiWidget+trigger"> </a>
|
|
1213
|
-
|
|
1214
|
-
### htmlMultiWidget.trigger(triggers, data)
|
|
1215
|
-
Registers callback that will be invoked for every trigger.
|
|
1216
|
-
|
|
1217
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1218
|
-
|
|
1219
|
-
| Param | Type | Description |
|
|
1220
|
-
| --- | --- | --- |
|
|
1221
|
-
| triggers | <code>'submit\_form'</code> \| <code>'tab'</code> | The Widget element identifier that caused the trigger. |
|
|
1222
|
-
| data | [<code>ITriggerData</code>](#user-content-w_ITriggerData) | Data that will be sent to the widget when the trigger occurs. |
|
|
1223
|
-
|
|
1224
|
-
<a name="w_HtmlMultiWidget+getValidationState" id="w_HtmlMultiWidget+getValidationState" href="#user-content-w_HtmlMultiWidget+getValidationState"> </a>
|
|
1225
|
-
|
|
1226
|
-
### htmlMultiWidget.getValidationState() ⇒ [<code>IFormValidation</code>](#user-content-w_IFormValidation)
|
|
1227
|
-
Gets a reference to the form current validation state.
|
|
1228
|
-
|
|
1229
|
-
!Warning: do not directly modify the values of the returned object.
|
|
1230
|
-
|
|
1231
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1232
|
-
**Returns**: [<code>IFormValidation</code>](#user-content-w_IFormValidation) - Form validation object
|
|
1233
|
-
<a name="w_HtmlMultiWidget+isValidForm" id="w_HtmlMultiWidget+isValidForm" href="#user-content-w_HtmlMultiWidget+isValidForm"> </a>
|
|
1234
|
-
|
|
1235
|
-
### htmlMultiWidget.isValidForm() ⇒ <code>boolean</code>
|
|
1236
|
-
Checks if a given form is valid.
|
|
1237
|
-
|
|
1238
|
-
A form is valid if all form fields are valid.
|
|
1239
|
-
|
|
1240
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1241
|
-
**Returns**: <code>boolean</code> - Indicates wether or not form is valid.
|
|
1242
|
-
<a name="w_HtmlMultiWidget+isInvalidField" id="w_HtmlMultiWidget+isInvalidField" href="#user-content-w_HtmlMultiWidget+isInvalidField"> </a>
|
|
1243
|
-
|
|
1244
|
-
### htmlMultiWidget.isInvalidField(field) ⇒ <code>boolean</code>
|
|
1245
|
-
Using this method you can check if a specific form field is invalid
|
|
1246
|
-
|
|
1247
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1248
|
-
**Returns**: <code>boolean</code> - Field is invalid
|
|
1249
|
-
|
|
1250
|
-
| Param | Type | Description |
|
|
1251
|
-
| --- | --- | --- |
|
|
1252
|
-
| field | <code>string</code> | Field name |
|
|
1253
|
-
|
|
1254
|
-
<a name="w_HtmlMultiWidget+isFieldErrorShowed" id="w_HtmlMultiWidget+isFieldErrorShowed" href="#user-content-w_HtmlMultiWidget+isFieldErrorShowed"> </a>
|
|
1255
|
-
|
|
1256
|
-
### htmlMultiWidget.isFieldErrorShowed(field) ⇒ <code>boolean</code>
|
|
1257
|
-
Checks if a given form field is displaying an error.
|
|
1258
|
-
|
|
1259
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1260
|
-
**Returns**: <code>boolean</code> - Indicates wether or not the Error message is being displayed on the associated field.
|
|
1261
|
-
|
|
1262
|
-
| Param | Type | Description |
|
|
1263
|
-
| --- | --- | --- |
|
|
1264
|
-
| field | <code>string</code> | The form field name |
|
|
1265
|
-
|
|
1266
|
-
<a name="w_HtmlMultiWidget+isInvalidFieldByValidator" id="w_HtmlMultiWidget+isInvalidFieldByValidator" href="#user-content-w_HtmlMultiWidget+isInvalidFieldByValidator"> </a>
|
|
1267
|
-
|
|
1268
|
-
### htmlMultiWidget.isInvalidFieldByValidator(field, validator) ⇒ <code>boolean</code>
|
|
1269
|
-
Checks if a given form field is valid or invalid by name.
|
|
1270
|
-
|
|
1271
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1272
|
-
**Returns**: <code>boolean</code> - Indicates wether or not the field is invalid based on validator intepretation.
|
|
1273
|
-
|
|
1274
|
-
| Param | Type | Description |
|
|
1275
|
-
| --- | --- | --- |
|
|
1276
|
-
| field | <code>string</code> | The form field name |
|
|
1277
|
-
| validator | | The name of the validator. |
|
|
1278
|
-
|
|
1279
|
-
<a name="w_HtmlMultiWidget+hide" id="w_HtmlMultiWidget+hide" href="#user-content-w_HtmlMultiWidget+hide"> </a>
|
|
1280
|
-
|
|
1281
|
-
### htmlMultiWidget.hide([saveSize])
|
|
1282
|
-
Hides the widget.
|
|
1283
|
-
|
|
1284
|
-
E.g., use this method to hide the widget after it loads.
|
|
1285
|
-
|
|
1286
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1287
|
-
|
|
1288
|
-
| Param | Type | Default | Description |
|
|
1289
|
-
| --- | --- | --- | --- |
|
|
1290
|
-
| [saveSize] | <code>boolean</code> | <code>false</code> | Wether the original iframe element size should be saved before being hidden. |
|
|
1291
|
-
|
|
1292
|
-
<a name="w_HtmlMultiWidget+show" id="w_HtmlMultiWidget+show" href="#user-content-w_HtmlMultiWidget+show"> </a>
|
|
1293
|
-
|
|
1294
|
-
### htmlMultiWidget.show()
|
|
1295
|
-
Shows the widget.
|
|
1296
|
-
|
|
1297
|
-
E.g., use this method to show the widget after it was explicitly hidden.
|
|
1298
|
-
|
|
1299
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1300
|
-
<a name="w_HtmlMultiWidget+reload" id="w_HtmlMultiWidget+reload" href="#user-content-w_HtmlMultiWidget+reload"> </a>
|
|
1301
|
-
|
|
1302
|
-
### htmlMultiWidget.reload()
|
|
1303
|
-
Reloads the widget.
|
|
1304
|
-
|
|
1305
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1306
|
-
<a name="w_HtmlMultiWidget+hideElements" id="w_HtmlMultiWidget+hideElements" href="#user-content-w_HtmlMultiWidget+hideElements"> </a>
|
|
1307
|
-
|
|
1308
|
-
### htmlMultiWidget.hideElements(elements)
|
|
1309
|
-
Hides the specified Widget elements by their identifier.
|
|
1310
|
-
|
|
1311
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1312
|
-
|
|
1313
|
-
| Param | Type | Description |
|
|
1314
|
-
| --- | --- | --- |
|
|
1315
|
-
| elements | <code>Array.<string></code> | List of element which can be hidden [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
1316
|
-
|
|
1317
|
-
**Example**
|
|
1318
|
-
```javascript
|
|
1319
|
-
widget.hideElements(['submit_button', 'email']);
|
|
1320
|
-
```
|
|
1321
|
-
<a name="w_HtmlMultiWidget+showElements" id="w_HtmlMultiWidget+showElements" href="#user-content-w_HtmlMultiWidget+showElements"> </a>
|
|
1322
|
-
|
|
1323
|
-
### htmlMultiWidget.showElements(elements)
|
|
1324
|
-
Shows the specified Widget elements by their identifier.
|
|
1325
|
-
|
|
1326
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1327
|
-
|
|
1328
|
-
| Param | Type | Description |
|
|
1329
|
-
| --- | --- | --- |
|
|
1330
|
-
| elements | <code>Array.<string></code> | List of elements which can be showed [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
1331
|
-
|
|
1332
|
-
**Example**
|
|
1333
|
-
```javascript
|
|
1334
|
-
widget.showElements(['submit_button', 'email']);
|
|
1335
|
-
```
|
|
1336
|
-
<a name="w_HtmlMultiWidget+updateFormValues" id="w_HtmlMultiWidget+updateFormValues" href="#user-content-w_HtmlMultiWidget+updateFormValues"> </a>
|
|
1337
|
-
|
|
1338
|
-
### htmlMultiWidget.updateFormValues(fieldValues)
|
|
1339
|
-
Updates the form field values inside the widget.
|
|
1340
|
-
|
|
1341
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1342
|
-
|
|
1343
|
-
| Param | Type | Description |
|
|
1344
|
-
| --- | --- | --- |
|
|
1345
|
-
| fieldValues | <code>IFormValues</code> | Fields with values |
|
|
1346
|
-
|
|
1347
|
-
**Example**
|
|
1348
|
-
```javascript
|
|
1349
|
-
widget.updateFormValues({
|
|
1350
|
-
email: 'predefined@email.com',
|
|
1351
|
-
card_name: 'Houston'
|
|
1352
|
-
});
|
|
1353
|
-
```
|
|
1354
|
-
<a name="w_HtmlMultiWidget+updateFormValue" id="w_HtmlMultiWidget+updateFormValue" href="#user-content-w_HtmlMultiWidget+updateFormValue"> </a>
|
|
1355
|
-
|
|
1356
|
-
### htmlMultiWidget.updateFormValue(key, value)
|
|
1357
|
-
Updates a single form field values inside the widget by the form field name.
|
|
1358
|
-
|
|
1359
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1360
|
-
|
|
1361
|
-
| Param | Type | Description |
|
|
1362
|
-
| --- | --- | --- |
|
|
1363
|
-
| key | <code>string</code> | The form field name |
|
|
1364
|
-
| value | <code>string</code> | The form field value |
|
|
1365
|
-
|
|
1366
|
-
**Example**
|
|
1367
|
-
```javascript
|
|
1368
|
-
widget.updateFormValue("card_name", "John Doe");
|
|
1369
|
-
```
|
|
1370
|
-
<a name="w_HtmlMultiWidget+onFinishInsert" id="w_HtmlMultiWidget+onFinishInsert" href="#user-content-w_HtmlMultiWidget+onFinishInsert"> </a>
|
|
1371
|
-
|
|
1372
|
-
### htmlMultiWidget.onFinishInsert(selector, dataType)
|
|
1373
|
-
Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
|
|
1374
|
-
|
|
1375
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1376
|
-
|
|
1377
|
-
| Param | Type | Description |
|
|
1378
|
-
| --- | --- | --- |
|
|
1379
|
-
| selector | <code>string</code> | A CSS selector. E.g., ".my-class", "#my-id", or others |
|
|
1380
|
-
| dataType | <code>string</code> | The data type of IEventData object. |
|
|
1381
|
-
|
|
1382
|
-
<a name="w_HtmlMultiWidget+interceptSubmitForm" id="w_HtmlMultiWidget+interceptSubmitForm" href="#user-content-w_HtmlMultiWidget+interceptSubmitForm"> </a>
|
|
1383
|
-
|
|
1384
|
-
### htmlMultiWidget.interceptSubmitForm(selector)
|
|
1385
|
-
Intercepts a form submission and delegates processing to the widget.
|
|
1386
|
-
|
|
1387
|
-
An simplified example of the process:
|
|
1388
|
-
- User clicks submit button in your form
|
|
1389
|
-
- This implicitly triggers a submission to the widget
|
|
1390
|
-
- The widget submits your form
|
|
1391
|
-
|
|
1392
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1393
|
-
**Note**: The widget's submit button will be hidden.
|
|
1394
|
-
|
|
1395
|
-
| Param | Type | Description |
|
|
1396
|
-
| --- | --- | --- |
|
|
1397
|
-
| selector | <code>string</code> | css selector of your form |
|
|
1398
|
-
|
|
1399
|
-
**Example**
|
|
1400
|
-
```html
|
|
1401
|
-
<body>
|
|
1402
|
-
<form id="myForm">
|
|
1403
|
-
<input name="amount">
|
|
1404
|
-
<button type="submit">Submit</button>
|
|
1405
|
-
</form>
|
|
1406
|
-
<script>
|
|
1407
|
-
widget.interceptSubmitForm('#myForm');
|
|
1408
|
-
</script>
|
|
1409
|
-
</body>
|
|
1410
|
-
```
|
|
1411
|
-
<a name="w_HtmlMultiWidget+useCheckoutAutoSubmit" id="w_HtmlMultiWidget+useCheckoutAutoSubmit" href="#user-content-w_HtmlMultiWidget+useCheckoutAutoSubmit"> </a>
|
|
1412
|
-
|
|
1413
|
-
### htmlMultiWidget.useCheckoutAutoSubmit()
|
|
1414
|
-
This method hides a submit button and automatically execute form submit
|
|
1415
|
-
|
|
1416
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1417
|
-
<a name="w_HtmlMultiWidget+useAutoResize" id="w_HtmlMultiWidget+useAutoResize" href="#user-content-w_HtmlMultiWidget+useAutoResize"> </a>
|
|
1418
|
-
|
|
1419
|
-
### htmlMultiWidget.useAutoResize()
|
|
1420
|
-
Use this method for resize iFrame according content height
|
|
1421
|
-
|
|
1422
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1423
|
-
**Example**
|
|
1424
|
-
```javascript
|
|
1425
|
-
widget.useAutoResize();
|
|
1426
|
-
```
|
|
1427
|
-
<a name="w_MultiWidget+setStyles" id="w_MultiWidget+setStyles" href="#user-content-w_MultiWidget+setStyles"> </a>
|
|
1428
|
-
|
|
1429
|
-
### htmlMultiWidget.setStyles(fields)
|
|
1430
|
-
Object contain styles for widget
|
|
1431
|
-
|
|
1432
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1433
|
-
**Overrides**: [<code>setStyles</code>](#user-content-w_MultiWidget+setStyles)
|
|
1434
|
-
|
|
1435
|
-
| Param | Type | Description |
|
|
1436
|
-
| --- | --- | --- |
|
|
1437
|
-
| fields | [<code>IStyles</code>](#user-content-w_IStyles) | name of styles which can be shown in widget [STYLE](#user-content-w_STYLE) |
|
|
1438
|
-
|
|
1439
|
-
**Example**
|
|
1440
|
-
|
|
1441
|
-
```javascript
|
|
1442
|
-
widget.setStyles({
|
|
1443
|
-
background_color: 'rgb(0, 0, 0)',
|
|
1444
|
-
border_color: 'yellow',
|
|
1445
|
-
text_color: '#FFFFAA',
|
|
1446
|
-
button_color: 'rgba(255, 255, 255, 0.9)',
|
|
1447
|
-
font_size: '20px'
|
|
1448
|
-
fort_family: 'fantasy'
|
|
1449
|
-
});
|
|
1450
|
-
```
|
|
1451
|
-
<a name="w_MultiWidget+usePhoneCountryMask" id="w_MultiWidget+usePhoneCountryMask" href="#user-content-w_MultiWidget+usePhoneCountryMask"> </a>
|
|
1452
|
-
|
|
1453
|
-
### htmlMultiWidget.usePhoneCountryMask([options])
|
|
1454
|
-
Method to set a country code mask for the phone input.
|
|
1455
|
-
|
|
1456
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1457
|
-
**Overrides**: [<code>usePhoneCountryMask</code>](#user-content-w_MultiWidget+usePhoneCountryMask)
|
|
1458
|
-
|
|
1459
|
-
| Param | Type | Description |
|
|
1460
|
-
| --- | --- | --- |
|
|
1461
|
-
| [options] | <code>object</code> | Options for configure the phone mask. |
|
|
1462
|
-
| [options.default_country] | <code>string</code> | Set a default country for the mask. |
|
|
1463
|
-
| [options.preferred_countries] | <code>Array.<string></code> | Set list of preferred countries for the top of the select box . |
|
|
1464
|
-
| [options.only_countries] | <code>Array.<string></code> | Set list of countries to show in the select box. |
|
|
1465
|
-
|
|
1466
|
-
**Example**
|
|
1467
|
-
|
|
1468
|
-
```javascript
|
|
1469
|
-
widget.usePhoneCountryMask();
|
|
1470
|
-
```
|
|
1471
|
-
**Example**
|
|
1472
|
-
|
|
1473
|
-
```javascript
|
|
1474
|
-
widget.usePhoneCountryMask({
|
|
1475
|
-
default_country: 'au',
|
|
1476
|
-
preferred_countries: ['au', 'gb'],
|
|
1477
|
-
only_countries: ['au', 'gb', 'us', 'ua']
|
|
1478
|
-
});
|
|
1479
|
-
```
|
|
1480
|
-
<a name="w_MultiWidget+setTexts" id="w_MultiWidget+setTexts" href="#user-content-w_MultiWidget+setTexts"> </a>
|
|
1481
|
-
|
|
1482
|
-
### htmlMultiWidget.setTexts(fields)
|
|
1483
|
-
Method for set different texts inside the widget
|
|
1484
|
-
|
|
1485
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1486
|
-
**Overrides**: [<code>setTexts</code>](#user-content-w_MultiWidget+setTexts)
|
|
1487
|
-
|
|
1488
|
-
| Param | Type | Description |
|
|
1489
|
-
| --- | --- | --- |
|
|
1490
|
-
| fields | [<code>ITexts</code>](#user-content-w_ITexts) | name of text items which can be shown in widget [TEXT](#user-content-w_TEXT) |
|
|
1491
|
-
|
|
1492
|
-
**Example**
|
|
1493
|
-
|
|
1494
|
-
```javascript
|
|
1495
|
-
widget.setTexts({
|
|
1496
|
-
title: 'Your card',
|
|
1497
|
-
finish_text: 'Payment resource was successfully accepted',
|
|
1498
|
-
title_description: '* indicates required field',
|
|
1499
|
-
submit_button: 'Save',
|
|
1500
|
-
submit_button_processing: 'Load...',
|
|
1501
|
-
});
|
|
1502
|
-
```
|
|
1503
|
-
<a name="w_MultiWidget+setElementStyle" id="w_MultiWidget+setElementStyle" href="#user-content-w_MultiWidget+setElementStyle"> </a>
|
|
1504
|
-
|
|
1505
|
-
### htmlMultiWidget.setElementStyle(element, [state], styles)
|
|
1506
|
-
Method for set styles for different elements and states
|
|
1507
|
-
|
|
1508
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1509
|
-
**Overrides**: [<code>setElementStyle</code>](#user-content-w_MultiWidget+setElementStyle)
|
|
1510
|
-
|
|
1511
|
-
| Param | Type | Description |
|
|
1512
|
-
| --- | --- | --- |
|
|
1513
|
-
| element | <code>string</code> | type of element for styling. These elements are available [STYLABLE_ELEMENT](#user-content-w_STYLABLE_ELEMENT) |
|
|
1514
|
-
| [state] | <code>string</code> | state of element for styling. These states are available [STYLABLE_ELEMENT_STATE](#user-content-w_STYLABLE_ELEMENT_STATE) |
|
|
1515
|
-
| styles | [<code>IElementStyleInput</code>](#user-content-w_IElementStyleInput) \| [<code>IElementStyleSubmitButton</code>](#user-content-w_IElementStyleSubmitButton) \| [<code>IElementStyleLabel</code>](#user-content-w_IElementStyleLabel) \| [<code>IElementStyleTitle</code>](#user-content-w_IElementStyleTitle) \| [<code>IElementStyleTitleDescription</code>](#user-content-w_IElementStyleTitleDescription) | styles list |
|
|
1516
|
-
|
|
1517
|
-
**Example**
|
|
1518
|
-
|
|
1519
|
-
```javascript
|
|
1520
|
-
widget.setElementStyle('input', {
|
|
1521
|
-
border: 'green solid 1px'
|
|
1522
|
-
});
|
|
1523
|
-
|
|
1524
|
-
widget.setElementStyle('input', 'focus', {
|
|
1525
|
-
border: 'blue solid 1px'
|
|
1526
|
-
});
|
|
1527
|
-
|
|
1528
|
-
widget.setElementStyle('input', 'error', {
|
|
1529
|
-
border: 'red solid 1px'
|
|
1530
|
-
});
|
|
1531
|
-
```
|
|
1532
|
-
<a name="w_MultiWidget+setFormValues" id="w_MultiWidget+setFormValues" href="#user-content-w_MultiWidget+setFormValues"> </a>
|
|
1533
|
-
|
|
1534
|
-
### htmlMultiWidget.setFormValues(fieldValues)
|
|
1535
|
-
The method to set the predefined values for the form fields inside the widget
|
|
1536
|
-
|
|
1537
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1538
|
-
**Overrides**: [<code>setFormValues</code>](#user-content-w_MultiWidget+setFormValues)
|
|
1539
|
-
|
|
1540
|
-
| Param | Type | Description |
|
|
1541
|
-
| --- | --- | --- |
|
|
1542
|
-
| fieldValues | <code>Object</code> | Key of object is one of [FORM_FIELD](#user-content-w_FORM_FIELD), The object value is what we are expecting |
|
|
1543
|
-
|
|
1544
|
-
**Example**
|
|
1545
|
-
|
|
1546
|
-
```javascript
|
|
1547
|
-
widget.setFormValues({
|
|
1548
|
-
email: 'predefined@email.com',
|
|
1549
|
-
card_name: 'Houston'
|
|
1550
|
-
});
|
|
1551
|
-
```
|
|
1552
|
-
<a name="w_MultiWidget+setFormLabels" id="w_MultiWidget+setFormLabels" href="#user-content-w_MultiWidget+setFormLabels"> </a>
|
|
1553
|
-
|
|
1554
|
-
### htmlMultiWidget.setFormLabels(fieldLabels)
|
|
1555
|
-
The method to set custom form field labels
|
|
1556
|
-
|
|
1557
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1558
|
-
**Overrides**: [<code>setFormLabels</code>](#user-content-w_MultiWidget+setFormLabels)
|
|
1559
|
-
|
|
1560
|
-
| Param | Type | Description |
|
|
1561
|
-
| --- | --- | --- |
|
|
1562
|
-
| fieldLabels | <code>Object</code> | Key of object is one of [FORM_FIELD](#user-content-w_FORM_FIELD), The object value is what we are expecting |
|
|
1563
|
-
|
|
1564
|
-
**Example**
|
|
1565
|
-
|
|
1566
|
-
```javascript
|
|
1567
|
-
widget.setFormPlaceholders({
|
|
1568
|
-
card_name: 'Card Holder Name',
|
|
1569
|
-
email: 'Email For Receipt'
|
|
1570
|
-
})
|
|
1571
|
-
```
|
|
1572
|
-
<a name="w_MultiWidget+setFormPlaceholders" id="w_MultiWidget+setFormPlaceholders" href="#user-content-w_MultiWidget+setFormPlaceholders"> </a>
|
|
1573
|
-
|
|
1574
|
-
### htmlMultiWidget.setFormPlaceholders(fieldPlaceholders)
|
|
1575
|
-
The method to set custom form fields placeholders
|
|
1576
|
-
|
|
1577
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1578
|
-
**Overrides**: [<code>setFormPlaceholders</code>](#user-content-w_MultiWidget+setFormPlaceholders)
|
|
1579
|
-
|
|
1580
|
-
| Param | Type | Description |
|
|
1581
|
-
| --- | --- | --- |
|
|
1582
|
-
| fieldPlaceholders | <code>Object</code> | Key of object is one of [FORM_FIELD](#user-content-w_FORM_FIELD), Value of object is expected placeholder |
|
|
1583
|
-
|
|
1584
|
-
**Example**
|
|
1585
|
-
|
|
1586
|
-
```javascript
|
|
1587
|
-
widget.setFormPlaceholders({
|
|
1588
|
-
card_name: 'Input your card holder name...',
|
|
1589
|
-
email: 'Input your email, like test@example.com'
|
|
1590
|
-
})
|
|
1591
|
-
```
|
|
1592
|
-
<a name="w_MultiWidget+setFormElements" id="w_MultiWidget+setFormElements" href="#user-content-w_MultiWidget+setFormElements"> </a>
|
|
1593
|
-
|
|
1594
|
-
### htmlMultiWidget.setFormElements(elements)
|
|
1595
|
-
The method to set the full configuration for the all specific form elements (label, placeholder, value)
|
|
1596
|
-
You can also use the other method for the partial configuration like: setFormValues, setFormPlaceholder, setFormLabel
|
|
1597
|
-
|
|
1598
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1599
|
-
**Overrides**: [<code>setFormElements</code>](#user-content-w_MultiWidget+setFormElements)
|
|
1600
|
-
|
|
1601
|
-
| Param | Type | Description |
|
|
1602
|
-
| --- | --- | --- |
|
|
1603
|
-
| elements | <code>string</code> | The list of elements |
|
|
1604
|
-
| elements[].field | <code>string</code> | Field name of the element [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
1605
|
-
| elements[].placeholder | <code>string</code> | Set custom form field placeholder |
|
|
1606
|
-
| elements[].label | <code>string</code> | Set custom labels near form field |
|
|
1607
|
-
| elements[].value | <code>string</code> | Set predefined values for the form field |
|
|
1608
|
-
|
|
1609
|
-
**Example**
|
|
1610
|
-
|
|
1611
|
-
```javascript
|
|
1612
|
-
widget.setFormElements([
|
|
1613
|
-
{
|
|
1614
|
-
field: 'card_name',
|
|
1615
|
-
placeholder: 'Input your card holder name...',
|
|
1616
|
-
label: 'Card Holder Name',
|
|
1617
|
-
value: 'Houston',
|
|
1618
|
-
},
|
|
1619
|
-
{
|
|
1620
|
-
field: 'email',
|
|
1621
|
-
placeholder: 'Input your email, like test@example.com',
|
|
1622
|
-
label: 'Email For Receipt',
|
|
1623
|
-
value: 'predefined@email.com',
|
|
1624
|
-
},
|
|
1625
|
-
])
|
|
1626
|
-
```
|
|
1627
|
-
<a name="w_MultiWidget+setIcons" id="w_MultiWidget+setIcons" href="#user-content-w_MultiWidget+setIcons"> </a>
|
|
1628
|
-
|
|
1629
|
-
### ~~htmlMultiWidget.setIcons()~~
|
|
1630
|
-
***Deprecated***
|
|
1631
|
-
|
|
1632
|
-
The method to change the widget icons
|
|
1633
|
-
|
|
1634
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1635
|
-
**Overrides**: [<code>setIcons</code>](#user-content-w_MultiWidget+setIcons)
|
|
1636
|
-
<a name="w_MultiWidget+setHiddenElements" id="w_MultiWidget+setHiddenElements" href="#user-content-w_MultiWidget+setHiddenElements"> </a>
|
|
1637
|
-
|
|
1638
|
-
### htmlMultiWidget.setHiddenElements(elements)
|
|
1639
|
-
Using this method you can set hidden elements inside widget
|
|
1640
|
-
|
|
1641
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1642
|
-
**Overrides**: [<code>setHiddenElements</code>](#user-content-w_MultiWidget+setHiddenElements)
|
|
1643
|
-
|
|
1644
|
-
| Param | Type | Description |
|
|
1645
|
-
| --- | --- | --- |
|
|
1646
|
-
| elements | <code>Array.<string></code> | list of element which can be hidden [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
1647
|
-
|
|
1648
|
-
**Example**
|
|
1649
|
-
|
|
1650
|
-
```javascript
|
|
1651
|
-
widget.setHiddenElements(['submit_button', 'email']);
|
|
1652
|
-
```
|
|
1653
|
-
<a name="w_MultiWidget+setRefId" id="w_MultiWidget+setRefId" href="#user-content-w_MultiWidget+setRefId"> </a>
|
|
1654
|
-
|
|
1655
|
-
### htmlMultiWidget.setRefId(refId)
|
|
1656
|
-
Current method can set custom ID to identify the data in the future
|
|
1657
|
-
|
|
1658
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1659
|
-
**Overrides**: [<code>setRefId</code>](#user-content-w_MultiWidget+setRefId)
|
|
1660
|
-
|
|
1661
|
-
| Param | Type | Description |
|
|
1662
|
-
| --- | --- | --- |
|
|
1663
|
-
| refId | <code>string</code> | custom id |
|
|
1664
|
-
|
|
1665
|
-
**Example**
|
|
1666
|
-
|
|
1667
|
-
```javascript
|
|
1668
|
-
widget.setRefId('id');
|
|
1669
|
-
```
|
|
1670
|
-
<a name="w_MultiWidget+useGatewayFieldValidation" id="w_MultiWidget+useGatewayFieldValidation" href="#user-content-w_MultiWidget+useGatewayFieldValidation"> </a>
|
|
1671
|
-
|
|
1672
|
-
### htmlMultiWidget.useGatewayFieldValidation()
|
|
1673
|
-
Current method can add visual validation from gateway to widget's form fields
|
|
1674
|
-
|
|
1675
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1676
|
-
**Overrides**: [<code>useGatewayFieldValidation</code>](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
1677
|
-
**Example**
|
|
1678
|
-
|
|
1679
|
-
```javascript
|
|
1680
|
-
widget.useGatewayFieldValidation();
|
|
1681
|
-
```
|
|
1682
|
-
<a name="w_MultiWidget+setSupportedCardIcons" id="w_MultiWidget+setSupportedCardIcons" href="#user-content-w_MultiWidget+setSupportedCardIcons"> </a>
|
|
1683
|
-
|
|
1684
|
-
### htmlMultiWidget.setSupportedCardIcons(elements, validateCardNumberInput)
|
|
1685
|
-
Current method can set icons of supported card types
|
|
1686
|
-
|
|
1687
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1688
|
-
**Overrides**: [<code>setSupportedCardIcons</code>](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
1689
|
-
|
|
1690
|
-
| Param | Type | Description |
|
|
1691
|
-
| --- | --- | --- |
|
|
1692
|
-
| elements | <code>Array.<string></code> | [SUPPORTED_CARD_TYPES](#user-content-w_SUPPORTED_CARD_TYPES) |
|
|
1693
|
-
| validateCardNumberInput | <code>boolean</code> | [validateCardNumberInput=false] - using this param you allow validation for card number input on supported card types |
|
|
1694
|
-
|
|
1695
|
-
**Example**
|
|
1696
|
-
|
|
1697
|
-
```javascript
|
|
1698
|
-
widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
|
|
1699
|
-
```
|
|
1700
|
-
<a name="w_MultiWidget+hideUiErrors" id="w_MultiWidget+hideUiErrors" href="#user-content-w_MultiWidget+hideUiErrors"> </a>
|
|
1701
|
-
|
|
1702
|
-
### htmlMultiWidget.hideUiErrors()
|
|
1703
|
-
Current method can hide prevent the widget from showing the error messages
|
|
1704
|
-
|
|
1705
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1706
|
-
**Overrides**: [<code>hideUiErrors</code>](#user-content-w_MultiWidget+hideUiErrors)
|
|
1707
|
-
**Example**
|
|
1708
|
-
|
|
1709
|
-
```javascript
|
|
1710
|
-
widget.hideUiErrors('id');
|
|
1711
|
-
```
|
|
1712
|
-
<a name="w_MultiWidget+setEnv" id="w_MultiWidget+setEnv" href="#user-content-w_MultiWidget+setEnv"> </a>
|
|
1713
|
-
|
|
1714
|
-
### htmlMultiWidget.setEnv(env, [alias])
|
|
1715
|
-
Current method can change environment. By default environment = sandbox.
|
|
1716
|
-
Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
1717
|
-
|
|
1718
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1719
|
-
**Overrides**: [<code>setEnv</code>](#user-content-w_MultiWidget+setEnv)
|
|
1720
|
-
|
|
1721
|
-
| Param | Type | Description |
|
|
1722
|
-
| --- | --- | --- |
|
|
1723
|
-
| env | <code>string</code> | sandbox, production |
|
|
1724
|
-
| [alias] | <code>string</code> | Own domain alias |
|
|
1725
|
-
|
|
1726
|
-
**Example**
|
|
1727
|
-
|
|
1728
|
-
```javascript
|
|
1729
|
-
widget.setEnv('production', 'paydock.com');
|
|
1730
|
-
```
|
|
1731
|
-
<a name="w_MultiWidget+loadIFrameUrl" id="w_MultiWidget+loadIFrameUrl" href="#user-content-w_MultiWidget+loadIFrameUrl"> </a>
|
|
1732
|
-
|
|
1733
|
-
### htmlMultiWidget.loadIFrameUrl()
|
|
1734
|
-
Method for creating iframe url
|
|
1735
|
-
|
|
1736
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1737
|
-
**Overrides**: [<code>loadIFrameUrl</code>](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
1738
|
-
**Example**
|
|
1739
|
-
|
|
1740
|
-
```javascript
|
|
1741
|
-
widget.loadIFrameUrl(function (url) {
|
|
1742
|
-
console.log(url);
|
|
1743
|
-
}, function (errors) {
|
|
1744
|
-
console.log(errors);
|
|
1745
|
-
});
|
|
1746
|
-
```
|
|
1747
|
-
<a name="w_MultiWidget+setLanguage" id="w_MultiWidget+setLanguage" href="#user-content-w_MultiWidget+setLanguage"> </a>
|
|
1748
|
-
|
|
1749
|
-
### htmlMultiWidget.setLanguage(code)
|
|
1750
|
-
Method for setting a custom language code
|
|
1751
|
-
|
|
1752
|
-
**Kind**: instance method of [<code>HtmlMultiWidget</code>](#user-content-w_HtmlMultiWidget)
|
|
1753
|
-
**Overrides**: [<code>setLanguage</code>](#user-content-w_MultiWidget+setLanguage)
|
|
1754
|
-
|
|
1755
|
-
| Param | Type | Description |
|
|
1756
|
-
| --- | --- | --- |
|
|
1757
|
-
| code | <code>string</code> | ISO 639-1 |
|
|
1758
|
-
|
|
1759
|
-
**Example**
|
|
1760
|
-
|
|
1761
|
-
```javascript
|
|
1762
|
-
config.setLanguage('en');
|
|
1763
|
-
```
|
|
1764
|
-
<a name="w_Configuration" id="w_Configuration" href="#user-content-w_Configuration"> </a>
|
|
1765
|
-
|
|
1766
|
-
## Configuration
|
|
1767
|
-
Class Configuration include methods for creating configuration token
|
|
1768
|
-
|
|
1769
|
-
**Kind**: global class
|
|
1770
|
-
|
|
1771
|
-
* [Configuration](#user-content-w_Configuration)
|
|
1772
|
-
* [new Configuration([gatewayID], paymentType, purpose)](#user-content-w_new_Configuration_new)
|
|
1773
|
-
* [.setWebHookDestination(url)](#user-content-w_Configuration+setWebHookDestination)
|
|
1774
|
-
* [.setSuccessRedirectUrl(url)](#user-content-w_Configuration+setSuccessRedirectUrl)
|
|
1775
|
-
* [.setErrorRedirectUrl(url)](#user-content-w_Configuration+setErrorRedirectUrl)
|
|
1776
|
-
* [.setFormFields(fields)](#user-content-w_Configuration+setFormFields)
|
|
1777
|
-
* [.setMeta(object)](#user-content-w_Configuration+setMeta)
|
|
1778
|
-
* [.setEnv(env, [alias])](#user-content-w_Configuration+setEnv)
|
|
1779
|
-
* [.setLabel(label)](#user-content-w_Configuration+setLabel)
|
|
1780
|
-
* [.createToken(accessToken, cb, errorCb)](#user-content-w_Configuration+createToken)
|
|
1781
|
-
|
|
1782
|
-
<a name="w_new_Configuration_new" id="w_new_Configuration_new" href="#user-content-w_new_Configuration_new"> </a>
|
|
1783
|
-
|
|
1784
|
-
### new Configuration([gatewayID], paymentType, purpose)
|
|
1785
|
-
|
|
1786
|
-
| Param | Type | Default | Description |
|
|
1787
|
-
| --- | --- | --- | --- |
|
|
1788
|
-
| [gatewayID] | <code>string</code> | <code>"default"</code> | gateway ID. By default or if put 'default', it will use the selected default gateway. If put 'not_configured', it won’t use gateway to create downstream token. |
|
|
1789
|
-
| paymentType | <code>string</code> | | Type of payment source which shows in widget form. Available parameters [PAYMENT_TYPE](#user-content-w_PAYMENT_TYPE) |
|
|
1790
|
-
| purpose | <code>string</code> | | Param which describes payment purpose. By default uses Available parameters [PURPOSE](#user-content-w_PURPOSE) |
|
|
1791
|
-
|
|
1792
|
-
**Example**
|
|
1793
|
-
|
|
1794
|
-
```javascript
|
|
1795
|
-
var config = new Configuration('gatewayId'); // short
|
|
1796
|
-
|
|
1797
|
-
var config = new Configuration('gatewayId', 'bank_account', 'paymentSource'); // extend
|
|
1798
|
-
|
|
1799
|
-
var config = new Configuration('not_configured'); // without gateway
|
|
1800
|
-
```
|
|
1801
|
-
<a name="w_Configuration+setWebHookDestination" id="w_Configuration+setWebHookDestination" href="#user-content-w_Configuration+setWebHookDestination"> </a>
|
|
1802
|
-
|
|
1803
|
-
### configuration.setWebHookDestination(url)
|
|
1804
|
-
Destination, where customer will receive all successful responses.
|
|
1805
|
-
Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
|
|
1806
|
-
|
|
1807
|
-
**Kind**: instance method of [<code>Configuration</code>](#user-content-w_Configuration)
|
|
1808
|
-
|
|
1809
|
-
| Param | Type | Description |
|
|
1810
|
-
| --- | --- | --- |
|
|
1811
|
-
| url | <code>string</code> | Your endpoint for post request. |
|
|
1812
|
-
|
|
1813
|
-
**Example**
|
|
1814
|
-
|
|
1815
|
-
```javascript
|
|
1816
|
-
config.setWebHookDestination('http://google.com');
|
|
1817
|
-
```
|
|
1818
|
-
<a name="w_Configuration+setSuccessRedirectUrl" id="w_Configuration+setSuccessRedirectUrl" href="#user-content-w_Configuration+setSuccessRedirectUrl"> </a>
|
|
1819
|
-
|
|
1820
|
-
### configuration.setSuccessRedirectUrl(url)
|
|
1821
|
-
URL to which the Customer will be redirected to after the success finish
|
|
1822
|
-
|
|
1823
|
-
**Kind**: instance method of [<code>Configuration</code>](#user-content-w_Configuration)
|
|
1824
|
-
|
|
1825
|
-
| Param | Type |
|
|
1826
|
-
| --- | --- |
|
|
1827
|
-
| url | <code>string</code> |
|
|
1828
|
-
|
|
1829
|
-
**Example**
|
|
1830
|
-
|
|
1831
|
-
```javascript
|
|
1832
|
-
config.setSuccessRedirectUrl('google.com/search?q=success');
|
|
1833
|
-
```
|
|
1834
|
-
<a name="w_Configuration+setErrorRedirectUrl" id="w_Configuration+setErrorRedirectUrl" href="#user-content-w_Configuration+setErrorRedirectUrl"> </a>
|
|
1835
|
-
|
|
1836
|
-
### configuration.setErrorRedirectUrl(url)
|
|
1837
|
-
URL to which the Customer will be redirected to if an error is triggered in the process of operation
|
|
1838
|
-
|
|
1839
|
-
**Kind**: instance method of [<code>Configuration</code>](#user-content-w_Configuration)
|
|
1840
|
-
|
|
1841
|
-
| Param | Type |
|
|
1842
|
-
| --- | --- |
|
|
1843
|
-
| url | <code>string</code> |
|
|
1844
|
-
|
|
1845
|
-
**Example**
|
|
1846
|
-
|
|
1847
|
-
```javascript
|
|
1848
|
-
config.setErrorRedirectUrl('google.com/search?q=error');
|
|
1849
|
-
```
|
|
1850
|
-
<a name="w_Configuration+setFormFields" id="w_Configuration+setFormFields" href="#user-content-w_Configuration+setFormFields"> </a>
|
|
1851
|
-
|
|
1852
|
-
### configuration.setFormFields(fields)
|
|
1853
|
-
Set list with widget form field, which will be shown in form. Also you can set the required validation for these fields
|
|
1854
|
-
|
|
1855
|
-
**Kind**: instance method of [<code>Configuration</code>](#user-content-w_Configuration)
|
|
1856
|
-
|
|
1857
|
-
| Param | Type | Description |
|
|
1858
|
-
| --- | --- | --- |
|
|
1859
|
-
| fields | <code>Array.<string></code> | name of fields which can be shown in a widget. If after a name of a field, you put “*”, this field will be required on client-side. (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
1860
|
-
|
|
1861
|
-
**Example**
|
|
1862
|
-
|
|
1863
|
-
```javascript
|
|
1864
|
-
config.setFormFields(['phone', 'email', 'first_name*']);
|
|
1865
|
-
```
|
|
1866
|
-
<a name="w_Configuration+setMeta" id="w_Configuration+setMeta" href="#user-content-w_Configuration+setMeta"> </a>
|
|
1867
|
-
|
|
1868
|
-
### configuration.setMeta(object)
|
|
1869
|
-
Method for setting meta information for checkout page
|
|
1870
|
-
|
|
1871
|
-
**Kind**: instance method of [<code>Configuration</code>](#user-content-w_Configuration)
|
|
1872
|
-
|
|
1873
|
-
| Param | Type | Description |
|
|
1874
|
-
| --- | --- | --- |
|
|
1875
|
-
| object | [<code>IPayPalMeta</code>](#user-content-w_IPayPalMeta) \| <code>IZipmoneyMeta</code> \| <code>IAfterpayMeta</code> \| [<code>IBamboraMeta</code>](#user-content-w_IBamboraMeta) | data which can be shown on checkout page [IPayPalMeta](#user-content-w_IPayPalMeta) [IZipmoneyMeta](IZipmoneyMeta) [IAfterpayMeta](IAfterpayMeta) [IBamboraMeta](#user-content-w_IBamboraMeta) |
|
|
1876
|
-
|
|
1877
|
-
**Example**
|
|
1878
|
-
|
|
1879
|
-
```javascript
|
|
1880
|
-
config.setMeta({
|
|
1881
|
-
brand_name: 'paydock',
|
|
1882
|
-
reference: '15',
|
|
1883
|
-
email: 'wault@paydock.com'
|
|
1884
|
-
});
|
|
1885
|
-
```
|
|
1886
|
-
<a name="w_Configuration+setEnv" id="w_Configuration+setEnv" href="#user-content-w_Configuration+setEnv"> </a>
|
|
1887
|
-
|
|
1888
|
-
### configuration.setEnv(env, [alias])
|
|
1889
|
-
Current method can change environment. By default environment = sandbox.
|
|
1890
|
-
Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
1891
|
-
|
|
1892
|
-
**Kind**: instance method of [<code>Configuration</code>](#user-content-w_Configuration)
|
|
1893
|
-
|
|
1894
|
-
| Param | Type | Description |
|
|
1895
|
-
| --- | --- | --- |
|
|
1896
|
-
| env | <code>string</code> | sandbox, production |
|
|
1897
|
-
| [alias] | <code>string</code> | Own domain alias |
|
|
1898
|
-
|
|
1899
|
-
**Example**
|
|
1900
|
-
|
|
1901
|
-
```javascript
|
|
1902
|
-
config.setEnv('production');
|
|
1903
|
-
```
|
|
1904
|
-
<a name="w_Configuration+setLabel" id="w_Configuration+setLabel" href="#user-content-w_Configuration+setLabel"> </a>
|
|
1905
|
-
|
|
1906
|
-
### configuration.setLabel(label)
|
|
1907
|
-
Title for tab which can be set instead of default
|
|
1908
|
-
|
|
1909
|
-
**Kind**: instance method of [<code>Configuration</code>](#user-content-w_Configuration)
|
|
1910
|
-
|
|
1911
|
-
| Param | Type | Description |
|
|
1912
|
-
| --- | --- | --- |
|
|
1913
|
-
| label | <code>string</code> | Text label for tab |
|
|
1914
|
-
|
|
1915
|
-
**Example**
|
|
1916
|
-
|
|
1917
|
-
```javascript
|
|
1918
|
-
config.setLabel('custom label');
|
|
1919
|
-
```
|
|
1920
|
-
<a name="w_Configuration+createToken" id="w_Configuration+createToken" href="#user-content-w_Configuration+createToken"> </a>
|
|
1921
|
-
|
|
1922
|
-
### configuration.createToken(accessToken, cb, errorCb)
|
|
1923
|
-
createToken - method which exactly create payment one time token
|
|
1924
|
-
|
|
1925
|
-
**Kind**: instance method of [<code>Configuration</code>](#user-content-w_Configuration)
|
|
1926
|
-
|
|
1927
|
-
| Param | Type | Description |
|
|
1928
|
-
| --- | --- | --- |
|
|
1929
|
-
| accessToken | <code>string</code> | Customer access token or public key which provided for each client |
|
|
1930
|
-
| cb | <code>createToken~requestCallback</code> | The callback that handles the success response. |
|
|
1931
|
-
| errorCb | <code>createToken~requestCallback</code> | The callback that handles the failed response. |
|
|
1932
|
-
|
|
1933
|
-
**Example**
|
|
1934
|
-
|
|
1935
|
-
```javascript
|
|
1936
|
-
config.createToken('582035346f65cdd57ee81192d6e5w65w4e5',
|
|
1937
|
-
function (data) {
|
|
1938
|
-
console.log(data);
|
|
1939
|
-
}, function (error) {
|
|
1940
|
-
console.log(error);
|
|
1941
|
-
});
|
|
1942
|
-
```
|
|
1943
|
-
<a name="w_MultiWidget" id="w_MultiWidget" href="#user-content-w_MultiWidget"> </a>
|
|
1944
|
-
|
|
1945
|
-
## MultiWidget
|
|
1946
|
-
Class MultiWidget include method for for creating iframe url
|
|
1947
|
-
|
|
1948
|
-
**Kind**: global class
|
|
1949
|
-
|
|
1950
|
-
* [MultiWidget](#user-content-w_MultiWidget)
|
|
1951
|
-
* [new MultiWidget(accessToken, conf)](#user-content-w_new_MultiWidget_new)
|
|
1952
|
-
* [.setStyles(fields)](#user-content-w_MultiWidget+setStyles)
|
|
1953
|
-
* [.usePhoneCountryMask([options])](#user-content-w_MultiWidget+usePhoneCountryMask)
|
|
1954
|
-
* [.setTexts(fields)](#user-content-w_MultiWidget+setTexts)
|
|
1955
|
-
* [.setElementStyle(element, [state], styles)](#user-content-w_MultiWidget+setElementStyle)
|
|
1956
|
-
* [.setFormValues(fieldValues)](#user-content-w_MultiWidget+setFormValues)
|
|
1957
|
-
* [.setFormLabels(fieldLabels)](#user-content-w_MultiWidget+setFormLabels)
|
|
1958
|
-
* [.setFormPlaceholders(fieldPlaceholders)](#user-content-w_MultiWidget+setFormPlaceholders)
|
|
1959
|
-
* [.setFormElements(elements)](#user-content-w_MultiWidget+setFormElements)
|
|
1960
|
-
* ~~[.setIcons()](#user-content-w_MultiWidget+setIcons)~~
|
|
1961
|
-
* [.setHiddenElements(elements)](#user-content-w_MultiWidget+setHiddenElements)
|
|
1962
|
-
* [.setRefId(refId)](#user-content-w_MultiWidget+setRefId)
|
|
1963
|
-
* [.useGatewayFieldValidation()](#user-content-w_MultiWidget+useGatewayFieldValidation)
|
|
1964
|
-
* [.setSupportedCardIcons(elements, validateCardNumberInput)](#user-content-w_MultiWidget+setSupportedCardIcons)
|
|
1965
|
-
* [.hideUiErrors()](#user-content-w_MultiWidget+hideUiErrors)
|
|
1966
|
-
* [.setEnv(env, [alias])](#user-content-w_MultiWidget+setEnv)
|
|
1967
|
-
* [.loadIFrameUrl()](#user-content-w_MultiWidget+loadIFrameUrl)
|
|
1968
|
-
* [.setLanguage(code)](#user-content-w_MultiWidget+setLanguage)
|
|
1969
|
-
|
|
1970
|
-
<a name="w_new_MultiWidget_new" id="w_new_MultiWidget_new" href="#user-content-w_new_MultiWidget_new"> </a>
|
|
1971
|
-
|
|
1972
|
-
### new MultiWidget(accessToken, conf)
|
|
1973
|
-
|
|
1974
|
-
| Param | Type | Description |
|
|
1975
|
-
| --- | --- | --- |
|
|
1976
|
-
| accessToken | <code>string</code> | PayDock users access token or public key |
|
|
1977
|
-
| conf | [<code>Configuration</code>](#user-content-w_Configuration) \| <code>string</code> \| [<code>Array.<Configuration></code>](#user-content-w_Configuration) \| <code>Array.<string></code> | exemplar[s] Configuration class OR configuration token |
|
|
1978
|
-
|
|
1979
|
-
**Example**
|
|
1980
|
-
|
|
1981
|
-
```javascript
|
|
1982
|
-
var widget = new MultiWidget('accessToken','configurationToken'); // With a pre-created configuration token
|
|
1983
|
-
|
|
1984
|
-
var widget = new MultiWidget('accessToken',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
|
|
1985
|
-
|
|
1986
|
-
var widget = new MultiWidget('accessToken', new Configuration('gatewayId')); With Configuration
|
|
1987
|
-
|
|
1988
|
-
var widget = new MultiWidget('accessToken',[ With Configurations
|
|
1989
|
-
Configuration('gatewayId'),
|
|
1990
|
-
Configuration('gatewayId', 'bank_account')
|
|
1991
|
-
]);
|
|
1992
|
-
```
|
|
1993
|
-
<a name="w_MultiWidget+setStyles" id="w_MultiWidget+setStyles" href="#user-content-w_MultiWidget+setStyles"> </a>
|
|
1994
|
-
|
|
1995
|
-
### multiWidget.setStyles(fields)
|
|
1996
|
-
Object contain styles for widget
|
|
1997
|
-
|
|
1998
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
1999
|
-
|
|
2000
|
-
| Param | Type | Description |
|
|
2001
|
-
| --- | --- | --- |
|
|
2002
|
-
| fields | [<code>IStyles</code>](#user-content-w_IStyles) | name of styles which can be shown in widget [STYLE](#user-content-w_STYLE) |
|
|
2003
|
-
|
|
2004
|
-
**Example**
|
|
2005
|
-
|
|
2006
|
-
```javascript
|
|
2007
|
-
widget.setStyles({
|
|
2008
|
-
background_color: 'rgb(0, 0, 0)',
|
|
2009
|
-
border_color: 'yellow',
|
|
2010
|
-
text_color: '#FFFFAA',
|
|
2011
|
-
button_color: 'rgba(255, 255, 255, 0.9)',
|
|
2012
|
-
font_size: '20px'
|
|
2013
|
-
fort_family: 'fantasy'
|
|
2014
|
-
});
|
|
2015
|
-
```
|
|
2016
|
-
<a name="w_MultiWidget+usePhoneCountryMask" id="w_MultiWidget+usePhoneCountryMask" href="#user-content-w_MultiWidget+usePhoneCountryMask"> </a>
|
|
2017
|
-
|
|
2018
|
-
### multiWidget.usePhoneCountryMask([options])
|
|
2019
|
-
Method to set a country code mask for the phone input.
|
|
2020
|
-
|
|
2021
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2022
|
-
|
|
2023
|
-
| Param | Type | Description |
|
|
2024
|
-
| --- | --- | --- |
|
|
2025
|
-
| [options] | <code>object</code> | Options for configure the phone mask. |
|
|
2026
|
-
| [options.default_country] | <code>string</code> | Set a default country for the mask. |
|
|
2027
|
-
| [options.preferred_countries] | <code>Array.<string></code> | Set list of preferred countries for the top of the select box . |
|
|
2028
|
-
| [options.only_countries] | <code>Array.<string></code> | Set list of countries to show in the select box. |
|
|
2029
|
-
|
|
2030
|
-
**Example**
|
|
2031
|
-
|
|
2032
|
-
```javascript
|
|
2033
|
-
widget.usePhoneCountryMask();
|
|
2034
|
-
```
|
|
2035
|
-
**Example**
|
|
2036
|
-
|
|
2037
|
-
```javascript
|
|
2038
|
-
widget.usePhoneCountryMask({
|
|
2039
|
-
default_country: 'au',
|
|
2040
|
-
preferred_countries: ['au', 'gb'],
|
|
2041
|
-
only_countries: ['au', 'gb', 'us', 'ua']
|
|
2042
|
-
});
|
|
2043
|
-
```
|
|
2044
|
-
<a name="w_MultiWidget+setTexts" id="w_MultiWidget+setTexts" href="#user-content-w_MultiWidget+setTexts"> </a>
|
|
2045
|
-
|
|
2046
|
-
### multiWidget.setTexts(fields)
|
|
2047
|
-
Method for set different texts inside the widget
|
|
2048
|
-
|
|
2049
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2050
|
-
|
|
2051
|
-
| Param | Type | Description |
|
|
2052
|
-
| --- | --- | --- |
|
|
2053
|
-
| fields | [<code>ITexts</code>](#user-content-w_ITexts) | name of text items which can be shown in widget [TEXT](#user-content-w_TEXT) |
|
|
2054
|
-
|
|
2055
|
-
**Example**
|
|
2056
|
-
|
|
2057
|
-
```javascript
|
|
2058
|
-
widget.setTexts({
|
|
2059
|
-
title: 'Your card',
|
|
2060
|
-
finish_text: 'Payment resource was successfully accepted',
|
|
2061
|
-
title_description: '* indicates required field',
|
|
2062
|
-
submit_button: 'Save',
|
|
2063
|
-
submit_button_processing: 'Load...',
|
|
2064
|
-
});
|
|
2065
|
-
```
|
|
2066
|
-
<a name="w_MultiWidget+setElementStyle" id="w_MultiWidget+setElementStyle" href="#user-content-w_MultiWidget+setElementStyle"> </a>
|
|
2067
|
-
|
|
2068
|
-
### multiWidget.setElementStyle(element, [state], styles)
|
|
2069
|
-
Method for set styles for different elements and states
|
|
2070
|
-
|
|
2071
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2072
|
-
|
|
2073
|
-
| Param | Type | Description |
|
|
2074
|
-
| --- | --- | --- |
|
|
2075
|
-
| element | <code>string</code> | type of element for styling. These elements are available [STYLABLE_ELEMENT](#user-content-w_STYLABLE_ELEMENT) |
|
|
2076
|
-
| [state] | <code>string</code> | state of element for styling. These states are available [STYLABLE_ELEMENT_STATE](#user-content-w_STYLABLE_ELEMENT_STATE) |
|
|
2077
|
-
| styles | [<code>IElementStyleInput</code>](#user-content-w_IElementStyleInput) \| [<code>IElementStyleSubmitButton</code>](#user-content-w_IElementStyleSubmitButton) \| [<code>IElementStyleLabel</code>](#user-content-w_IElementStyleLabel) \| [<code>IElementStyleTitle</code>](#user-content-w_IElementStyleTitle) \| [<code>IElementStyleTitleDescription</code>](#user-content-w_IElementStyleTitleDescription) | styles list |
|
|
2078
|
-
|
|
2079
|
-
**Example**
|
|
2080
|
-
|
|
2081
|
-
```javascript
|
|
2082
|
-
widget.setElementStyle('input', {
|
|
2083
|
-
border: 'green solid 1px'
|
|
2084
|
-
});
|
|
2085
|
-
|
|
2086
|
-
widget.setElementStyle('input', 'focus', {
|
|
2087
|
-
border: 'blue solid 1px'
|
|
2088
|
-
});
|
|
2089
|
-
|
|
2090
|
-
widget.setElementStyle('input', 'error', {
|
|
2091
|
-
border: 'red solid 1px'
|
|
2092
|
-
});
|
|
2093
|
-
```
|
|
2094
|
-
<a name="w_MultiWidget+setFormValues" id="w_MultiWidget+setFormValues" href="#user-content-w_MultiWidget+setFormValues"> </a>
|
|
2095
|
-
|
|
2096
|
-
### multiWidget.setFormValues(fieldValues)
|
|
2097
|
-
The method to set the predefined values for the form fields inside the widget
|
|
2098
|
-
|
|
2099
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2100
|
-
|
|
2101
|
-
| Param | Type | Description |
|
|
2102
|
-
| --- | --- | --- |
|
|
2103
|
-
| fieldValues | <code>Object</code> | Key of object is one of [FORM_FIELD](#user-content-w_FORM_FIELD), The object value is what we are expecting |
|
|
2104
|
-
|
|
2105
|
-
**Example**
|
|
2106
|
-
|
|
2107
|
-
```javascript
|
|
2108
|
-
widget.setFormValues({
|
|
2109
|
-
email: 'predefined@email.com',
|
|
2110
|
-
card_name: 'Houston'
|
|
2111
|
-
});
|
|
2112
|
-
```
|
|
2113
|
-
<a name="w_MultiWidget+setFormLabels" id="w_MultiWidget+setFormLabels" href="#user-content-w_MultiWidget+setFormLabels"> </a>
|
|
2114
|
-
|
|
2115
|
-
### multiWidget.setFormLabels(fieldLabels)
|
|
2116
|
-
The method to set custom form field labels
|
|
2117
|
-
|
|
2118
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2119
|
-
|
|
2120
|
-
| Param | Type | Description |
|
|
2121
|
-
| --- | --- | --- |
|
|
2122
|
-
| fieldLabels | <code>Object</code> | Key of object is one of [FORM_FIELD](#user-content-w_FORM_FIELD), The object value is what we are expecting |
|
|
2123
|
-
|
|
2124
|
-
**Example**
|
|
2125
|
-
|
|
2126
|
-
```javascript
|
|
2127
|
-
widget.setFormPlaceholders({
|
|
2128
|
-
card_name: 'Card Holder Name',
|
|
2129
|
-
email: 'Email For Receipt'
|
|
2130
|
-
})
|
|
2131
|
-
```
|
|
2132
|
-
<a name="w_MultiWidget+setFormPlaceholders" id="w_MultiWidget+setFormPlaceholders" href="#user-content-w_MultiWidget+setFormPlaceholders"> </a>
|
|
2133
|
-
|
|
2134
|
-
### multiWidget.setFormPlaceholders(fieldPlaceholders)
|
|
2135
|
-
The method to set custom form fields placeholders
|
|
2136
|
-
|
|
2137
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2138
|
-
|
|
2139
|
-
| Param | Type | Description |
|
|
2140
|
-
| --- | --- | --- |
|
|
2141
|
-
| fieldPlaceholders | <code>Object</code> | Key of object is one of [FORM_FIELD](#user-content-w_FORM_FIELD), Value of object is expected placeholder |
|
|
2142
|
-
|
|
2143
|
-
**Example**
|
|
2144
|
-
|
|
2145
|
-
```javascript
|
|
2146
|
-
widget.setFormPlaceholders({
|
|
2147
|
-
card_name: 'Input your card holder name...',
|
|
2148
|
-
email: 'Input your email, like test@example.com'
|
|
2149
|
-
})
|
|
2150
|
-
```
|
|
2151
|
-
<a name="w_MultiWidget+setFormElements" id="w_MultiWidget+setFormElements" href="#user-content-w_MultiWidget+setFormElements"> </a>
|
|
2152
|
-
|
|
2153
|
-
### multiWidget.setFormElements(elements)
|
|
2154
|
-
The method to set the full configuration for the all specific form elements (label, placeholder, value)
|
|
2155
|
-
You can also use the other method for the partial configuration like: setFormValues, setFormPlaceholder, setFormLabel
|
|
2156
|
-
|
|
2157
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2158
|
-
|
|
2159
|
-
| Param | Type | Description |
|
|
2160
|
-
| --- | --- | --- |
|
|
2161
|
-
| elements | <code>string</code> | The list of elements |
|
|
2162
|
-
| elements[].field | <code>string</code> | Field name of the element [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
2163
|
-
| elements[].placeholder | <code>string</code> | Set custom form field placeholder |
|
|
2164
|
-
| elements[].label | <code>string</code> | Set custom labels near form field |
|
|
2165
|
-
| elements[].value | <code>string</code> | Set predefined values for the form field |
|
|
2166
|
-
|
|
2167
|
-
**Example**
|
|
2168
|
-
|
|
2169
|
-
```javascript
|
|
2170
|
-
widget.setFormElements([
|
|
2171
|
-
{
|
|
2172
|
-
field: 'card_name',
|
|
2173
|
-
placeholder: 'Input your card holder name...',
|
|
2174
|
-
label: 'Card Holder Name',
|
|
2175
|
-
value: 'Houston',
|
|
2176
|
-
},
|
|
2177
|
-
{
|
|
2178
|
-
field: 'email',
|
|
2179
|
-
placeholder: 'Input your email, like test@example.com',
|
|
2180
|
-
label: 'Email For Receipt',
|
|
2181
|
-
value: 'predefined@email.com',
|
|
2182
|
-
},
|
|
2183
|
-
])
|
|
2184
|
-
```
|
|
2185
|
-
<a name="w_MultiWidget+setIcons" id="w_MultiWidget+setIcons" href="#user-content-w_MultiWidget+setIcons"> </a>
|
|
2186
|
-
|
|
2187
|
-
### ~~multiWidget.setIcons()~~
|
|
2188
|
-
***Deprecated***
|
|
2189
|
-
|
|
2190
|
-
The method to change the widget icons
|
|
2191
|
-
|
|
2192
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2193
|
-
<a name="w_MultiWidget+setHiddenElements" id="w_MultiWidget+setHiddenElements" href="#user-content-w_MultiWidget+setHiddenElements"> </a>
|
|
2194
|
-
|
|
2195
|
-
### multiWidget.setHiddenElements(elements)
|
|
2196
|
-
Using this method you can set hidden elements inside widget
|
|
2197
|
-
|
|
2198
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2199
|
-
|
|
2200
|
-
| Param | Type | Description |
|
|
2201
|
-
| --- | --- | --- |
|
|
2202
|
-
| elements | <code>Array.<string></code> | list of element which can be hidden [ELEMENT](#user-content-w_ELEMENT) || [FORM_FIELD](#user-content-w_FORM_FIELD) |
|
|
2203
|
-
|
|
2204
|
-
**Example**
|
|
2205
|
-
|
|
2206
|
-
```javascript
|
|
2207
|
-
widget.setHiddenElements(['submit_button', 'email']);
|
|
2208
|
-
```
|
|
2209
|
-
<a name="w_MultiWidget+setRefId" id="w_MultiWidget+setRefId" href="#user-content-w_MultiWidget+setRefId"> </a>
|
|
2210
|
-
|
|
2211
|
-
### multiWidget.setRefId(refId)
|
|
2212
|
-
Current method can set custom ID to identify the data in the future
|
|
2213
|
-
|
|
2214
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2215
|
-
|
|
2216
|
-
| Param | Type | Description |
|
|
2217
|
-
| --- | --- | --- |
|
|
2218
|
-
| refId | <code>string</code> | custom id |
|
|
2219
|
-
|
|
2220
|
-
**Example**
|
|
2221
|
-
|
|
2222
|
-
```javascript
|
|
2223
|
-
widget.setRefId('id');
|
|
2224
|
-
```
|
|
2225
|
-
<a name="w_MultiWidget+useGatewayFieldValidation" id="w_MultiWidget+useGatewayFieldValidation" href="#user-content-w_MultiWidget+useGatewayFieldValidation"> </a>
|
|
2226
|
-
|
|
2227
|
-
### multiWidget.useGatewayFieldValidation()
|
|
2228
|
-
Current method can add visual validation from gateway to widget's form fields
|
|
2229
|
-
|
|
2230
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2231
|
-
**Example**
|
|
2232
|
-
|
|
2233
|
-
```javascript
|
|
2234
|
-
widget.useGatewayFieldValidation();
|
|
2235
|
-
```
|
|
2236
|
-
<a name="w_MultiWidget+setSupportedCardIcons" id="w_MultiWidget+setSupportedCardIcons" href="#user-content-w_MultiWidget+setSupportedCardIcons"> </a>
|
|
2237
|
-
|
|
2238
|
-
### multiWidget.setSupportedCardIcons(elements, validateCardNumberInput)
|
|
2239
|
-
Current method can set icons of supported card types
|
|
2240
|
-
|
|
2241
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2242
|
-
|
|
2243
|
-
| Param | Type | Description |
|
|
2244
|
-
| --- | --- | --- |
|
|
2245
|
-
| elements | <code>Array.<string></code> | [SUPPORTED_CARD_TYPES](#user-content-w_SUPPORTED_CARD_TYPES) |
|
|
2246
|
-
| validateCardNumberInput | <code>boolean</code> | [validateCardNumberInput=false] - using this param you allow validation for card number input on supported card types |
|
|
2247
|
-
|
|
2248
|
-
**Example**
|
|
2249
|
-
|
|
2250
|
-
```javascript
|
|
2251
|
-
widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
|
|
2252
|
-
```
|
|
2253
|
-
<a name="w_MultiWidget+hideUiErrors" id="w_MultiWidget+hideUiErrors" href="#user-content-w_MultiWidget+hideUiErrors"> </a>
|
|
2254
|
-
|
|
2255
|
-
### multiWidget.hideUiErrors()
|
|
2256
|
-
Current method can hide prevent the widget from showing the error messages
|
|
2257
|
-
|
|
2258
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2259
|
-
**Example**
|
|
2260
|
-
|
|
2261
|
-
```javascript
|
|
2262
|
-
widget.hideUiErrors('id');
|
|
2263
|
-
```
|
|
2264
|
-
<a name="w_MultiWidget+setEnv" id="w_MultiWidget+setEnv" href="#user-content-w_MultiWidget+setEnv"> </a>
|
|
2265
|
-
|
|
2266
|
-
### multiWidget.setEnv(env, [alias])
|
|
2267
|
-
Current method can change environment. By default environment = sandbox.
|
|
2268
|
-
Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
2269
|
-
|
|
2270
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2271
|
-
|
|
2272
|
-
| Param | Type | Description |
|
|
2273
|
-
| --- | --- | --- |
|
|
2274
|
-
| env | <code>string</code> | sandbox, production |
|
|
2275
|
-
| [alias] | <code>string</code> | Own domain alias |
|
|
2276
|
-
|
|
2277
|
-
**Example**
|
|
2278
|
-
|
|
2279
|
-
```javascript
|
|
2280
|
-
widget.setEnv('production', 'paydock.com');
|
|
2281
|
-
```
|
|
2282
|
-
<a name="w_MultiWidget+loadIFrameUrl" id="w_MultiWidget+loadIFrameUrl" href="#user-content-w_MultiWidget+loadIFrameUrl"> </a>
|
|
2283
|
-
|
|
2284
|
-
### multiWidget.loadIFrameUrl()
|
|
2285
|
-
Method for creating iframe url
|
|
2286
|
-
|
|
2287
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2288
|
-
**Example**
|
|
2289
|
-
|
|
2290
|
-
```javascript
|
|
2291
|
-
widget.loadIFrameUrl(function (url) {
|
|
2292
|
-
console.log(url);
|
|
2293
|
-
}, function (errors) {
|
|
2294
|
-
console.log(errors);
|
|
2295
|
-
});
|
|
2296
|
-
```
|
|
2297
|
-
<a name="w_MultiWidget+setLanguage" id="w_MultiWidget+setLanguage" href="#user-content-w_MultiWidget+setLanguage"> </a>
|
|
2298
|
-
|
|
2299
|
-
### multiWidget.setLanguage(code)
|
|
2300
|
-
Method for setting a custom language code
|
|
2301
|
-
|
|
2302
|
-
**Kind**: instance method of [<code>MultiWidget</code>](#user-content-w_MultiWidget)
|
|
2303
|
-
|
|
2304
|
-
| Param | Type | Description |
|
|
2305
|
-
| --- | --- | --- |
|
|
2306
|
-
| code | <code>string</code> | ISO 639-1 |
|
|
2307
|
-
|
|
2308
|
-
**Example**
|
|
2309
|
-
|
|
2310
|
-
```javascript
|
|
2311
|
-
config.setLanguage('en');
|
|
2312
|
-
```
|
|
2313
|
-
<a name="w_PURPOSE" id="w_PURPOSE" href="#user-content-w_PURPOSE"> </a>
|
|
2314
|
-
|
|
2315
|
-
## PURPOSE : <code>object</code>
|
|
2316
|
-
Purposes
|
|
2317
|
-
|
|
2318
|
-
**Kind**: global variable
|
|
2319
|
-
|
|
2320
|
-
| Param | Type | Default |
|
|
2321
|
-
| --- | --- | --- |
|
|
2322
|
-
| PAYMENT_SOURCE | <code>string</code> | <code>"payment_source"</code> |
|
|
2323
|
-
| CARD_PAYMENT_SOURCE_WITH_CVV | <code>string</code> | <code>"card_payment_source_with_cvv"</code> |
|
|
2324
|
-
| CARD_PAYMENT_SOURCE_WITHOUT_CVV | <code>string</code> | <code>"card_payment_source_without_cvv"</code> |
|
|
2325
|
-
|
|
2326
|
-
<a name="w_EVENT" id="w_EVENT" href="#user-content-w_EVENT"> </a>
|
|
2327
|
-
|
|
2328
|
-
## EVENT : <code>object</code>
|
|
2329
|
-
List of available event's name
|
|
2330
|
-
|
|
2331
|
-
**Kind**: global constant
|
|
2332
|
-
|
|
2333
|
-
| Param | Type | Default |
|
|
2334
|
-
| --- | --- | --- |
|
|
2335
|
-
| AFTER_LOAD | <code>string</code> | <code>"afterLoad"</code> |
|
|
2336
|
-
| SUBMIT | <code>string</code> | <code>"submit"</code> |
|
|
2337
|
-
| FINISH | <code>string</code> | <code>"finish"</code> |
|
|
2338
|
-
| VALIDATION | <code>string</code> | <code>"validation"</code> |
|
|
2339
|
-
| VALIDATION_ERROR | <code>string</code> | <code>"validationError"</code> |
|
|
2340
|
-
| SYSTEM_ERROR | <code>string</code> | <code>"systemError"</code> |
|
|
2341
|
-
| META_CHANGE | <code>string</code> | <code>"metaChange"</code> |
|
|
2342
|
-
| RESIZE | <code>string</code> | <code>"resize"</code> |
|
|
2343
|
-
|
|
2344
|
-
<a name="w_VAULT_DISPLAY_EVENT" id="w_VAULT_DISPLAY_EVENT" href="#user-content-w_VAULT_DISPLAY_EVENT"> </a>
|
|
2345
|
-
|
|
2346
|
-
## VAULT\_DISPLAY\_EVENT : <code>object</code>
|
|
2347
|
-
List of available event's name
|
|
2348
|
-
|
|
2349
|
-
**Kind**: global constant
|
|
2350
|
-
|
|
2351
|
-
| Param | Type | Default |
|
|
2352
|
-
| --- | --- | --- |
|
|
2353
|
-
| AFTER_LOAD | <code>string</code> | <code>"afterLoad"</code> |
|
|
2354
|
-
| SYSTEM_ERROR | <code>string</code> | <code>"system_error"</code> |
|
|
2355
|
-
| CVV_SECURE_CODE_REQUESTED | <code>string</code> | <code>"cvv_secure_code_requested"</code> |
|
|
2356
|
-
| CARD_NUMBER_SECURE_CODE_REQUESTED | <code>string</code> | <code>"card_number_secure_code_requested"</code> |
|
|
2357
|
-
| ACCESS_FORBIDDEN | <code>string</code> | <code>"access_forbidden"</code> |
|
|
2358
|
-
| SESSION_EXPIRED | <code>string</code> | <code>"systemError"</code> |
|
|
2359
|
-
| SYSTEM_ERROR | <code>string</code> | <code>"session_expired"</code> |
|
|
2360
|
-
| OPERATION_FORBIDDEN | <code>string</code> | <code>"operation_forbidden"</code> |
|
|
2361
|
-
|
|
2362
|
-
<a name="w_PAYMENT_TYPE" id="w_PAYMENT_TYPE" href="#user-content-w_PAYMENT_TYPE"> </a>
|
|
2363
|
-
|
|
2364
|
-
## PAYMENT\_TYPE : <code>object</code>
|
|
2365
|
-
List of available payment source types
|
|
2366
|
-
|
|
2367
|
-
**Kind**: global constant
|
|
2368
|
-
|
|
2369
|
-
| Param | Type | Default |
|
|
2370
|
-
| --- | --- | --- |
|
|
2371
|
-
| CARD | <code>string</code> | <code>"card"</code> |
|
|
2372
|
-
| BANK_ACCOUNT | <code>string</code> | <code>"bank_account"</code> |
|
|
2373
|
-
| CHECKOUT | <code>string</code> | <code>"checkout"</code> |
|
|
2374
|
-
|
|
2375
265
|
<a name="w_FORM_FIELD" id="w_FORM_FIELD" href="#user-content-w_FORM_FIELD"> </a>
|
|
2376
266
|
|
|
2377
267
|
## FORM\_FIELD : <code>object</code>
|
|
@@ -2539,4 +429,5 @@ List of available triggers
|
|
|
2539
429
|
| REFRESH_CHECKOUT | <code>string</code> | <code>"refresh_checkout"</code> |
|
|
2540
430
|
| UPDATE_FORM_VALUES | <code>string</code> | <code>"update_form_values"</code> |
|
|
2541
431
|
| INIT_CHECKOUT | <code>string</code> | <code>"init_checkout"</code> |
|
|
432
|
+
| INJECT_CUSTOMER_DATA | <code>string</code> | <code>"inject_customer_data"</code> |
|
|
2542
433
|
|