Skip to content

Commit

Permalink
feat: Small cleanup arround stripe (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet authored Jul 1, 2022
1 parent 772b434 commit 947ba24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/services/invoices/payments/stripe_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def update_status(provider_payment_id:, status:)

payment.update!(status: status)
payment.invoice.update!(status: status)

result
rescue ArgumentError
result.fail!('invalid_invoice_status')
Expand Down Expand Up @@ -128,7 +129,6 @@ def stripe_payment_payload
payment_method: stripe_payment_method,
confirm: true,
off_session: true,
receipt_email: customer.email,
error_on_requires_action: true,
description: "Lago - #{organization.name} - Invoice #{invoice.number}",
metadata: {
Expand Down
2 changes: 1 addition & 1 deletion app/services/payment_provider_customers/stripe_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def deliver_error_webhook(stripe_error)
end

def reprocess_pending_invoices(customer)
customer.invoices.where(status: [:pending, :failed]).find_each do |invoice|
customer.invoices.pending.find_each do |invoice|
Invoices::Payments::StripeCreateJob.perform_later(invoice)
end
end
Expand Down

0 comments on commit 947ba24

Please sign in to comment.