1.0.0 • Published 5 years ago
3dsecureio-mappings v1.0.0
3dsecureio-mappings
Mappers from internal format to 3dsecure.io
const {
TdsError,
UnsupportedCountryError,
UnsupportedCurrencyError,
UnexpectedEnumValueError,
InvalidAmountError,
AmountTooLargeError,
toPreAuthRequest,
fromPreAuthResponse,
toAuthRequest,
fromAuthResponse,
toChallengeRequest,
fromChallengeResponse,
toPostAuthRequest,
fromPostAuthResponse,
schemas,
} = require('@paylike/3dsecureio-mappings')Interface
toPreAuthRequest(preAuthRequest)→ 3dsecureObjectfromPreAuthResponse(3dsecureObject)→ preAuthResponse | TdsError | UnexpectedEnumValueErrortoAuthRequest(authRequest)→ 3dsecureObject | UnexpectedEnumValueError | UnsupportedCurrencyError | InvalidAmountError | AmountTooLargeError | UnsupportedCountryErrorfromAuthResponse(3dsecureObject)→ authResponse | TdsError | UnexpectedEnumValueErrortoChallengeRequest(challengeRequest)→ 3dsecureObject | UnexpectedEnumValueErrorfromChallengeResponse(3dsecureObject)→ challengeResponse | TdsError | UnexpectedEnumValueErrortoPostAuthRequest(postAuthRequest)→ 3dsecureObjectfromPostAuthResponse(3dsecureObject)→ postAuthResponse | TdsError | UnexpectedEnumValueError
Exceptions
TdsError
{
name: String, // name of the error
message: String, // description of the error
acsTransactionId?: String, // format: uuid
dsTransactionId?: String, // length ≤ 36, format: uuid
errorCode: String, // enum: ['message-received-invalid', 'message-version-number-not-supported', 'sent-messages-limit-exceeded', 'required-data-element-missing', 'critical-message-extension-not-recognised', 'format-invalid', 'duplicate-data-element', 'transaction-id-not-recognised', 'data-decryption-failure', 'access-denied-invalid-endpoint', 'iso-code-invalid', 'transaction-data-not-valid', 'merchant-category-code-not-valid', 'serial-number-not-valid', 'transaction-timed-out', 'transient-system-failure', 'permanent-system-failure', 'system-connection-failure']
errorComponent: String, // enum: ['3ds-sdk', '3ds-server', 'directory-server', 'acs']
errorDescription: String, // length ≤ 2048
errorDetail: String, // length ≤ 2048
errorMessageType?: String, // enum: ['ARes', 'AReq', 'PRes', 'PReq', 'CRes', 'CReq', 'RReq', 'RRes', 'Erro']
messageType: String, // enum: ['Erro']
messageVersion: String, // enum: ['2.1.0']
sdkTransactionId?: String, // format: uuid
threeDSServerTransactionId: String, // format: uuid
}- 'UnexpectedEnumValueError'
{
name: String, // name of the error
message: String, // description of the error
enumName: String, // name of the enum
enumValue: String, // value which was not found in the enum
} - 'UnsupportedCurrencyError'
{
name: String, // name of the error
message: String, // description of the error
field: String, // name of the field which causes an error
}- 'InvalidAmountError'
{
name: String, // name of the error
message: String, // description of the error
field: String, // name of the field which causes an error
}- 'AmountTooLargeError'
{
name: String, // name of the error
message: String, // description of the error
field: String, // name of the field which causes an error
maxAmount: @capbasic/money, // max allowed amount
}- 'UnsupportedCountryError'
{
name: String, // name of the error
message: String, // description of the error
field: String, // name of the field which causes an error
}1.0.0
5 years ago