I am new in payment gateway; I can't seem to figure out when does a payment actually gets deducted. So once the all card details are successfull the code below gets executed:
public partial class Charge : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) {
if (Request.Form["stripeToken"] != null)
{
var customers = new StripeCustomerService();
var charges = new StripeChargeService();
var customer = customers.Create(new StripeCustomerCreateOptions
{
Email = Request.Form["stripeEmail"],
SourceToken = Request.Form["stripeToken"]
});
var charge = charges.Create(new StripeChargeCreateOptions
{
Amount = 500,
Description = "Sample Charge",
Currency = "usd",
CustomerId = customer.Id
});
Console.WriteLine(charge.Id);
}
}
}
what I noticed is that if I enter and email of [email protected] without the "com" in the end, the code above gets executed, but it will say the email is invalid on Email = Request.Form["stripeEmail"].
so the question is does the money gets deducted when I get the token Request.Form["stripeToken"] or the money gets charged/deducted when I created a Charge via:
var charge = charges.Create(new StripeChargeCreateOptions
{
Amount = 500,
Description = "Sample Charge",
Currency = "usd",
CustomerId = customer.Id
});