Skip to content

Instantly share code, notes, and snippets.

@azcoov
Created April 13, 2013 15:47
Show Gist options
  • Save azcoov/5378921 to your computer and use it in GitHub Desktop.
Save azcoov/5378921 to your computer and use it in GitHub Desktop.
Stripe with C#
using System;
using Xamarin.Payments.Stripe;
namespace XamarinStripeTest
{
class Program
{
static void Main(string[] args)
{
var payment = new StripePayment("your_private_test_key");
var customer = payment.CreateCustomer (new StripeCustomerInfo {
Card = GetCard()
});
var subscription = payment.Subscribe (customer.ID, new StripeSubscriptionInfo {
Card = GetCard(),
Plan = "ProP"
});
Console.WriteLine(subscription.Plan.Name);
}
static StripeCreditCardInfo GetCard()
{
var cc = new StripeCreditCardInfo {
CVC = "1234",
ExpirationMonth = 6,
ExpirationYear = 2015,
Number = "4242424242424242"
};
return cc;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment