Skip to content

Update Stripe retry_failed_payment api access to payment intent#1225

Open
mguidetti wants to merge 1 commit intopay-rails:mainfrom
mguidetti:fix-retry-failed-payment
Open

Update Stripe retry_failed_payment api access to payment intent#1225
mguidetti wants to merge 1 commit intopay-rails:mainfrom
mguidetti:fix-retry-failed-payment

Conversation

@mguidetti
Copy link
Copy Markdown
Contributor

@mguidetti mguidetti commented Apr 9, 2026

Pull Request

Summary:
Fix retry_failed_payment for Stripe API versions > 2025-03-31

Related Issue:

Description:
Stripe API 2025-03-31 added support for multiple payments to invoices and removed the payment_intent field from the Invoice object in favor of the payments collection (https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices)

retry_failed_payment was referencing invoice.payment_intent, which raises a NoMethodError on Stripe API versions >= 2025-03-31.

This PR changes retry_failed_payment to access the payment intent through the payments collection instead. It selects the first payment using .first, so this doesn't actually support multiple payments like the API does, but perhaps this is fine for this gem's current purposes?

Testing:

I didn't find any existing tests for this method and was unsure the best way to test it.

Screenshots (if applicable):

Checklist:

  • Code follows the project's coding standards
  • Tests have been added or updated to cover the changes
  • Documentation has been updated (if applicable)
  • All existing tests pass
  • Conforms to the contributing guidelines

Additional Notes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant