我正在尝试使用 Stripe 直接向客户收费。我正在使用这个示例代码:
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);
这似乎在测试模式下工作。这是我的3个问题:
这里的 1000 是 10 美元 - 对吧?
这也可以使用实时密钥吗?我听说 Stripe 不允许直接收费,并要求我们使用他们的 Javascript 并存储令牌以供我们实际收费?它在测试模式下如何工作?
stripeChargeCreateOptions.Capture = true;
如果我将其设置为 false 会发生什么?