Skip to content

Commit

Permalink
Fix retry_failed_payment for Stripe. Closes #1084
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed Oct 4, 2024
1 parent 1d7eae0 commit c3f8e5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/pay/stripe/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def upcoming_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 ||= subscription.latest_invoice.payment_intent.id
payment_intent_id ||= api_record.latest_invoice.payment_intent.id
payment_intent = ::Stripe::PaymentIntent.retrieve({id: payment_intent_id}, stripe_options)

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

0 comments on commit c3f8e5d

Please sign in to comment.