c# - C#.NET 4.6 中的条带充电
问题描述
我从 nuget 安装了最新的条带库。这是 .NET 的原始 Stripe 库。
我有相同的旧库,现有代码运行正常。最新的库不支持这些类。如何使用最新的库作为现有代码收费?
public void ChargeStripe(string stripeEmail, string stripeToken, string payAmount, string
currency, string customerId, string paymentDescription)
{
// public ActionResult Charge(string stripeEmail, string stripeToken)
var customers = new StripeCustomerService();
var charges = new StripeChargeService();
var customer = customers.Create(new StripeCustomerCreateOptions
{
Email = stripeEmail,
SourceToken = stripeToken
});
var charge = charges.Create(new StripeChargeCreateOptions
{
Amount = payAmount, // charge in cents
Description = paymentDescription,
Currency = currency,
CustomerId = customerId
});
}
解决方案
请查看Stripe 更新日志。我看到他们在版本之间更改了一些名称。可能您只需要更改它们。
推荐阅读
- python - 找不到页面 (404) 喜欢按钮
- push-notification - 小米推送通知消息无法替换 NotificationManagerCompat 使用相同 notify_id 创建的旧通知
- python - 在 IMAP_tools 中获取 2021 年 1 月 1 日之前收到的电子邮件
- python - 将父类传递给模块导入
- python - 如何反转爆炸数据框行
- delphi - 从 Edge 抓取 Cookie 以在 WinInet 应用程序中使用
- css - 如何更改 webpack 生成的 CSS 的源地图 URL?
- go - 如何隐藏已编译二进制文件中的值
- c++ - C ++,for循环,将值保存到数组
- r - 尝试在 R 中激活 jaspershen/MSannotator 包