【问题标题】:Stripe PaymentIntent setup_future_usage to off_session for connected account将已连接帐户的 PaymentIntent setup_future_usage 条带化为 off_session
【发布时间】:2019-07-08 17:29:59
【问题描述】:

使用连接帐户并将setup_future_usage 设置为off_session 时PaymentIntent 失败

PaymentIntent 创建

\Stripe\Stripe::setApiKey("sk_test_xxxxxxxxxxxxxxxxxxxxxxxx");
$result = \Stripe\PaymentIntent::create(
    array(
        "amount"=>1000,
        "currency"=>"gbp",
        "payment_method_types"=>array('card'),
        "application_fee_amount"=>100,
        "setup_future_usage"=>"off_session"
    ),
    array("stripe_account"=>"acct_xxxxxxxxxxxxxxx")
);
print_r($result);

这是未捕获的错误响应

Fatal error: Uncaught exception 'Stripe\Error\InvalidRequest' with message 'You cannot update `setup_future_usage` from off_session to on_session on a PaymentIntent when using a publishable key. When `setup_future_usage` is already set, you can only update the value from on_session to off_session.'

如果我从数组中删除 stripe_accountapplication_fee_amount 键,我会成功创建,这意味着它与连接的帐户有关

Stripe\PaymentIntent Object ( [id] => pi_xxxxxxxxxxxxxxxxxx [object] => payment_intent...

条纹文档只是说与上面的错误相同

【问题讨论】:

    标签: php stripe-payments


    【解决方案1】:

    所以第二天它就可以正常工作了。

    可能是条纹错误

    【讨论】:

      猜你喜欢
      • 2023-03-18
      • 2020-01-01
      • 2021-07-20
      • 1970-01-01
      • 2020-09-05
      • 2019-03-02
      • 2017-06-17
      • 1970-01-01
      • 2018-12-12
      相关资源
      最近更新 更多