Skip to main content

Create Client

This method will create and initialise the Hellgate® client using an existing session_id.

Options

Session Complete

This event is called once the session is completely finished.
The handler receives a result object.

Session Result

Session Result status

Create Card Handler

In order to process card payments (and later other payment methods as well), a handler has to be obtained from the client.

Reset Card Handler

This method will remove the card form or card fields from the client, disconnect handlers and unmount the fields from the DOM.

Handling Cards

Create Card Form

This method will create a new one-line card form.

Parameters

Create Card Fields

This method will create the full set of card fields as shown below in the demo.

Parameters

Create Text Field

The “text” element type is a secure replacement for the <input> tag and enables collecting user string data like Cardholder Name as demonstrated.
The created TextField can be directly passed as a property for additionalData and the value does not need to be extracted.

Parameters

3D-Secure

3D Secure handling works out of the box with the SDK and usually doesn’t require any extra code.

Process

This method will read the data from the card form or the card fields and send them to processing. Prerequisite is that card fields or a card form was created before. A loading indicator can be shown until the promise is resolved.
We recommend performing a preliminary check to ensure that the card data is complete and valid before calling this method. Otherwise, the promise returned by the cardHandler.process() call will be rejected with an Error object.

Parameters

Additional Data

Token lifecycle

Pass these fields in the same object as the additional data to control how long the resulting token is retained. This supports a “Save my card” consent UX: keep the default until the cardholder consents, then set ephemeral: false (or an expiration_date) on consent.

Result

Session result data

Result status

Session result status

Elements API

The Elements API allows to interact with the created card form or the card fields.

Mount Element

This operation mounts an element to the DOM at the specified element.

Parameters

Update Element

This operations allows to change the options on an element. Please note that not all options can be changed.

Parameters

Unmount Element

This operation removes an element from the DOM.

Element Values / States

Focus

Set the focus on an element’s input.

Clear

Clear the value of an element.

Blur

Blur an element’s input.

Element Options

Element Styles

The form fields are encapsulated into iframes to allow for maximum protection of sensitive data. This means that CSS from the embedding page cannot be propagated directly into the form or the fields.
You can customise the elements using these pseudo-classes and pseudo-elements inside each variant using a nested object:
  • :hover
  • :focus
  • :disabled
  • ::placeholder
  • ::selection
These CSS properties are supported in terms of styling:
  • backgroundColor
  • color
  • fontFamily
  • fontSize
  • fontSmooth (will be mapped to user-agent naming automatically)
  • fontStyle
  • fontVariant
  • fontWeight
  • lineHeight
  • letterSpacing
  • textAlign
  • padding
  • textDecoration
  • textShadow
  • textTransform

Events

Both the clients and the elements send out events so that solutions can actively react to changes in state.

Card Handler Events

FormStateChange

This event notifies every time the card form fields state changes.
The handler receives an aggregated state object that is derived from all card fields states.

3D-Secure Events

In standard cases 3D Secure handling works out of the box with the SDK and usually doesn’t require any extra code. However, there are some events that can be used to handle the 3DS Challenge experience in the UI. In order to use the 3DS Handler, it has to be obtained from the client:

Decoupled Authentication

Decoupled authentication can be supported by the SDK with a specific event.

Start Challenge

This event is called once the 3DS Challenge is started. It can be used to show a loading indicator or to inform the customer about the ongoing process.

Challenge Finished

This event is called once the 3DS Challenge is finished. It can be used to hide the loading indicator or to inform the customer about the result.

Element Events

Change

This event notifies that the value of an element has changed. By default this event is emitted onBlur which can be overwritten with the element options.
The handler receives a ChangeEvent with information about the state of the element.

Focus

This event indicates that an element is focussed.

Blur

This event indicates that an element lost focussed.

Key Down

This event indicates that a key was pressed on the element.
The handler receives a KeyDownEvent with information about the state of the element.