Class: Besepa::Payment

Inherits:
Resource show all
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

Attributes inherited from Resource

#activities

Instance Method Summary collapse

Methods included from ApiCalls::Search

included

Methods included from ApiCalls::List

included

Methods inherited from Resource

#as_json, handle_errors, #initialize, klass_name, #klass_name, #serializable_hash

Methods included from Utils::Request

#delete, #get, #post, #put

Methods included from Utils::Connection

#connection

Constructor Details

This class inherits a constructor from Besepa::Resource

Instance Attribute Details

#creditor_bank_accountObject

Returns the value of attribute creditor_bank_account.



15
16
17
# File 'lib/besepa/payment.rb', line 15

def 
  
end

#customerObject

Returns the value of attribute customer.



15
16
17
# File 'lib/besepa/payment.rb', line 15

def customer
  @customer
end

#debtor_bank_accountObject

Returns the value of attribute debtor_bank_account.



15
16
17
# File 'lib/besepa/payment.rb', line 15

def 
  
end

Instance Method Details

#allowed_nilsObject



28
29
30
# File 'lib/besepa/payment.rb', line 28

def allowed_nils
  ALLOWED_NILS
end

#to_hashObject



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] = .to_hash if 
  values[:creditor_bank_account] = .to_hash if 
  values[:customer] = customer.to_hash if customer
  values
end