static void TestCustomer(StripePayment payment)
 {
     StripeCustomerInfo customer = new StripeCustomerInfo ();
     //customer.Card = GetCC ();
     StripeCustomer customer_resp = payment.CreateCustomer (customer);
     string customer_id = customer_resp.ID;
     StripeCustomer customer_info = payment.GetCustomer (customer_id);
     Console.WriteLine (customer_info);
     StripeCustomer ci2 = payment.DeleteCustomer (customer_id);
     if (ci2.Deleted == false)
         throw new Exception ("Failed to delete " + customer_id);
 }
 static void TestCustomerAndCharge(StripePayment payment)
 {
     StripeCustomerInfo customer = new StripeCustomerInfo ();
     //customer.Card = GetCC ();
     StripeCustomer response = payment.CreateCustomer (customer);
     string customer_id = response.ID;
     StripeCustomer customer_info = payment.GetCustomer (customer_id);
     Console.WriteLine (customer_info);
     StripeCustomerInfo info_update = new StripeCustomerInfo ();
     info_update.Card = GetCC ();
     StripeCustomer update_resp = payment.UpdateCustomer (customer_id, info_update);
     Console.Write ("Customer updated with CC. Press ENTER to continue...");
     Console.Out.Flush ();
     Console.ReadLine ();
     StripeCustomer ci2 = payment.DeleteCustomer (customer_id);
     if (ci2.Deleted == false)
         throw new Exception ("Failed to delete " + customer_id);
 }
 private static void TestInvoices(StripePayment payment)
 {
     List<StripeInvoice> invoices = payment.GetInvoices(10, 10);
     StripeInvoice inv = payment.GetInvoice(invoices[0].Id);
     StripeCustomer cust = payment.CreateCustomer(new StripeCustomerInfo());
     StripeSubscription sub = payment.Subscribe(cust.Id, new StripeSubscriptionInfo { Card = GetCC() });
     StripeInvoice inv2 = payment.GetUpcomingInvoice(cust.Id);
     payment.Unsubscribe(cust.Id, true);
     payment.DeleteCustomer(cust.Id);
 }
        private static void TestCreateInvoiceItems(StripePayment payment)
        {
            StripeCustomer cust = payment.CreateCustomer(new StripeCustomerInfo());
            StripeInvoiceItemInfo info = GetInvoiceItemInfo();
            info.CustomerId = cust.Id;
            StripeInvoiceItem item = payment.CreateInvoiceItem(info);
            StripeInvoiceItemUpdateInfo updateInfo = GetInvoiceItemUpdateInfo();
            updateInfo.Description = "Invoice item: " + Guid.NewGuid().ToString();
            StripeInvoiceItem item2 = payment.UpdateInvoiceItem(item.Id, updateInfo);
            StripeInvoiceItem item3 = payment.GetInvoiceItem(item2.Id);
            if (item.Description == item3.Description) throw new Exception("Update failed");
            StripeInvoiceItem deleted = payment.DeleteInvoiceItem(item2.Id);
            if (!deleted.Deleted.HasValue && deleted.Deleted.Value) throw new Exception("Delete failed");
            int total;

            var items = payment.GetInvoiceItems(10, 10, null, out total);
            Console.WriteLine(total);
            payment.DeleteCustomer(cust.Id);
        }