【问题标题】:"Cannot create payouts with an OAuth key" exception when creating payout for Stripe custom account为 Stripe 自定义帐户创建付款时出现“无法使用 OAuth 密钥创建付款”异常
【发布时间】: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


    【解决方案1】:

    结果是由于边缘情况,因为使用了错误的 Stripe 密钥,所以 OAuth 密钥错误消息是红鲱鱼。我建议任何调查与此类似的问题的人检查:

    • stripe 控制面板上 api/logs 部分中的请求详细信息(通过请求 ID),并且存在针对相应 Stripe 帐户的请求
    • 有足够的资金/转账成功,在请求支付之前

    【讨论】:

      【解决方案2】:

      你在这里没有做错任何事。连接帐户的测试数据中没有其完全正确的可用支付金额。进行测试交易并将金额添加到条带测试帐户。它应该可以正常工作。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-02-07
        • 2020-03-14
        • 2022-01-03
        • 2021-05-15
        • 1970-01-01
        • 2014-11-14
        • 2013-08-03
        • 1970-01-01
        相关资源
        最近更新 更多