Class: Sepa::DirectDebitOrder::DirectDebit

Inherits:
Object
  • Object
show all
Defined in:
lib/sepa/direct_debit_order.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(debtor, debtor_account, end_to_end_id, amount, currency) ⇒ DirectDebit

Returns a new instance of DirectDebit.



109
110
111
# File 'lib/sepa/direct_debit_order.rb', line 109

def initialize debtor, , end_to_end_id, amount, currency
  @debtor, , @end_to_end_id, @amount, @currency = debtor, , end_to_end_id, amount, currency
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



107
108
109
# File 'lib/sepa/direct_debit_order.rb', line 107

def amount
  @amount
end

#currencyObject

Returns the value of attribute currency.



107
108
109
# File 'lib/sepa/direct_debit_order.rb', line 107

def currency
  @currency
end

#debtorObject

Returns the value of attribute debtor.



107
108
109
# File 'lib/sepa/direct_debit_order.rb', line 107

def debtor
  @debtor
end

#debtor_accountObject

Returns the value of attribute debtor_account.



107
108
109
# File 'lib/sepa/direct_debit_order.rb', line 107

def 
  
end

#end_to_end_idObject

Returns the value of attribute end_to_end_id.



107
108
109
# File 'lib/sepa/direct_debit_order.rb', line 107

def end_to_end_id
  @end_to_end_id
end

Instance Method Details

#to_properties(prefix) ⇒ Object



113
114
115
116
117
118
119
120
121
122
# File 'lib/sepa/direct_debit_order.rb', line 113

def to_properties prefix
  hsh = {
    "#{prefix}.payment_identification.end_to_end_identification"         => end_to_end_id,
    "#{prefix}.instructed_amount"                                        => ("%.2f" % amount),
    "#{prefix}.instructed_amount_currency"                               => "EUR",
  }
  hsh = hsh.merge debtor.to_properties("#{prefix}.debtor")
  hsh = hsh.merge .to_properties("#{prefix}.debtor")
  hsh
end