Presentation of methods
The JavaScript client supports events during integration: Initialize payment form.
Method | Description |
---|---|
KR.field.focus() | Called to give focus to a form field. |
KR.setFormConfig() | allows to overloadinitialization parametersfromformToken . |
KR.setBrand() | Called to force the detection of the payment method. |
KR.onFormCreated() | The payment form is ready but the content of iframes has not loaded yet. |
KR.onFormReady() | The form is ready to be used. |
KR.submit() | Submits the form(). Equivalent to the user clicking the form button. |
KR.validate() | Obsolete, to useKR.validateForm() |
KR.validateForm() | Called to trigger the local validation of the form. |
The following methods are obsolete and are no longer supported. They should not be used :.
- KR.validate(): use KR.validateForm()
- KR.registerPlugin()
Display management in on-board mode.
Method | Description |
---|---|
KR.fields.pan.help.button.hide() | Hides the PAN help icon |
KR.fields.pan.help.button.show() | Shows the PAN help icon |
KR.fields.cvv.hide() | Hide the CVV |
KR.fields.cvv.show() | Displays the CVV |
Pop-in display management.
Method | Description |
---|---|
KR.closePopin() | Closes the pop-in (if open). |
KR.openPopin() | Opens the Pop-in (if closed) |
KR.setShopName() | Change the name of the shop defined in the header of the Pop-in. |
Dynamic form management (add, remove DOM):
Method | Description |
---|---|
KR.addForm(CSS class or id) | Adds a form to a DOM element. Returns a formId. |
KR.attachForm(CSS class or id) | Obsolete, to useKR.renderElements() |
KR.renderElements(CSS class or id) | Enable the form on an existing DOM. Returns a formId. |
KR.hideForm(formId) | Hide the form |
KR.removeEventCallbacks() | Deletes all previously attached callbacks using KR.on[*] functions. |
KR.removeForms() | Removes all forms from the DOM (automatically calls KR.removeEventCallbacks() ) |
KR.showForm(formId) | Displaying a form |
See: embedded-form-glue.
Managing the payment form submission button:
PARAMETER | Description |
---|---|
KR.button.setLabel('MON LABEL %amount-and-currency% ') | Defines a label where %amount-and-currency% will be replaced by the amount and currency |
KR.button.showSpinner() | Displays the waiting animation |
KR.button.hideSpinner() | Hides the waiting animation |
KR.button.disable() | Disables the button (not clickable) |
KR.button.enable() | Activate the button |