1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

[bug] unable to run task find_incoherent_invoices

This commit is contained in:
Sylvain 2020-08-26 11:35:27 +02:00
parent 47fe464954
commit 6f3a1d0c6a
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
# Changelog Fab-manager
- Fix a bug: unable to run task find_incoherent_invoices
## v4.5.5 2020 August 26
- Improved portuguese translations

View File

@ -25,7 +25,7 @@ namespace :fablab do
end
end
Invoice.where('created_at > ? AND stp_invoice_id IS NOT NULL', date).each do |invoice|
stp_invoice = Stripe::Invoice.retrieve(invoice.stp_invoice_id)
stp_invoice = Stripe::Invoice.retrieve(invoice.stp_invoice_id, api_key: Setting.get('stripe_secret_key'))
next if invoice.amount_paid == stp_invoice.total
puts "Id: #{invoice.id}, reference: #{invoice.reference}, stripe id: #{stp_invoice.id}, " \