Web SDK API Reference

Mount Card Input

Syntax

window.NI.mountCardInput('mount-point', {
  style,
  apiKey,
  outletRef,
  onSuccess,
  onFail,
  onChangeValidStatus
});

Arguments

ArgumentOptionalDescription
mount-pointNoA valid DOM id where in the card input needs to get mounted.
styleYesA object with different parameters to configure the look and feel of the card input through CSS.
apiKeyNoThis is the apiKey which needs to be provided to be able to mount the card-input.
outletRefNoThis is the unique outlet reference thats been assigned which can be determined by they N-Genius portal.
onSuccessYesCallback function which will get triggered when card input has been successfully mounted.
languageYesAllows you to define the Language for the SDK.
Values accepted: "ar" or "en".
Default value: "en"
onFailYesCallback function which will get triggered when card input has failed to load with some error.
onChangeValidStatusYesCallback function which will be triggered when the overall validity of user populated fields changes.

You may also use this callback as the trigger to display any inline input errors on a per-field or overall basis.

Style Options

const style = {
  main: {} /* the style for the main wrapper div around the card input*/,
  base: {} /* this is the default styles that comes with it */,
  input: {} /* custom style options for the input fields */,
  invalid: {} /* custom input invalid styles */
};

Common Style Options

Styles options below are applicable for, base , input , invalid :

Style NameDescription
colorThis takes in a string value for color and supports all the valid values that CSS supports.
heightThis takes in a string value in pixels/em/rem and supports all the valid values that CSS supports.
borderStyleThis takes in a string value and supports all the valid values that CSS property border-style supports.
borderWidthThis takes in a string value in pixels/em/rem and supports all the valid values that CSS property border-width supports.
borderColorThis takes in a string value and supports all the valid values that CSS property border-color supports.
borderRadiusThis takes in a string value in pixels/em/rem and supports all the valid values that CSS property border-radius supports.
backgroundColorThis takes in a string value and supports all the valid values that CSS property background-color supports.
fontUrlExample: https://fonts.googleapis.com/css?family=Cinzel&display=swap
fontFamilyExample: Cinzel
fontSizeThis takes in a string value and supports all the valid values that CSS property font-size supports.
fontWeightThis takes in a string value and supports all the valid values that CSS property font-weight supports.
paddingThis takes in a string value and supports all the valid values that CSS property padding supports.

The following css options applicable for main property:

Style NameDescription
marginThis takes in a string value and supports all the valid values that CSS property margin supports.
marginLeftThis takes in a string value and supports all the valid values that CSS property margin-left supports.
marginRightThis takes in a string value and supports all the valid values that CSS property margin-right supports.
topThis takes in a string value and supports all the valid values that CSS property top supports.
bottomThis takes in a string value and supports all the valid values that CSS property bottom supports.
leftThis takes in a string value and supports all the valid values that CSS property left supports.
rightThis takes in a string value and supports all the valid values that CSS property right supports.
paddingThis takes in a string value and supports all the valid values that CSS property padding supports.
positionThis takes in a string value and supports all the valid values that CSS property position supports.
overflowThis takes in a string value and supports all the valid values that CSS property overflow supports.
heightThis takes in a string value and supports all the valid values that CSS property height supports.
widthThis takes in a string value and supports all the valid values that CSS property width supports.
maxHeightThis takes in a string value and supports all the valid values that CSS property max-height supports.
maxWidthThis takes in a string value and supports all the valid values that CSS property max-width supports.
minHeightThis takes in a string value and supports all the valid values that CSS property min-height supports.
minWidthThis takes in a string value and supports all the valid values that CSS property min-width supports.
colorThis takes in a string value and supports all the valid values that CSS property color supports.
backgroundThis takes in a string value and supports all the valid values that CSS property background supports.
backgroundImageThis takes in a string value and supports all the valid values that CSS property background-image supports.
borderStyleThis takes in a string value and supports all the valid values that CSS property border-style supports.
borderColorThis takes in a string value and supports all the valid values that CSS property border-color supports.
borderRightThis takes in a string value and supports all the valid values that CSS property border-right supports.
borderRadiusThis takes in a string value and supports all the valid values that CSS property border-radius supports.
boxSizingThis takes in a string value and supports all the valid values that CSS property box-sizing supports.
boxShadowThis takes in a string value and supports all the valid values that CSS property box-shadow supports.
zIndexThis takes in a string value and supports all the valid values that CSS property z-index supports.