0

我正在使用 ASP.NET 开发它,并且我使用了 Stripe.NET dll,根据我已将我的店主条带帐户与我链接并获得访问代码的文档。

现在我对我的客户感到困惑,他应该被添加为店主的条纹帐户中的客户,或者只是他的帐户作为店主与我的条纹帐户相关联。

谁能解释一下,它将如何工作?

var stripeService = new StripeChargeService(sellerStore.StripeMerchantAccessToken); //The token returned from the above method
var stripeChargeOption = new StripeChargeCreateOptions() { 
AmountInCents = amountInCents,
Currency = "usd", 
CustomerId = buyerPaymentInfo.StripeCustomerToken,
Description = "Locabal",
ApplicationFeeInCents = locabalsCut 
};
var response = stripeService.Create(stripeChargeOption);

buyPaymentInfo.StripeCustomerToken 将是访问代码还是在供应商帐户中注册的客户?

我想用他的信用卡向客户收费

您的帮助将不胜感激。

4

1 回答 1

0

根据我对 Stripe API 的理解,您应该在您的帐户中创建一个客户,并在费用中使用以“cus_”开头的客户 ID。

如果您查看以下 stripe.net 讨论,您将了解如何创建客户并在您的负责人中使用它。

https://github.com/jaymedavis/stripe.net/pull/43#issuecomment-30345043

//This is what we do to create a long-term customer in our system
//user is a user object unique to our system. We save it in our database
//stripeToken is what is generated by the Javascript on the page
var stripeService = new stripeCustomerService(ConfigurationManager.AppSettings["StripeSecret"]);
var stripeTokenOptions = new StripeCustomerCreateOptions { TokenId = stripeToken };
var response = stripeService.Create(stripeTokenOptions);

if (user.PaymentInfo == null)
{
    PaymentInfo paymentInfo = new PaymentInfo
    {
        StripeCustomerToken = response.Id
    };
    user.PaymentInfo = paymentInfo;
}
else
{
    user.PaymentInfo.StripeCustomerToken = response.Id;
}
于 2015-06-04T09:09:20.470 回答