On This Page
Module: FLEX v0.4.4
For detailed setup instructions, see "Getting Started."
The
following example displays a basic setup:
<script src="https://flex.cybersource.com/cybersource/assets/microform/0.4/flex-microform.min.js"></script> <script> window.FLEX.microform(...); </script>
Methods
(static) microform(options,
callback) > {void}
This method is the main setup
function used to initialize Flex Microform. Upon successful setup,
the callback receives a MicroformInstance (see "Class: MicroformInstance v0.4.4"),
which is used to interact with the service and build your integration.
(static) version() > {string}
The
version of Flex Microform in use. For example, 0.4.4.
Returns
Type:
string
Type Definitions
Styling
Options
Styling options are provided asan object that
resembles CSS but is limited to a subset of CSS propertiesthat relate
only to the text within the iframe.
The following CSS selectors
are supported:
- input
- ::placeholder
- :hover
- :focus
- :disabled
- valid
- invalid
The following CSS properties are
supported:
- color
- cursor
- font
- font-family
- font-kerning
- font-size
- font-size-adjust
- font-stretch
- font-style
- font-variant
- font-variant-caps
- font-varian-east-asian
- font-variant-ligatures
- font-variant-numeric
- font-weight
- line-height
- opacity
- text-shadow
- text-rendering
- transition
- -moz-osx-font-smoothing
- -moz-tap-highlight-color
- -moz-transition
- -o-transition
- -webkit-font-smoothing
- -webkit-tap-highlight-color
- -webkit-transitionNOTEUnsupported properties are not applied and raise aconsole.warn().
Type
Object
Properties
Name | Type | Attributes | Description |
---|---|---|---|
input | Object | <optional> | Main styling applied to the input field. |
::placeholder | Object | <optional> | |
:hover | Object | <optional> | |
:focus | Object | <optional> | Styles to apply when the input field has focus. |
:disabled | Object | <optional> | |
valid | Object | <optional> | |
invalid | Object | <optional> | |
Example
const styles = { 'input': { 'color': '#464646', 'font-size': '16px', 'font-family': 'monospace' }, ':hover': { 'font-style': 'italic' 'invalid': { 'color': 'red' } };