【发布时间】:2018-07-15 05:29:44
【问题描述】:
我们有我们的 Stripe 主账户和自定义/关联账户,我们最终希望将资金转移到这些账户,然后支付到他们的外部银行账户。
我有一些代码在测试模式下没有问题,但在生产中,我们在执行支付步骤时遇到异常。错误详情如下:
Stripe.StripeException: Cannot create payouts with an OAuth key.
at Stripe.Infrastructure.Requestor.ExecuteRequest(HttpRequestMessage requestMessage)
at Stripe.Infrastructure.Requestor.PostString(String url, StripeRequestOptions requestOptions)
据我所知,我们不为此请求使用 OAuth 密钥,因为我使用 MVC Web 应用程序的 Startup.cs 中的密钥设置了 StripeAPI:
StripeConfiguration.SetApiKey("sk_live_**************");
以及尝试支付的实际代码:
StripePayoutService sps = new StripePayoutService();
StripeRequestOptions connectRequest = new StripeRequestOptions();
connectRequest.StripeConnectAccountId = stripeConnectID; //"acct_*********"
StripePayoutCreateOptions spco = new StripePayoutCreateOptions();
spco.Amount = (int)(amount * 100);
spco.Currency = "GBP";
spco.StatementDescriptor = reference;
StripePayout result = sps.Create(spco, connectRequest);
我在条带请求选项中指定了连接的帐户 ID,并在初始化时指定了 Api Key,那么是什么导致请求抱怨 OAuth 凭据,或者在这种情况下我遗漏了什么/做错了什么?
【问题讨论】:
标签: c# stripe-payments stripe.net