• Articles
  • Api Documentation

    Show / Hide Table of Contents
    • Yort.Humm.InStore
      • CreateKeyRequest
      • CreateKeyResponse
      • HummApiUrlSelector
      • HummClient
      • HummClientConfiguration
      • HummCountry
      • HummEnvironment
      • HummResponseSignatureException
      • HummStatusCodes
      • IHummApiUrlSelector
      • IHummClient
      • InviteRequest
      • InviteResponse
      • PendingAuthorisationEventArgs
      • ProcessAuthorisationRequest
      • ProcessAuthorisationResponse
      • ProcessSalesAdjustmentRequest
      • ProcessSalesAdjustmentResponse
      • ProcessSalesAdjustmentReversalRequest
      • ProcessSalesAdjustmentReversalResponse
      • PurchaseItemsCollection
      • RequestStates
      • SendReceiptRequest
      • SendReceiptResponse
    • Yort.Humm.InStore.Infrastructure
      • Hmac256SignatureGenerator
      • ISignatureGenerator
      • RequestBase
      • ResponseBase
      • SignedRequestWriter

    Class Hmac256SignatureGenerator

    Used to generate signatures using the HMACSHA256 hash algorithm, currently the default and only supported algorithm by Humm.

    Inheritance
    Object
    Hmac256SignatureGenerator
    Implements
    ISignatureGenerator
    IDisposable
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Yort.Humm.InStore.Infrastructure
    Assembly: Yort.Humm.InStore.dll
    Syntax
    public sealed class Hmac256SignatureGenerator : ISignatureGenerator, IDisposable

    Constructors

    | Improve this Doc View Source

    Hmac256SignatureGenerator(String)

    Initializes a new instance of the Hmac256SignatureGenerator class.

    Declaration
    public Hmac256SignatureGenerator([ValidatedNotNull] string apiKey)
    Parameters
    Type Name Description
    String apiKey

    The secret key to use when generating the signature. This should be a Humm Device Key (DeviceKey).

    Methods

    | Improve this Doc View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    GenerateSignature(IEnumerable<KeyValuePair<String, Object>>)

    Generates the signature and returns it as a string.

    Declaration
    public string GenerateSignature(IEnumerable<KeyValuePair<string, object>> properties)
    Parameters
    Type Name Description
    IEnumerable<KeyValuePair<String, Object>> properties

    A dictionary of values to be considered for use in the signature generation. See remarks for more details.

    Returns
    Type Description
    String

    A string containing the signature calculated from the properties provided.

    Remarks

    Humm signatures are currently case-insensitive hexadecimal strings.

    Only values from the properties argument where the key starts with "x_" will be used, so the caller may pass the full property set if desired. Values of type decimal are treated as dollar values and will be automatically multiplied by 100, so should be passed as their decimal dollar representation. Values that are null will be ignored (treated as a missing/undeclared property and excluded from the signature generation).

    Exceptions
    Type Condition
    ObjectDisposedException

    Hmac256SignatureGenerator

    ArgumentNullException

    Thrown if properties is null.

    Implements

    ISignatureGenerator
    System.IDisposable

    See Also

    ISignatureGenerator
    • Improve this Doc
    • View Source
    Back to top Copyright (c) 2020 Troy Willmot