Beispiel #1
0
        private async Task ShouldGetBankAccountFieldFormatting()
        {
            BankAccountFieldQuery query = new BankAccountFieldQuery
            {
                AccountHolderType = AccountHolderType.Individual, PaymentNetwork = PaymentNetwork.Local
            };

            var response = await DefaultApi.InstrumentsClient()
                           .GetBankAccountFieldFormatting(CountryCode.GB, Currency.GBP, query);

            response.ShouldNotBeNull();
            response.Sections.ShouldNotBeNull();
            response.Sections.ShouldNotBeEmpty();

            foreach (var section in response.Sections)
            {
                section.Name.ShouldNotBeNull();
                section.Fields.ShouldNotBeNull();
                section.Fields.ShouldNotBeEmpty();

                foreach (var field in section.Fields)
                {
                    field.Id.ShouldNotBeNull();
                    field.Display.ShouldNotBeNull();
                    field.Type.ShouldNotBeNull();
                }
            }
        }
Beispiel #2
0
 public Task <BankAccountFieldResponse> GetBankAccountFieldFormatting(CountryCode country, Currency currency,
                                                                      BankAccountFieldQuery bankAccountFieldQuery, CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("country", country, "currency", currency, "bankAccountFieldQuery",
                                  bankAccountFieldQuery);
     return(ApiClient.Query <BankAccountFieldResponse>(
                BuildPath("validation/bank-accounts", country.ToString(), currency.ToString()),
                SdkAuthorization(SdkAuthorizationType.OAuth), bankAccountFieldQuery, cancellationToken));
 }
Beispiel #3
0
        private async Task ShouldGetBankAccountFieldFormatting()
        {
            BankAccountFieldQuery bankAccountFieldQuery = new BankAccountFieldQuery();

            _sdkCredentials.Setup(credentials => credentials.GetSdkAuthorization(SdkAuthorizationType.OAuth))
            .Returns(_authorization);

            _apiClient.Setup(apiClient =>
                             apiClient.Query <BankAccountFieldResponse>("validation/bank-accounts/GB/GBP", _authorization,
                                                                        bankAccountFieldQuery, CancellationToken.None)).ReturnsAsync(() => new BankAccountFieldResponse());

            IInstrumentsClient client =
                new InstrumentsClient(_apiClient.Object, _configuration.Object);

            var response = await client.GetBankAccountFieldFormatting(CountryCode.GB, Currency.GBP,
                                                                      bankAccountFieldQuery);

            response.ShouldNotBeNull();
        }