Exemplo n.º 1
0
        private static void Test_FetchBankAccount()
        {
            Console.Write("[{0}] Testing fetch bank account from customer... ", Timestamp);
            var stripe = new StripeService(API_KEY);

            BankAccount bankAccount = stripe.GetBankAccountAsync(_testCustomerId, _testBankAccountId).Result;

            if (bankAccount == null)
            {
                Console.WriteLine();
                if (!stripe.HasError)
                {
                    throw new TestFailedException("Fetch bank account failed for unknown reasons.");
                }

                throw new TestFailedException("Fetch bank account failed ({0}): {1} {2}",
                                              stripe.Error.Type,
                                              stripe.Error.Message,
                                              stripe.Error.Parameter);
            }

            Console.WriteLine("pass");
        }