Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Response

A wrapper class for on-demand parsing a response received from the server.

Hierarchy

  • Response

Index

Constructors

constructor

  • Parameters

    • data: string

    Returns Response

Properties

Private segmentStrings

segmentStrings: string[][][]

A list of all segments with all data groups with all data elements.

Accessors

bankName

  • get bankName(): string
  • Shorthand for retrieving the bank's name from the HIBPA segment. Will return undefined if no HIBPA segment was found.

    Returns string

debugString

  • get debugString(): string
  • Generate a textual representation for debug purposes.

    Returns string

dialogId

  • get dialogId(): string
  • Shorthand for extracting the dialog's id from the HNHBK segment. If no HNHBK segment was found, an error will be thrown.

    Returns string

errors

  • get errors(): string[]
  • An array with all error messages received from the server.

    Returns string[]

painFormats

  • get painFormats(): string[]
  • Will assemble a list of all supported SEPA pain-message formats.

    Returns string[]

success

  • get success(): boolean
  • Will be true if the request this response references was a success and no errors were found. Responses containing warnings will always be treated as being successfully.

    Returns boolean

supportedTanMethods

  • Will assemble a list of all supported TAN methods.

    Returns TanMethod[]

systemId

  • get systemId(): string
  • Shorthand for extracting the system's id from the HISYN segment. If no HISYN segment was found, an error will be thrown.

    Returns string

Methods

findSegment

  • Find the first segment with the specified segment class.

    Type parameters

    Parameters

    • segmentClass: Constructable<T>

      A segment's class. The response should be searched for a segments with a matching type.

    Returns T

    The deserialized matching segment. Can be undefined if no segement matched the specified type.

findSegmentForReference

  • Segments can reference each other. Will find the segment of the specified class referencing the specified segment.

    Type parameters

    Parameters

    • segmentClass: Constructable<T>

      Ignore all sections except for segments of this type.

    • segment: Segment<any>

      Find the segment in the current message that references the segment specified in this parameter.

    Returns T

    All segments of the specified type that reference the provided segment. Might be an empty array.

findSegments

  • Find all segments with the specified segment class.

    Type parameters

    Parameters

    • segmentClass: Constructable<T>

      A segment's class. The response should be searched for all segments with a matching type.

    Returns T[]

    An array of all matching segments. Can be empty if no segements matched the specified type.

getTouchdowns

  • getTouchdowns(request: Request): Map<string, string>
  • Returns touchdowns contained in this message. Touchdowns are used for listing statements if the statement list needed to be split into multiple requests. The touchdowns are used for identifying from what request the list of statement was continued in this response.

    Parameters

    • request: Request

      The request for which the touchdown should be found.

    Returns Map<string, string>

    A map of (segment type -> touchdown identifier).

returnValues

  • Will return a set of return values from either only HIRMG or HIRMS segments or both. A return value is a set of a return code identifying it as well as a human readable message.

    Parameters

    • Rest ...segmentClasses: Constructable[]

      Either HIRMG, HIRMS or both. Denotes which segment's return values should be processed.

    Returns Map<string, ReturnValue>

    A map of (code -> return value).

segmentMaxVersion

  • Will return the maximum version for the specified segment type in this message.

    Parameters

    • segment: Constructable<Segment<any>>

      The class of segments for which the maximum version should be found.

    Returns number

    The maximum version of the specified segment class version, or 0 if no segment was found.

Generated using TypeDoc