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

            Card card = stripe.GetCardAsync(_testCustomerId, _testCardId).Result;

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

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

            Console.WriteLine("pass");
        }