Interface ILaybuyClient
Interface for components that actually communicate with the Laybuy API. Provided to enable mocking/stubbing/faking in test scenarios.
Inherited Members
Namespace: Yort.Laybuy.InStore
Assembly: Yort.Laybuy.InStore.dll
Syntax
public interface ILaybuyClient : IDisposable
Remarks
Application code should declare references to hold LaybuyClient instance as ILaybuyClient to help enable unit testing.
Methods
| Improve this Doc View SourceCancel(CancelOrderRequest)
Cancels a Laybuy previously created via the Create(CreateOrderRequest) method.
Declaration
Task<CancelOrderResponse> Cancel(CancelOrderRequest request)
Parameters
Type | Name | Description |
---|---|---|
CancelOrderRequest | request | A CancelOrderRequest instance containing details of the Laybuy to cancel. |
Returns
Type | Description |
---|---|
Task<CancelOrderResponse> | A CancelOrderResponse indicating success if the Laybuy was cancelled ok, otherwise error details. |
Remarks
An error will be returned if the Laybuy is already confirmed.
See Also
| Improve this Doc View SourceCreate(CreateOrderRequest)
Creates a new Laybuy (order) at Laybuy.
Declaration
Task<CreateOrderResponse> Create(CreateOrderRequest request)
Parameters
Type | Name | Description |
---|---|---|
CreateOrderRequest | request | A CreateOrderRequest with details of the Laybuy to create. |
Returns
Type | Description |
---|---|
Task<CreateOrderResponse> | A CreateOrderResponse indicating the outcome of the request. |
Exceptions
Type | Condition |
---|---|
LaybuyApiException | Thrown if Laybuy sends a valid response but the response itself indicates an error. See the exception's message property for details. |
See Also
| Improve this Doc View SourceGetOrder(OrderRequest)
Gets the full details of a Laybuy order previously created via Create(CreateOrderRequest).
Declaration
Task<OrderResponse> GetOrder(OrderRequest request)
Parameters
Type | Name | Description |
---|---|---|
OrderRequest | request | A OrderRequest with details of the Laybuy order to retrieve the status of. |
Returns
Type | Description |
---|---|
Task<OrderResponse> | A OrderResponse indicating the outcome of the request. |
Remarks
This method will only return valid details for a completed order, orders in any other status will return an error indicating the order is not found. This makes it unsuitable for status checking/polling. See GetOrderStatus(OrderStatusRequest).
Exceptions
Type | Condition |
---|---|
LaybuyApiException | Thrown if Laybuy sends a valid response but the response itself indicates an error. See the exception's message property for details. |
GetOrderStatus(OrderStatusRequest)
Gets the status of a Laybuy order previously created via Create(CreateOrderRequest).
Declaration
Task<OrderStatusResponse> GetOrderStatus(OrderStatusRequest request)
Parameters
Type | Name | Description |
---|---|---|
OrderStatusRequest | request | A OrderStatusRequest with details of the Laybuy order to retrieve the status of. |
Returns
Type | Description |
---|---|
Task<OrderStatusResponse> | A OrderStatusResponse indicating the outcome of the request. |
Remarks
This method will only return the status of the order, and an error message if appropriate. Once this method returns a Completed result the full details of the order can be retrived using GetOrder(OrderRequest).
Exceptions
Type | Condition |
---|---|
LaybuyApiException | Thrown if Laybuy sends a valid response but the response itself indicates an error. See the exception's message property for details. |
See Also
| Improve this Doc View SourceRefund(RefundRequest)
Refunds an amount of money against a Laybuy previously created via Create(CreateOrderRequest).
Declaration
Task<RefundResponse> Refund(RefundRequest request)
Parameters
Type | Name | Description |
---|---|---|
RefundRequest | request | A RefundRequest with details of the refund to make. |
Returns
Type | Description |
---|---|
Task<RefundResponse> | A RefundResponse indicating the outcome of the request. |
Exceptions
Type | Condition |
---|---|
LaybuyApiException | Thrown if Laybuy sends a valid response but the response itself indicates an error. See the exception's message property for details. |