Ejemplo n.º 1
0
 public async Task <BalancesResponse> RetrieveEntityBalances(string entityId, BalancesQuery balancesQuery,
                                                             CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("filter", entityId, "balancesQuery", balancesQuery);
     return(await ApiClient.Query <BalancesResponse>(BuildPath(BalancesPath, entityId),
                                                     SdkAuthorization(),
                                                     balancesQuery,
                                                     cancellationToken));
 }
Ejemplo n.º 2
0
        private async Task ShouldRetrieveEntityBalances()
        {
            var request       = new BalancesQuery();
            var responseAsync = new BalancesResponse();

            _apiClient.Setup(apiClient =>
                             apiClient.Query <BalancesResponse>("balances/entity_id", It.IsAny <SdkAuthorization>(), request,
                                                                It.IsAny <CancellationToken>()))
            .ReturnsAsync(() => responseAsync);

            var response = await _balancesClient.RetrieveEntityBalances("entity_id", request);

            response.ShouldNotBeNull();
        }
Ejemplo n.º 3
0
        private async Task ShouldRetrieveEntityBalances()
        {
            var query = new BalancesQuery {
                Query = "currency:" + Currency.GBP
            };

            var balances = await DefaultApi.BalancesClient()
                           .RetrieveEntityBalances("ent_kidtcgc3ge5unf4a5i6enhnr5m", query);

            balances.ShouldNotBeNull();
            balances.Data.ShouldNotBeNull();
            foreach (var balance in balances.Data)
            {
                balance.Descriptor.ShouldNotBeNull();
                balance.HoldingCurrency.ShouldNotBeNull();
                balance.Balances.ShouldNotBeNull();
            }
        }