Class: Payola::InvoiceFailed

Inherits:
Object
  • Object
show all
Includes:
InvoiceBehavior
Defined in:
app/services/payola/invoice_failed.rb

Class Method Summary collapse

Class Method Details

.call(event) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'app/services/payola/invoice_failed.rb', line 5

def self.call(event)
  sale, charge = create_sale_from_event(event)

  return unless sale

  sale.error = charge.failure_message
  sale.save!
  sale.fail!

  sale
end