Class: Pay::Lago::Webhooks::InvoicePaymentStatusUpdated

Inherits:
Object
  • Object
show all
Defined in:
lib/pay/lago/webhooks/invoice_payment_status_updated.rb

Instance Method Summary collapse

Instance Method Details

#call(event) ⇒ Object



5
6
7
8
9
10
# File 'lib/pay/lago/webhooks/invoice_payment_status_updated.rb', line 5

def call(event)
  charge = Pay::Charge.find_by_processor_and_id(:lago, event.invoice.lago_id)
  return unless charge.present?
  charge.data.merge!(payment_status: event.invoice.payment_status)
  charge.save!
end