Skip to content

Instantly share code, notes, and snippets.

@alovak
Created November 25, 2015 08:01
Show Gist options
  • Select an option

  • Save alovak/c9e6a0862fa988a8e48e to your computer and use it in GitHub Desktop.

Select an option

Save alovak/c9e6a0862fa988a8e48e to your computer and use it in GitHub Desktop.
var gateway = new StripeGateway("test_sec_k_4c3323cae84d75924f366");
charge = gateway.CreateChargeObject()
{
Amount = 100,
Currency = "USD",
Description = "Test Charge",
Card = "tok_4c3323cae84d75924f366s289943", // or CustomerId = "cus_xxxxx"
Capture = true
};
// or
charge.Card = new StartCardObject()
{
number = "4242424242424242",
exp_month = "11",
exp_year = "20",
cvc = "123"
};
// make charge request
StartCharge startCharge = gateway.CreateCharge(charge);
startCharge.Id // => "ch_xxxxx"
startCharge.Captured // => true
// all other attributes according to the API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment