Class: SEPA::DirectDebitTransaction
- Inherits:
-
Transaction
- Object
- Transaction
- SEPA::DirectDebitTransaction
- Defined in:
- lib/sepa_king/transaction/direct_debit_transaction.rb
Constant Summary collapse
- SEQUENCE_TYPES =
%w(FRST OOFF RCUR FNAL)
- LOCAL_INSTRUMENTS =
%w(CORE COR1 B2B)
Constants inherited from Transaction
Transaction::DEFAULT_REQUESTED_DATE
Instance Attribute Summary collapse
-
#creditor_account ⇒ Object
Returns the value of attribute creditor_account.
-
#debtor_address ⇒ Object
Returns the value of attribute debtor_address.
-
#local_instrument ⇒ Object
Returns the value of attribute local_instrument.
-
#mandate_date_of_signature ⇒ Object
Returns the value of attribute mandate_date_of_signature.
-
#mandate_id ⇒ Object
Returns the value of attribute mandate_id.
-
#original_creditor_account ⇒ Object
Returns the value of attribute original_creditor_account.
-
#original_debtor_account ⇒ Object
Returns the value of attribute original_debtor_account.
-
#same_mandate_new_debtor_agent ⇒ Object
Returns the value of attribute same_mandate_new_debtor_agent.
-
#sequence_type ⇒ Object
Returns the value of attribute sequence_type.
Attributes inherited from Transaction
#amount, #batch_booking, #bic, #creditor_address, #currency, #iban, #instruction, #name, #reference, #remittance_information, #requested_date
Instance Method Summary collapse
- #amendment_informations? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ DirectDebitTransaction
constructor
A new instance of DirectDebitTransaction.
- #schema_compatible?(schema_name) ⇒ Boolean
Methods included from Converter
Constructor Details
#initialize(attributes = {}) ⇒ DirectDebitTransaction
Returns a new instance of DirectDebitTransaction.
35 36 37 38 39 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 35 def initialize(attributes = {}) super self.local_instrument ||= 'CORE' self.sequence_type ||= 'OOFF' end |
Instance Attribute Details
#creditor_account ⇒ Object
Returns the value of attribute creditor_account.
7 8 9 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 7 def creditor_account @creditor_account end |
#debtor_address ⇒ Object
Returns the value of attribute debtor_address.
7 8 9 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 7 def debtor_address @debtor_address end |
#local_instrument ⇒ Object
Returns the value of attribute local_instrument.
7 8 9 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 7 def local_instrument @local_instrument end |
#mandate_date_of_signature ⇒ Object
Returns the value of attribute mandate_date_of_signature.
7 8 9 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 7 def mandate_date_of_signature @mandate_date_of_signature end |
#mandate_id ⇒ Object
Returns the value of attribute mandate_id.
7 8 9 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 7 def mandate_id @mandate_id end |
#original_creditor_account ⇒ Object
Returns the value of attribute original_creditor_account.
7 8 9 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 7 def original_creditor_account @original_creditor_account end |
#original_debtor_account ⇒ Object
Returns the value of attribute original_debtor_account.
7 8 9 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 7 def original_debtor_account @original_debtor_account end |
#same_mandate_new_debtor_agent ⇒ Object
Returns the value of attribute same_mandate_new_debtor_agent.
7 8 9 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 7 def same_mandate_new_debtor_agent @same_mandate_new_debtor_agent end |
#sequence_type ⇒ Object
Returns the value of attribute sequence_type.
7 8 9 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 7 def sequence_type @sequence_type end |
Instance Method Details
#amendment_informations? ⇒ Boolean
41 42 43 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 41 def amendment_informations? original_debtor_account || same_mandate_new_debtor_agent || original_creditor_account end |
#schema_compatible?(schema_name) ⇒ Boolean
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/sepa_king/transaction/direct_debit_transaction.rb', line 45 def schema_compatible?(schema_name) case schema_name when PAIN_008_002_02 self.bic.present? && %w(CORE B2B).include?(self.local_instrument) && self.currency == 'EUR' when PAIN_008_003_02 self.currency == 'EUR' when PAIN_008_001_02 true end end |