Skip to content

Instantly share code, notes, and snippets.

@cdeutsch
Created October 20, 2013 18:08
Show Gist options
  • Select an option

  • Save cdeutsch/7073149 to your computer and use it in GitHub Desktop.

Select an option

Save cdeutsch/7073149 to your computer and use it in GitHub Desktop.
Expand Stripe default_card
var client = new StripeClient(SiteSettings.StripeApiKey);
dynamic response = client.RetrieveCustomer(user.CustomerIdentifier);
if (response.IsError)
{
this.FlashError((string)response.error.message);
}
else
{
// expand default_card
var active_card = (from cc in (List<dynamic>)response.cards.data
where cc.id == response.default_card
select cc).Single();
model.ActiveCardNumber = active_card.last4;
model.ActiveCardType = active_card.type;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment