添加元数据以在客户上进行条带化

我需要为客户添加唯一标识符。 通过条带元数据。 这就是我现在完全完成它的方法但是我只是告诉我用户购买了哪个包。

我试过看这里:

计划条纹

代码在这里:

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 } } ); 

元数据错误

赋值的左侧必须是变量,属性或索引器

初始化成员声明符无效

它是一本字典

在此处输入图像描述

这是一个展示如何在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() { { "Pakkeid", abonnement.PriceValueUnikId } } } );