Created
April 13, 2013 15:47
-
-
Save azcoov/5378921 to your computer and use it in GitHub Desktop.
Stripe with C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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