Exemplo n.º 1
0
        public void Can_retrieve_an_item()
        {
            // Arrange
            var sut     = new PlaidClient(Environment.Sandbox);
            var request = new Management.GetItemRequest().UseDefaults();

            // Act
            var result = sut.FetchItemAsync(request).Result;

            // Assert
            result.IsSuccessStatusCode.ShouldBeTrue();
            result.RequestId.ShouldNotBeNullOrEmpty();
            result.Item.Id.ShouldNotBeNullOrEmpty();
            result.Item.InstitutionId.ShouldNotBeNullOrEmpty();
            result.Item.BilledProducts.Length.ShouldBeGreaterThan(0);
            result.Item.AvailableProducts.Length.ShouldBeGreaterThan(0);
        }
Exemplo n.º 2
0
        /* Item Management */

        /// <summary>
        /// Retrieves information about the status of an <see cref="Entity.Item"/>. Endpoint '/item/get'.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>Task&lt;Management.GetItemResponse&gt;.</returns>
        public Task <Management.GetItemResponse> FetchItemAsync(Management.GetItemRequest request)
        {
            return(PostAsync <Management.GetItemResponse>("item/get", request));
        }
Exemplo n.º 3
0
        /* Item Management */

        /// <summary>
        /// Retrieves information about the status of an <see cref="Entity.Item"/>. Endpoint '<c>/item/get</c>'.
        /// </summary>
        public Task <Management.GetItemResponse> FetchItemAsync(Management.GetItemRequest request) =>
        PostAsync("item/get", request)
        .ParseResponseAsync <Management.GetItemResponse>();