Class: Besepa::Payment
- Includes:
- ApiCalls::List, ApiCalls::Search
- Defined in:
- lib/besepa/payment.rb
Constant Summary collapse
- FIELDS =
[:id, :reference, :amount, :currency, :status, :send_at, :sent_at, :description, :metadata, :created_at]
- ALLOWED_NILS =
[:collect_at]
Constants included from Utils::Request
Utils::Request::END_POINT_URL_PREFIX
Instance Attribute Summary collapse
-
#creditor_bank_account ⇒ Object
Returns the value of attribute creditor_bank_account.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#debtor_bank_account ⇒ Object
Returns the value of attribute debtor_bank_account.
Attributes inherited from Resource
Instance Method Summary collapse
Methods included from ApiCalls::Search
Methods included from ApiCalls::List
Methods inherited from Resource
#as_json, handle_errors, #initialize, klass_name, #klass_name, #serializable_hash
Methods included from Utils::Request
Methods included from Utils::Connection
Constructor Details
This class inherits a constructor from Besepa::Resource
Instance Attribute Details
#creditor_bank_account ⇒ Object
Returns the value of attribute creditor_bank_account.
15 16 17 |
# File 'lib/besepa/payment.rb', line 15 def creditor_bank_account @creditor_bank_account end |
#customer ⇒ Object
Returns the value of attribute customer.
15 16 17 |
# File 'lib/besepa/payment.rb', line 15 def customer @customer end |
#debtor_bank_account ⇒ Object
Returns the value of attribute debtor_bank_account.
15 16 17 |
# File 'lib/besepa/payment.rb', line 15 def debtor_bank_account @debtor_bank_account end |
Instance Method Details
#allowed_nils ⇒ Object
28 29 30 |
# File 'lib/besepa/payment.rb', line 28 def allowed_nils ALLOWED_NILS end |
#to_hash ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/besepa/payment.rb', line 17 def to_hash values = {} self.class::FIELDS.each do |key| values[key] = self.send("#{key.to_s}") end values[:debtor_bank_account] = debtor_bank_account.to_hash if debtor_bank_account values[:creditor_bank_account] = creditor_bank_account.to_hash if creditor_bank_account values[:customer] = customer.to_hash if customer values end |