Skip to content

Latest commit

 

History

History
1035 lines (472 loc) · 14.1 KB

redsys-easy.md

File metadata and controls

1035 lines (472 loc) · 14.1 KB

Home > redsys-easy

redsys-easy package

Node JS client and utilities for implementing a redsys payment gateway

Classes

Class

Description

GatewayError

Request could not be processed by Redsys

HTTPError

HTTP Error

ParseError

Response cannot be parsed

RedsysError

Error superclass for all redsys-easy specific errors

ResponseError

Response contained an error code

ValidationError

Invalid input provided

Functions

Function

Description

assertSuccessfulResponse(responseParams)

Asserts that response has a code indicating success

assertSuccessfulResponseCode(responseCode)

Asserts that a response code indicates success

create3DSMethodForm(emv3dsParams, notificationURL)

Creates parameters for a 3DS method form

create3DSv1ChallengeForm(emv3dsV1Challenge, challengeNotificationUrl)

Creates parameters for a 3DS v1 challenge form

create3DSv2ChallengeForm(emv3dsV2Challenge)

Creates parameters for a 3DS v2 challenge form

createRedsysAPI(config)

Creates Redsys API functions

deserializeAndVerifyJSONResponse(merchantKey, response)

deserializeCres(cres)

Deserialize cres field of a 3DS v2 challenge

deserializeThreeDSMethodData(threeDSMethodData)

Deserialize threeDSMethodData

detectSoapVersion(req)

Detects the soap version of a HTTP request

getResponseCodeMessage(code)

Returns the message corresponding to a response code, in spanish

getSISErrorCodeMessage(code)

Returns the message corresponding to a gateway error code

isResponseCodeOk(responseCode)

Indicates if a response code signals success

mimicSoap11NotificationResponse(answer)

Creates the body of a HTTP response as SOAP 1.1 from the body of a SOAP notification response

mimicSoap12NotificationResponse(answer)

Creates the body of a HTTP response as SOAP 1.2 from the body of a SOAP notification response

mimicSoapNotificationReceiver(xml)

Extracts the body of a SOAP notification from the body of the HTTP request

randomTransactionId()

Generates a random order ID following redsys requirements

redirectInputFormatter(input)

Redirection input formatter

restIniciaPeticionInputFormatter(raw)

REST iniciaPeticion input formatter

restIniciaPeticionOutputFormatter(raw)

REST iniciaPeticion output formatter

restNotificationOutputFormatter(raw)

REST notification formatter

restTrataPeticionInputFormatter(raw)

REST trataPeticion input formatter

restTrataPeticionOutputFormatter(raw)

REST trataPeticion output formatter

serializeAndSignJSONRequest(merchantKey, requestParams)

soapNotificationOutputFormatter(raw)

SOAP notification formatter

useOutputFormatter(fn, outputFormatter)

Applies an output formatter to a function

usePromiseOutputFormatter(fn, outputFormatter)

Applies an output formatter to the resolved ouput promise of a function

useSingleInputFormatter(fn, inputFormatter)

Applies an input formatter to the first argument of a function

Interfaces

Interface

Description

NotificationFormatterOutput

Ouput parameters for the notification output formatter

RedirectForm

Redirect form

RedirectFormatterInput

Input parameters for the redirect input formatter

RedirectInputParams

Input parameters for a redsys redirect request

RedsysAPI

Redsys API

RedsysConfig

Redsys API settings

ResponseJSONSuccess

Body of a successful redsys JSON HTTP response or notification

RestIniciaPeticionFormatterInput

Input parameters for the REST iniciaPeticion input formatter

RestIniciaPeticionFormatterOutput

Ouput parameters for the REST iniciaPeticion output formatter

RestIniciaPeticionInputParams

Input parameters for a IniciaPeticion HTTP request

RestIniciaPeticionOutputParams

Output parameters of a IniciaPeticion HTTP request

RestNotificationOutputParams

Parameters of a redsys REST notification

RestTrataPeticionFormatterInput

Input parameters for the REST trataPeticion input formatter

RestTrataPeticionFormatterOutput

Ouput parameters for the REST trataPeticion output formatter

RestTrataPeticionInputParams

Input parameters for a TrataPeticion Peticion HTTP request

RestTrataPeticionOutputParams

Output parameters of a TrataPeticion HTTP request

SoapNotificationOutputParams

Parameters of a redsys SOAP notification

ThreeDSCres

Contents of the cres field of a 3DS v2 challenge

ThreeDSMethodData

3DS v2 method data

ThreeDSMethodForm

3DS v2 method form

ThreeDSv1ChallengeForm

3DS v1 challenge form

ThreeDSv1ChallengeNotificationBody

Body of a 3DS v1 challenge completion notification

ThreeDSv2ChallengeForm

3DS v2 challenge form

ThreeDSv2ChallengeNotificationBody

Body of a 3DS v2 challenge completion notification

ThreeDSv2MethodNotificationBody

Body of a 3DS v2 method completion notification

UrlsConfig

URLs to configure the API

Variables

Variable

Description

CARDBRANDS

Card brand name to number

COUNTRIES

Maps ISO 3166 Alpha 2 codes to UN M49 numbers

CURRENCIES

Maps a ISO 4217 code to a ISO 4217 currency number and decimal positions

LANGUAGES

Maps an ISO 639-1 language code to redsys language number

PRODUCTION_URLS

Redsys production urls

REV_CARDBRANDS

Card brand number to name

REV_COUNTRIES

Maps UN M49 numbers to ISO 3166 Alpha 2 codes

REV_CURRENCIES

Maps a ISO 4217 number to a ISO 4217 currency code and decimal positions

REV_LANGUAGES

Maps a redsys language code to an ISO 639-1 language code

SANDBOX_URLS

Redsys sandbox urls

TRANSACTION_TYPES

Transaction type enum

Type Aliases

Type Alias

Description

CardBrand

Card brand name

CardBrandNum

Card brand number

Country

Country ISO 3166 Alpha 2 code

CountryNum

Country UN M49 number

CreateRedirectForm

Creates the parameters needed for a redirect form

CreateSoapNotificationAnswer

Creates an answer for a SOAP notification, serializes and signs it

Currency

ISO 4217 currency code

CurrencyNum

ISO 4217 currency number

Language

ISO 639-1 language code

LanguageNum

Redsys language code

ProcessRestNotification

Processes a JSON REST notification

ProcessSoapNotification

Parses and verifies the body of a SOAP notification

RestIniciaPeticion

Sends a iniciaPeticion request using REST interface

RestTrataPeticion

Sends a trataPeticion request using REST interface

ThreeDSBrowserClientInfo

Browser information required by 3DS

TransactionType

Transaction type code