Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Stripe removed invoice.payment_intent in the basil API and it quietly broke my failed-payment workflow

说明与用途

Stripe 在 API 版本 2025-03-31.basil 中移除了 invoice.payment_intent 字段,导致失败支付工作流停止。解决方案是查询 invoice_payments 并展开 payment_intent,然后使用 last_payment_error.decline_code。

问题

Stripe’s API version 2025-03-31.basil removed the invoice.payment_intent field, causing a failed-payment workflow to stop silently when the code attempted to access an undefined payment intent.

结果

The updated approach restores failed-payment handling for hard declines, soft declines, and 3DS cards in the new API version.

工作流

  • 1. Send GET /v1/invoice_payments?invoice={invoice_id}&limit=1&expand[]=data.payment.payment_intent
  • 2. Retrieve data[0].payment.payment_intent
  • 3. Access last_payment_error.decline_code from the payment intent
  • 4. Proceed with retry or notification logic

证据

From that version the invoice doesn't have payment_intent, charge or paid anymore.

来源

Ask for the invoice's payments and expand the payment intent in the same call: GET /v1/invoice_payments?invoice=in_123&limit=1&expand[]=data.payment.payment_intent

来源

  • 记录日期: 2026-10-06T07:55:46.487Z