• Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • Westpay.Epas
      • AdminOperation
      • AdminResponse
      • AltMethodTransaction
      • ApiResult
      • AuthorisationChannel
      • AuthorisingEntity
      • BufferTools
      • CardAcceptedEventArgs
      • CurrencyCodes
      • EnableCardReaderOptions
      • EnableReadersResponse
      • EntryMethod
      • EpasClient
      • EpasClient.CardAcceptedNotification
      • EpasClient.CardActionNotification
      • EpasClient.EpasMessageReceiver
      • EpasClient.StatusNotification
      • ErrorConditions
      • IClientApp
      • LastTransactionResponse
      • LastTransactionResponse.CardData
      • LastTransactionResponse.DccData
      • LastTransactionResponse.EmvData
      • LastTransactionResponse.MerchantData
      • LastTransactionResponse.TransactionData
      • LoginResponse
      • LogLevel
      • LogoutResponse
      • OperatingParameters
      • PurchaseRequest
      • PurchaseTransactionAmounts
      • ReceiptData
      • ReceiptData.AuthorisationData
      • ReceiptData.CardData
      • ReceiptData.DccData
      • ReceiptData.EmvData
      • ReceiptData.MerchantData
      • ReceiptData.TransactionData
      • ReceiptData.TranslatedTextId
      • ReceiptVersion
      • RefundRequest
      • ServiceEnableType
      • SimpleResponse
      • TerminalEnvironment
      • TerminalNetworkConnection
      • TransactionOutcome
      • TransactionRequest
      • TransactionResponse
      • TransactionType
      • VerificationMethod

    Class BufferTools

    This class is used to maintain utility functions to handle buffers.

    Inheritance
    System.Object
    BufferTools
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Westpay.Epas
    Assembly: EpasClientLibrary.dll
    Syntax
    public static class BufferTools

    Methods

    View Source

    ByteArrayToHexString(Byte[], Int32, Int32)

    Converts a byte array (for example 0xA0, 0x34, 0x05, 0xBF, 0x22, 0x02, 0xE1) to a hex string ("A03405BF2202E1")

    Declaration
    public static string ByteArrayToHexString(byte[] src, int start = 0, int length = 0)
    Parameters
    Type Name Description
    System.Byte[] src

    Byte array to convert

    System.Int32 start

    Start point in the byte array (default 0)

    System.Int32 length

    Number of bytes to convert (defaults to the whole array)

    Returns
    Type Description
    System.String

    The string containing the hex representation of the array contents, or null if an error occurred

    View Source

    HexStringToByteArray(String, Int32, Int32)

    Converts a hex string (for example "A03405BF2202E1") to a byte array {0xA0, 0x34, 0x05, 0xBF, 0x22, 0x02, 0xE1}

    Declaration
    public static byte[] HexStringToByteArray(string src, int start = 0, int length = 0)
    Parameters
    Type Name Description
    System.String src

    Hex string containing the data to convert

    System.Int32 start

    Start point in the string (default 0)

    System.Int32 length

    Length of the string to convert (defaults to the whole string)

    Returns
    Type Description
    System.Byte[]

    Byte array containing the parsed data, or null if the conversion fails

    View Source

    StringToByteArray(String, out Byte[], Int32, Int32, Int32)

    Converts a numeric string to a byte array. This can be in hex, for example "A03405BF2202E1" to {0xA0, 0x34, 0x05, 0xBF, 0x22, 0x02, 0xE1} or it can be decimal, for example "304980120183" to {30, 49, 80, 12, 01, 83}

    Declaration
    public static bool StringToByteArray(string src, out byte[] result, int start = 0, int length = 0, int numberBase = 16)
    Parameters
    Type Name Description
    System.String src

    Hex string containing the data to convert

    System.Byte[] result

    Byte array containing the parsed data, if successful

    System.Int32 start

    Start point in the string (default 0)

    System.Int32 length

    Length of the string to convert (defaults to the whole string)

    System.Int32 numberBase

    Base of the number encoding in the string. Use 16 to decode hex, 10 to decode decimal. Default is 16.

    Returns
    Type Description
    System.Boolean

    True on success, false otherwise

    • View Source
    In This Article
    Back to top Generated by DocFX