I am trying to directly charge the customer using Stripe. I am using this sample code:
var stripeChargeCreateOptions = new StripeChargeCreateOptions();
stripeChargeCreateOptions.Amount = 1000;
stripeChargeCreateOptions.Currency = "usd";
stripeChargeCreateOptions.Description = "Test";
stripeChargeCreateOptions.Source = new StripeSourceOptions()
{
Number = "4242424242424242",
ExpirationYear = "2022",
ExpirationMonth = "10",
AddressCountry = "US", // optional
AddressLine1 = "24 Beef Flank St", // optional
AddressLine2 = "Apt 24", // optional
AddressCity = "Biggie Smalls", // optional
AddressState = "NC", // optional
AddressZip = "27617", // optional
Name = "Joe Meatballs", // optional
Cvc = "1223" // optional
};
stripeChargeCreateOptions.Capture = true;
var stripeChargeService = new StripeChargeService();
StripeCharge stripeCharge = stripeChargeService.Create(stripeChargeCreateOptions);
This seems to work in test mode. Here are my 3 questions:
The amount 1000 here is 10 USD - right?
Will this also work using live keys? I heard Stripe does not allow direct charge and requires us to their Javascript and store token for us to actually charge? How is it working in test mode?
What is the importance of
stripeChargeCreateOptions.Capture = true;
What would happen if I set it to false?