Esempio n. 1
0
        public void Can_retrieve_the_monthly_earnings_of_an_user()
        {
            // Arrange
            var sut     = new PlaidClient(Environment.Sandbox);
            var request = new Income.GetIncomeRequest()
            {
            }.UseDefaults();

            // Act
            var  result = sut.FetchUserIncomeAsync(request).Result;
            bool publicKeyDontHaveAccess = result.Exception?.ErrorCode == Exceptions.ErrorCode.InvalidProduct;

            if (publicKeyDontHaveAccess)
            {
                Assert.Inconclusive(Helper.your_public_key_do_not_have_access_contact_plaid);
            }

            // Assert
            result.IsSuccessStatusCode.ShouldBeTrue();
            result.RequestId.ShouldNotBeNullOrEmpty();
            result.Income.Streams.Length.ShouldBeGreaterThan(0);
            result.Income.LastYearIncome.ShouldBeGreaterThan(0);
        }
Esempio n. 2
0
        /* Income */

        /// <summary>
        /// Retrieves information pertaining to a <see cref="Entity.Item"/>’s income. In addition to the annual income, detailed information will be provided for each contributing income stream (or job).
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>Task&lt;Income.GetIncomeResponse&gt;.</returns>
        public Task <Income.GetIncomeResponse> FetchUserIncomeAsync(Income.GetIncomeRequest request)
        {
            return(PostAsync <Income.GetIncomeResponse>("income/get", request));
        }
Esempio n. 3
0
        /* Income */

        /// <summary>
        /// Retrieves information pertaining to a <see cref="Entity.Item"/>’s income. In addition to the annual income, detailed information will be provided for each contributing income stream (or job).
        /// </summary>
        public Task <Income.GetIncomeResponse> FetchUserIncomeAsync(Income.GetIncomeRequest request) =>
        PostAsync("income/get", request)
        .ParseResponseAsync <Income.GetIncomeResponse>();