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.
-
#remittance_information ⇒ Object
Returns the value of attribute remittance_information.
Instance Method Summary collapse
-
#initialize(debtor, debtor_account, end_to_end_id, amount, currency, mandate_info, remittance_information = nil) ⇒ 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, remittance_information = nil) ⇒ DirectDebit
Returns a new instance of DirectDebit.
254 255 256 |
# File 'lib/sepa/direct_debit_order.rb', line 254 def initialize debtor, debtor_account, end_to_end_id, amount, currency, mandate_info, remittance_information = nil @debtor, @debtor_account, @end_to_end_id, @amount, @currency, @mandate_info, @remittance_information = debtor, debtor_account, end_to_end_id, amount, currency, mandate_info, remittance_information end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
252 253 254 |
# File 'lib/sepa/direct_debit_order.rb', line 252 def amount @amount end |
#currency ⇒ Object
Returns the value of attribute currency.
252 253 254 |
# File 'lib/sepa/direct_debit_order.rb', line 252 def currency @currency end |
#debtor ⇒ Object
Returns the value of attribute debtor.
252 253 254 |
# File 'lib/sepa/direct_debit_order.rb', line 252 def debtor @debtor end |
#debtor_account ⇒ Object
Returns the value of attribute debtor_account.
252 253 254 |
# File 'lib/sepa/direct_debit_order.rb', line 252 def debtor_account @debtor_account end |
#end_to_end_id ⇒ Object
Returns the value of attribute end_to_end_id.
252 253 254 |
# File 'lib/sepa/direct_debit_order.rb', line 252 def end_to_end_id @end_to_end_id end |
#mandate_info ⇒ Object
Returns the value of attribute mandate_info.
252 253 254 |
# File 'lib/sepa/direct_debit_order.rb', line 252 def mandate_info @mandate_info end |
#remittance_information ⇒ Object
Returns the value of attribute remittance_information.
252 253 254 |
# File 'lib/sepa/direct_debit_order.rb', line 252 def remittance_information @remittance_information end |
Instance Method Details
#sequence_type ⇒ Object
258 259 260 |
# File 'lib/sepa/direct_debit_order.rb', line 258 def sequence_type mandate_info.sequence_type end |
#to_properties(prefix, opts) ⇒ Object
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/sepa/direct_debit_order.rb', line 262 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, "#{prefix}.remittance_information.unstructured_remittance_information" => remittance_information } 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 |