gpt4 book ai didi

c# - 添加元数据以对客户进行 strip 化

转载 作者:行者123 更新时间:2023-11-30 16:02:26 27 4
gpt4 key购买 nike

就是这样,我需要为客户添加一个唯一标识符。通过 strip 元数据。这就是我现在完全构建它的方式,但是我只有最后一部分告诉我用户购买了哪个包。

我试着看这里:

Plans to stripe

代码在这里:

  var planType = abonnement.fk_userid != null ? "Business" : "Default";

planService.Create(new StripePlanCreateOptions()
{
Amount = 99 * 100,
Name = abonnement.mdr + " - (" + planType + ")",
Currency = "EUR",
Interval = "month",
IntervalCount = 6,
Id = 1,
Metadata =
{
"Pakkeid:" = abonnement.PriceValueUnikId
}
}
);

元数据错误

The left-hand side of an assignment must be a variable, property or indexer

Invalid initializer member declarator

它是一个字典

enter image description here

最佳答案

这是一个示例,展示了如何将元数据与 Stripe.net 一起使用: https://github.com/jaymedavis/stripe.net#updating-a-bank-account

你应该像这样修改你的代码:

planService.Create(new StripePlanCreateOptions()
{
Amount = 99 * 100,
Name = abonnement.mdr + " - (" + planType + ")",
Currency = "EUR",
Interval = "month",
IntervalCount = 6,
Id = 1,
Metadata = new Dictionary<string, string>()
{
{ "Pakkeid", abonnement.PriceValueUnikId }
}
}
);

关于c# - 添加元数据以对客户进行 strip 化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37604272/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com