예제 #1
0
        public async Task BankDetailsLookupEndpoint()
        {
            // given
            var subject = new BankDetailsLookupsClient(_clientConfiguration);

            var request = new BankDetailsLookupRequest();

            // when
            await subject.LookupAsync(request);

            // then
            _httpTest
            .ShouldHaveCalled("https://api.gocardless.com/bank_details_lookups")
            .WithVerb(HttpMethod.Post);
        }
예제 #2
0
        public void BankDetailsLookupRequestIsNullThrows()
        {
            // given
            var subject = new BankDetailsLookupsClient(_clientConfiguration);

            BankDetailsLookupRequest request = null;

            // when
            AsyncTestDelegate test = () => subject.LookupAsync(request);

            // then
            var ex = Assert.ThrowsAsync <ArgumentNullException>(test);

            Assert.That(ex.ParamName, Is.EqualTo(nameof(request)));
        }
예제 #3
0
        public async Task LooksupBankDetails()
        {
            // given
            var subject = new BankDetailsLookupsClient(_clientConfiguration);

            var request = new BankDetailsLookupRequest
            {
                AccountNumber = "55779911",
                BranchCode    = "200000",
                CountryCode   = "GB",
            };

            // when
            var result = await subject.LookupAsync(request);

            // then
            Assert.That(result.Item, Is.Not.Null);
            Assert.That(result.Item.AvailableDebitSchemes, Is.Not.Null.And.Not.Empty);
            Assert.That(result.Item.BankName, Is.Not.Null);
            Assert.That(result.Item.Bic, Is.Not.Null);
        }
예제 #4
0
        public GoCardlessClient(ClientConfiguration configuration)
        {
            _configuration = configuration;

            BankDetailsLookups    = new BankDetailsLookupsClient(configuration);
            CreditorBankAccounts  = new CreditorBankAccountsClient(configuration);
            Creditors             = new CreditorsClient(configuration);
            CustomerBankAccounts  = new CustomerBankAccountsClient(configuration);
            CustomerNotifications = new CustomerNotificationsClient(configuration);
            Customers             = new CustomersClient(configuration);
            Events = new EventsClient(configuration);
            MandateImportEntries = new MandateImportEntriesClient(configuration);
            MandateImports       = new MandateImportsClient(configuration);
            MandatePdfs          = new MandatePdfsClient(configuration);
            Mandates             = new MandatesClient(configuration);
            Payments             = new PaymentsClient(configuration);
            PayoutItems          = new PayoutItemsClient(configuration);
            Payouts       = new PayoutsClient(configuration);
            RedirectFlows = new RedirectFlowsClient(configuration);
            Refunds       = new RefundsClient(configuration);
            Subscriptions = new SubscriptionsClient(configuration);
        }