stripe-payments - 使用有效的付款方式重试后,Stripe 订阅发票保持打开状态
问题描述
我正在使用 stripe-php 库实现条带订阅,遵循此文档https://stripe.com/docs/billing/subscriptions/fixed-price
模拟客户订阅付款方式失败,条带订阅对象生成成功,发票状态打开。
问题是在我的后端实现重试发票时,我的代码如下:
// 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']
]);
在条纹仪表板上,客户默认付款方式已成功更新为最新的(有效卡),但订阅发票保持打开状态。
请帮忙,有人也遇到这个问题吗?恐怕我错过了条纹文档中的一些步骤。
解决方案
推荐阅读
- c# - 使用 File.Copy 时访问被拒绝
- sql - PostgresSQL 无法按 json_build_object 结果排序(从子查询获得)
- c - 实现条目超时的 C 哈希表的最有效方法是什么?
- c++ - 用于 stm32cube IDE 的 TLC5940 软件库
- c# - Azure IotHubException 在尝试接收消息时出现“连接已关闭,因为另一个 AMQP 客户端打开了接收链接”
- sharepoint - Spfx 扩展自定义操作组件 ID 由查询参数指定,但找不到匹配的清单
- python - 当我在管理员中为 Season 添加条目时出现 AttributeError ,此错误来自 'Season' 对象没有属性 'tv_show_publish'
- python - 当我在 python 中绘制某些东西时,程序执行会停止,直到我关闭绘图图
- flutter - Flutter 是否可以在 build 方法中仅使用 if 条件?
- python - 如何使用 keras 模型和 TFrecords 数据制作混淆矩阵?