将关联帐户的PaymentIntent setup_future_usage条带化为off_session

时间:2019-07-04 12:05:03

标签: php stripe-payments

使用连接帐户并将setup_future_usage设置为off_session时,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...

stripe文档简单地说出与上面的错误相同

1 个答案:

答案 0 :(得分:0)

因此,第二天它没有任何变化。

可能是条纹错误