Show / Hide Table of Contents
    • Yort.LatitudePay.InStore
      • ILatitudePayClient
      • ILatitudePaySignatureGenerator
      • ILatitudePaySystemClock
      • LatitiudePayShippingLine
      • LatitudePayAddress
      • LatitudePayApiException
      • LatitudePayAuthToken
      • LatitudePayAvailability
      • LatitudePayCancelPurchaseRequest
      • LatitudePayCancelPurchaseResponse
      • LatitudePayClient
      • LatitudePayClientConfiguration
      • LatitudePayConfigurationRequest
      • LatitudePayConfigurationResponse
      • LatitudePayConstants
      • LatitudePayCreatePosPurchaseRequest
      • LatitudePayCreatePosPurchaseResponse
      • LatitudePayCreateRefundRequest
      • LatitudePayCreateRefundResponse
      • LatitudePayCurrencies
      • LatitudePayCustomer
      • LatitudePayEnvironment
      • LatitudePayHMACSHA256SignatureGenerator
      • LatitudePayMoney
      • LatitudePayProduct
      • LatitudePayPurchaseStatusRequest
      • LatitudePayPurchaseStatusResponse
      • LatitudePayReturnUrls
      • LatitudePaySystemClock

    Class LatitudePayClient

    The primary class used to integrate to the LatitudePay API.

    Inheritance
    Object
    LatitudePayClient
    Implements
    ILatitudePayClient
    IDisposable
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Yort.LatitudePay.InStore
    Assembly: Yort.LatitudePay.InStore.dll
    Syntax
    public sealed class LatitudePayClient : ILatitudePayClient, IDisposable
    Remarks

    Instances of this class should be reused between requests. If working in a single POS, create a copy on startup or first use and then re-use for subsequent payments. Dispose only when you're done with the instance completely, such as on shutdown or if about to create a new instance with alternate configuration.

    If working in a payment service/gateway or web POS handling multiple lanes, then create a pool of instances (one for each lane) and re-use as appropriate.

    Instances of this class should be thread safe, multiple calls for the same or different payments through the same instance should work as expected.

    Constructors

    | Improve this Doc View Source

    LatitudePayClient(LatitudePayClientConfiguration)

    Initializes a new instance of the LatitudePayClient class.

    Declaration
    public LatitudePayClient(LatitudePayClientConfiguration configuration)
    Parameters
    Type Name Description
    LatitudePayClientConfiguration configuration

    A LatitudePayClientConfiguration instance containing information required to connect to the LatitudePay API.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if configuration is null, or if ApiSecret is null.

    ArgumentException

    Thrown if ApiSecret is an empty string or contains only whitespace.

    See Also
    LatitudePayClientConfiguration
    ILatitudePayClient

    Methods

    | Improve this Doc View Source

    CancelPurchaseAsync(LatitudePayCancelPurchaseRequest)

    Cancels a (pending) payment plan previously requested via CreatePosPurchaseAsync(LatitudePayCreatePosPurchaseRequest).

    Declaration
    public Task<LatitudePayCancelPurchaseResponse> CancelPurchaseAsync(LatitudePayCancelPurchaseRequest request)
    Parameters
    Type Name Description
    LatitudePayCancelPurchaseRequest request

    A LatitudePayCancelPurchaseRequest containing the token of the payment plan to cancel.

    Returns
    Type Description
    Task<LatitudePayCancelPurchaseResponse>

    An instance of a LatitudePayCancelPurchaseResponse indicating if the cancellation was successful.

    Remarks

    This only cancels pending/unapproved payment plans. If a plan has been accepted/approved you must refund it instead of cancel it.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if request or any of it's required sub-properties are null.

    ArgumentOutOfRangeException

    Thrown if any sub-properties of request are outside the allowed range, i.e negative price.

    ArgumentException

    Thrown if any sub-properties of request are invalid for a reason other than being null or outside of a valid range.

    ObjectDisposedException

    Thrown if Dispose() has been called on this instance.

    UnauthorizedAccessException

    Thrown if the system is unable to obtain an authorisation token from the API (see the inner exception for details).

    HttpRequestException

    Thrown if an error occurs making the request to the API.

    See Also
    CreatePosPurchaseAsync(LatitudePayCreatePosPurchaseRequest)
    CreateRefundAsync(LatitudePayCreateRefundRequest)
    | Improve this Doc View Source

    CreatePosPurchaseAsync(LatitudePayCreatePosPurchaseRequest)

    Creates a new 'payment plan'.

    Declaration
    public Task<LatitudePayCreatePosPurchaseResponse> CreatePosPurchaseAsync(LatitudePayCreatePosPurchaseRequest request)
    Parameters
    Type Name Description
    LatitudePayCreatePosPurchaseRequest request

    A LatitudePayCreatePosPurchaseRequest instance specifying options for the payment plan to be created.

    Returns
    Type Description
    Task<LatitudePayCreatePosPurchaseResponse>

    A LatitudePayCreatePosPurchaseResponse instance containing details of the pending payment plan.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if request or any of it's required sub-properties are null.

    ArgumentOutOfRangeException

    Thrown if any sub-properties of request are outside the allowed range, i.e negative price.

    ArgumentException

    Thrown if any sub-properties of request are invalid for a reason other than being null or outside of a valid range.

    ObjectDisposedException

    Thrown if Dispose() has been called on this instance.

    UnauthorizedAccessException

    Thrown if the system is unable to obtain an authorisation token from the API (see the inner exception for details).

    HttpRequestException

    Thrown if an error occurs making the request to the API.

    See Also
    GetPurchaseStatusAsync(LatitudePayPurchaseStatusRequest)
    CancelPurchaseAsync(LatitudePayCancelPurchaseRequest)
    CreateRefundAsync(LatitudePayCreateRefundRequest)
    | Improve this Doc View Source

    CreateRefundAsync(LatitudePayCreateRefundRequest)

    Refunds a previously approved payment plan.

    Declaration
    public Task<LatitudePayCreateRefundResponse> CreateRefundAsync(LatitudePayCreateRefundRequest request)
    Parameters
    Type Name Description
    LatitudePayCreateRefundRequest request

    A LatitudePayCreateRefundRequest instance containing details of the refund and payment plan to refund against.

    Returns
    Type Description
    Task<LatitudePayCreateRefundResponse>

    A LatitudePayCreateRefundResponse instance indicating if the refund was successful and details of the refund created.

    Remarks

    You can only refund a previously accepted payment plan. Use CancelPurchaseAsync(LatitudePayCancelPurchaseRequest) to cancel a payment plan that is pending.

    A refund can be full or partial, and multiple partial refunds can be made. You can only refund up to the total amount of the original payment plan, across all refunds.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if request or any of it's required sub-properties are null.

    ArgumentOutOfRangeException

    Thrown if any sub-properties of request are outside the allowed range, i.e negative price.

    ArgumentException

    Thrown if any sub-properties of request are invalid for a reason other than being null or outside of a valid range.

    ObjectDisposedException

    Thrown if Dispose() has been called on this instance.

    UnauthorizedAccessException

    Thrown if the system is unable to obtain an authorisation token from the API (see the inner exception for details).

    HttpRequestException

    Thrown if an error occurs making the request to the API.

    | 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

    GetConfigurationAsync(LatitudePayConfigurationRequest)

    Gets configuration information for the current merchant account, specifying the supported currency, minimum and maximum purchase values etc.

    Declaration
    public Task<LatitudePayConfigurationResponse> GetConfigurationAsync(LatitudePayConfigurationRequest request)
    Parameters
    Type Name Description
    LatitudePayConfigurationRequest request

    A LatitudePayConfigurationRequest that specifies options for the data returned.

    Returns
    Type Description
    Task<LatitudePayConfigurationResponse>

    A LatitudePayConfigurationResponse instance.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if request is null.

    ObjectDisposedException

    Thrown if Dispose() has been called on this instance.

    UnauthorizedAccessException

    Thrown if the system is unable to obtain an authorisation token from the API (see the inner exception for details).

    HttpRequestException

    Thrown if an error occurs making the request to the API.

    | Improve this Doc View Source

    GetPurchaseStatusAsync(LatitudePayPurchaseStatusRequest)

    Gets the status of a payment plan previously requested via CreatePosPurchaseAsync(LatitudePayCreatePosPurchaseRequest).

    Declaration
    public Task<LatitudePayPurchaseStatusResponse> GetPurchaseStatusAsync(LatitudePayPurchaseStatusRequest request)
    Parameters
    Type Name Description
    LatitudePayPurchaseStatusRequest request

    A LatitudePayPurchaseStatusRequest instance containing the token of the payment plan who's status should be queried.

    Returns
    Type Description
    Task<LatitudePayPurchaseStatusResponse>

    A LatitudePayPurchaseStatusResponse instance containing the status and other details of the plan.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if request or any of it's required sub-properties are null.

    ArgumentOutOfRangeException

    Thrown if any sub-properties of request are outside the allowed range, i.e negative price.

    ArgumentException

    Thrown if any sub-properties of request are invalid for a reason other than being null or outside of a valid range.

    ObjectDisposedException

    Thrown if Dispose() has been called on this instance.

    UnauthorizedAccessException

    Thrown if the system is unable to obtain an authorisation token from the API (see the inner exception for details).

    HttpRequestException

    Thrown if an error occurs making the request to the API.

    See Also
    CreatePosPurchaseAsync(LatitudePayCreatePosPurchaseRequest)
    CancelPurchaseAsync(LatitudePayCancelPurchaseRequest)

    Implements

    ILatitudePayClient
    System.IDisposable

    See Also

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