Class: Moneytree::Transaction
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Moneytree::Transaction
- Defined in:
- app/models/moneytree/transaction.rb
Instance Method Summary collapse
Instance Method Details
#card ⇒ Object
16 17 18 |
# File 'app/models/moneytree/transaction.rb', line 16 def card payment_provider.card_for(self) end |
#process_response(response) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/moneytree/transaction.rb', line 20 def process_response(response) if response.success? update!( status: :completed, psp_error: response., details: (details || {}).merge(response.body) ) else # FIXME: pending state update!( status: :failed, psp_error: response. ) end end |