Я новичок в платежном шлюзе;Я не могу понять, когда на самом деле вычитается платеж.Поэтому, как только все данные карты будут выполнены успешно, приведенный ниже код будет выполнен:
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);
}
}
}
, что я заметил, что, если я введу и отправлю электронное письмо с test @ gmail.без «com» в конце выполняется приведенный выше код, но он будет сообщать, что электронная почта недействительна на Email = Request.Form ["stripeEmail"].
, поэтому вопрос заключается в том, будут ли деньги вычтены, когда я получу токен Request.Form ["stripeToken"] или деньги будут списаны / вычтены, когда я создал Charge через:
var charge = charges.Create(new StripeChargeCreateOptions
{
Amount = 500,
Description = "Sample Charge",
Currency = "usd",
CustomerId = customer.Id
});