-3

我在Stripe.NETs 文档中看到了这行代码

TokenId = *tokenId*,

和...

StripeCard stripeCard = cardService.Create(*customerId*, myCard);

但我以前从未见过被 *(星号)符号包围的变量/参数。这有什么特别的吗?这是 .NET 的东西吗?C# 的东西?

非常感谢!

I remember * and ** are used as args and kwargs in python, and as a pointer to a var (*) or pointer to a pointer to a var (**) in C.

4

2 回答 2

4

它在 C# 中没有任何意义,所以我假设 Stripe 正在使用它来表明你应该把你的tokenIdandcustomerId放在他们的位置上。

于 2016-03-02T03:03:34.883 回答
1

他们想通过在 *.

例如

var requestOptions = new StripeRequestOptions();
requestOptions.ApiKey = *optional*;              // this is not required unless you choose to pass the apikey on every service call
requestOptions.IdempotencyKey = "some string";   // this is for Idempotent Requests - https://stripe.com/docs/api?lang=curl#idempotent_requests
requestOptions.StripeConnectAccountId = "acct_*" // if you are using Stripe Connect and want to issue a request on the connected account

他们只希望您可以用“选项”替换有效值

于 2016-03-02T03:12:15.317 回答