Class: Sepa::DirectDebitOrder::DirectDebit
- Inherits:
-
Object
- Object
- Sepa::DirectDebitOrder::DirectDebit
- Defined in:
- lib/sepa/direct_debit_order.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#debtor ⇒ Object
Returns the value of attribute debtor.
-
#debtor_account ⇒ Object
Returns the value of attribute debtor_account.
-
#end_to_end_id ⇒ Object
Returns the value of attribute end_to_end_id.
-
#mandate_info ⇒ Object
Returns the value of attribute mandate_info.
Instance Method Summary collapse
-
#initialize(debtor, debtor_account, end_to_end_id, amount, currency, mandate_info) ⇒ DirectDebit
constructor
A new instance of DirectDebit.
- #sequence_type ⇒ Object
- #to_properties(prefix, opts) ⇒ Object
Constructor Details
#initialize(debtor, debtor_account, end_to_end_id, amount, currency, mandate_info) ⇒ DirectDebit
Returns a new instance of DirectDebit.
249 250 251 |
# File 'lib/sepa/direct_debit_order.rb', line 249 def initialize debtor, debtor_account, end_to_end_id, amount, currency, mandate_info @debtor, @debtor_account, @end_to_end_id, @amount, @currency, @mandate_info = debtor, debtor_account, end_to_end_id, amount, currency, mandate_info end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
247 248 249 |
# File 'lib/sepa/direct_debit_order.rb', line 247 def amount @amount end |
#currency ⇒ Object
Returns the value of attribute currency.
247 248 249 |
# File 'lib/sepa/direct_debit_order.rb', line 247 def currency @currency end |
#debtor ⇒ Object
Returns the value of attribute debtor.
247 248 249 |
# File 'lib/sepa/direct_debit_order.rb', line 247 def debtor @debtor end |
#debtor_account ⇒ Object
Returns the value of attribute debtor_account.
247 248 249 |
# File 'lib/sepa/direct_debit_order.rb', line 247 def debtor_account @debtor_account end |
#end_to_end_id ⇒ Object
Returns the value of attribute end_to_end_id.
247 248 249 |
# File 'lib/sepa/direct_debit_order.rb', line 247 def end_to_end_id @end_to_end_id end |
#mandate_info ⇒ Object
Returns the value of attribute mandate_info.
247 248 249 |
# File 'lib/sepa/direct_debit_order.rb', line 247 def mandate_info @mandate_info end |
Instance Method Details
#sequence_type ⇒ Object
253 254 255 |
# File 'lib/sepa/direct_debit_order.rb', line 253 def sequence_type mandate_info.sequence_type end |
#to_properties(prefix, opts) ⇒ Object
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/sepa/direct_debit_order.rb', line 257 def to_properties prefix, opts hsh = { "#{prefix}.payment_identification.end_to_end_identification" => end_to_end_id, "#{prefix}.instructed_amount" => ("%.2f" % amount), "#{prefix}.instructed_amount_currency" => "EUR", "#{prefix}.direct_debit_transaction.mandate_related_information.mandate_identification" => mandate_info.identification, "#{prefix}.direct_debit_transaction.mandate_related_information.date_of_signature" => mandate_info.signature_date } hsh = hsh.merge debtor.to_properties("#{prefix}.debtor", opts) hsh = hsh.merge debtor_account.to_properties("#{prefix}.debtor", opts) if opts[:pain_008_001_version] == "04" hsh["#{prefix}.payment_type_information.sequence_type"] = mandate_info.sequence_type end hsh end |