我使用Stripe v27。当我向ChargeCreateOptions添加选项时,它有一个错误:
'ChargeCreateOptions'不包含'SourceId'的定义
这是我的代码段:
public IActionResult Processing(StripePaymentRequest paymentRequest)
{
Dictionary<string, string> Metadata = new Dictionary<string, string>();
Metadata.Add("Product", "RubberDuck");
Metadata.Add("Quantity", "10");
var options = new ChargeCreateOptions
{
Amount = 100,
Currency = "USD",
Description = "Buying 10 rubber ducks",
SourceId = paymentRequest.tokenId,
Metadata = Metadata
};
var service = new ChargeService();
Charge charge = service.Create(options);
return Json(charge);
}