【发布时间】: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_account 和 application_fee_amount 键,我会成功创建,这意味着它与连接的帐户有关
Stripe\PaymentIntent Object ( [id] => pi_xxxxxxxxxxxxxxxxxx [object] => payment_intent...
条纹文档只是说与上面的错误相同
【问题讨论】:
标签: php stripe-payments