Skip to content

Instantly share code, notes, and snippets.

@jjgriff93
Created March 5, 2018 18:14
Show Gist options
  • Select an option

  • Save jjgriff93/6e18881089b63e6f6478696cf9aad38d to your computer and use it in GitHub Desktop.

Select an option

Save jjgriff93/6e18881089b63e6f6478696cf9aad38d to your computer and use it in GitHub Desktop.
Stripe API - add new customer
// Create the user in Stripe using the Stripe API
StripeConfiguration.SetApiKey(StripeAPIKey);
var options = new StripeCustomerCreateOptions
{
//Add the customer's email address to Stripe
Email = model.Email,
};
var service = new StripeCustomerService();
//Returns us a customer object with a unique Stripe ID for them
StripeCustomer customer = service.Create(options);
//Create the user object with the ID returned from Stripe
var user = new ApplicationUser() { UserName = model.UserName, StripeId = customer.Id };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment