Class: Kaui::Payment

Inherits:
Base
  • Object
show all
Defined in:
app/models/kaui/payment.rb

Constant Summary collapse

SAMPLE_REASON_CODES =
[ "600 - Alt payment method",
"699 - OTHER" ]

Instance Attribute Summary

Attributes inherited from Base

#errors

Instance Method Summary collapse

Methods inherited from Base

#==, all, #attributes=, camelize, convert_hash_keys, count, define_attr, #destroy, find, from_json, has_many, has_one, human_attribute_name, #initialize, lookup_ancestors, #new_record?, #persisted?, #read_attribute_for_validation, #save, #to_hash, to_money, #to_param, #update_attributes

Constructor Details

This class inherits a constructor from Kaui::Base

Instance Method Details

#amount_to_moneyObject



30
31
32
# File 'app/models/kaui/payment.rb', line 30

def amount_to_money
  Kaui::Base.to_money(amount, currency)
end

#is_fully_refunded?Boolean

Returns:

  • (Boolean)


38
39
40
41
# File 'app/models/kaui/payment.rb', line 38

def is_fully_refunded?
  # paid_amount is the original payment amount minus the refunds
  paid_amount == 0
end


34
35
36
# File 'app/models/kaui/payment.rb', line 34

def paid_amount_to_money
  Kaui::Base.to_money(paid_amount, currency)
end