Module: @cybersource/flex-sdk-web

Methods

(static) createToken(createTokenOptions, responseHandler) → {Void}

Create a token using the Flex API.

Parameters:
Name Type Description
createTokenOptions createTokenOptions

Options for creating a token

responseHandler responseHandler

Callback that handles the response

Returns:
Type
Void

(static) isBrowserSupported() → {Boolean}

Test that Flex Will work in current browser

Returns:
Type
Boolean

(static) nativeCryptoSupport() → {Boolean}

Test that current browser has native crypto support

Returns:
Type
Boolean

Type Definitions

createTokenOptions

Type:
  • Object
Properties:
Name Type Description
kid String

KeyId of the Flex public key to be used in this operation

encryptionType 'None' | 'RsaOaep' | 'RsaOaep256'

Encryption Type. This must match the type specified during the key's generation

keystore Object

JWK formatted keystore. Not required for encryptionType: 'None'

cardInfo Object

Card information

Properties
Name Type Attributes Description
cardNumber String

Card Number sent as a string

cardType String

CyberSource card type code - three digit string

cardExpirationMonth String <optional>

Card Expiration Month - two digit string including leading zeros

cardExpirationYear String <optional>

Card Expiration Year - four digit string

responseHandler(response)

Parameters:
Name Type Description
response Object

the response

Properties
Name Type Description
token Object

A Flex Token response if the callback has been successful

error Object

An error message will be displayed if an error occurs