Stripe payments 使用有效的付款方式重试后,条带订阅发票保持打开状态
我正在使用stripe php库实现stripe订阅,遵循以下文档 模拟付款方式失败的客户订阅,已成功生成条带订阅对象,且发票状态为打开 问题是在我的后端实现重试发票时,我的代码如下:Stripe payments 使用有效的付款方式重试后,条带订阅发票保持打开状态,stripe-payments,stripe-api,stripe-subscriptions,stripe-elements,stripe-invoices,Stripe Payments,Stripe Api,Stripe Subscriptions,Stripe Elements,Stripe Invoices,我正在使用stripe php库实现stripe订阅,遵循以下文档 模拟付款方式失败的客户订阅,已成功生成条带订阅对象,且发票状态为打开 问题是在我的后端实现重试发票时,我的代码如下: // retrieve new payment method (valid one) $payment_method = \Stripe\PaymentMethod::retrieve ( $request->paymentMethodId
// retrieve new payment method (valid one)
$payment_method = \Stripe\PaymentMethod::retrieve (
$request->paymentMethodId
);
// attach customer to payment method
$payment_method->attach([
'customer' => $request->customerId,
]);
// update customer default payment method
\Stripe\Customer::update($request->customerId, [
'invoice_settings' => [
'default_payment_method' => $request->paymentMethodId
]
]);
// retrieve invoice object
$invoice = \Stripe\Invoice::retrieve($invoiceId, [
'expand' => ['payment_intent']
]);
在stripe dashboard上,客户默认付款方式已成功更新为最新的付款方式(有效卡),但订阅发票仍保持打开状态
请帮助,有人也面临这个问题吗?很抱歉,我错过了stripe docs的一些步骤。附加付款方式不会重新尝试付款-在此之后,您需要将发票返回前端,并在发票付款时再次调用stripe.confirmCardPayment意图使用新卡重试付款。谢谢@karllekko,要执行stripe.confirmCardPayment,还需要提供客户端密码。我从发票对象paymentIntent中找不到它。有什么建议吗?附加PaymentMehod不会重新尝试付款-在此之后,您需要将发票返回到前端,并在发票付款时再次调用stripe.confirmCardPayment。有意使用新卡重试付款。感谢@karllekko,要执行stripe.confirmCardPayment,还需要提供客户机密。我从发票对象paymentIntent中找不到它。有什么建议吗?