Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/pay/stripe/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def preview_invoice(**options)

# Retries the latest invoice for a Past Due subscription and attempts to pay it
def retry_failed_payment(payment_intent_id: nil)
payment_intent_id ||= api_record.latest_invoice.payment_intent.id
payment_intent_id ||= api_record.latest_invoice.payments.first.payment.payment_intent
payment_intent = ::Stripe::PaymentIntent.retrieve({id: payment_intent_id}, stripe_options)

payment_intent = if payment_intent.status == "requires_payment_method"
Expand Down