Class: SEPA::DirectDebitTransaction
- Inherits:
-
Transaction
- Object
- Transaction
- SEPA::DirectDebitTransaction
- Defined in:
- lib/sepa_rator/transaction/direct_debit_transaction.rb
Constant Summary collapse
- SEQUENCE_TYPES =
%w[FRST OOFF RCUR FNAL RPRE].freeze
- LOCAL_INSTRUMENTS =
%w[CORE COR1 B2B].freeze
- CHARGE_BEARERS =
%w[DEBT CRED SHAR SLEV].freeze
Constants inherited from Transaction
Transaction::DEFAULT_REQUESTED_DATE, Transaction::UETR_REGEX
Instance Attribute Summary collapse
-
#charge_bearer ⇒ Object
Returns the value of attribute charge_bearer.
-
#creditor_account ⇒ Object
Returns the value of attribute creditor_account.
-
#debtor_address ⇒ Object
Returns the value of attribute debtor_address.
-
#debtor_contact_details ⇒ Object
Returns the value of attribute debtor_contact_details.
-
#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.
-
#original_mandate_id ⇒ Object
Returns the value of attribute original_mandate_id.
-
#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
#additional_remittance_information, #agent_lei, #amount, #batch_booking, #bic, #currency, #iban, #instruction, #instruction_priority, #name, #purpose_code, #reference, #remittance_information, #requested_date, #structured_remittance_information, #structured_remittance_issuer, #structured_remittance_reference_type, #uetr, #ultimate_creditor_name, #ultimate_debtor_name
Instance Method Summary collapse
- #amendment_informations? ⇒ Boolean
- #compatible_capabilities?(profile) ⇒ Boolean
-
#initialize(attributes = {}) ⇒ DirectDebitTransaction
constructor
A new instance of DirectDebitTransaction.
Methods inherited from Transaction
Methods included from Converter
Constructor Details
#initialize(attributes = {}) ⇒ DirectDebitTransaction
Returns a new instance of DirectDebitTransaction.
44 45 46 47 48 49 50 51 52 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 44 def initialize(attributes = {}) super self.local_instrument ||= 'CORE' self.sequence_type ||= 'OOFF' return unless local_instrument == 'COR1' warn '[SEPA] COR1 local instrument is deprecated since November 2017. Use CORE instead.' end |
Instance Attribute Details
#charge_bearer ⇒ Object
Returns the value of attribute charge_bearer.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def charge_bearer @charge_bearer end |
#creditor_account ⇒ Object
Returns the value of attribute creditor_account.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def creditor_account @creditor_account end |
#debtor_address ⇒ Object
Returns the value of attribute debtor_address.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def debtor_address @debtor_address end |
#debtor_contact_details ⇒ Object
Returns the value of attribute debtor_contact_details.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def debtor_contact_details @debtor_contact_details end |
#local_instrument ⇒ Object
Returns the value of attribute local_instrument.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def local_instrument @local_instrument end |
#mandate_date_of_signature ⇒ Object
Returns the value of attribute mandate_date_of_signature.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def mandate_date_of_signature @mandate_date_of_signature end |
#mandate_id ⇒ Object
Returns the value of attribute mandate_id.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def mandate_id @mandate_id end |
#original_creditor_account ⇒ Object
Returns the value of attribute original_creditor_account.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def original_creditor_account @original_creditor_account end |
#original_debtor_account ⇒ Object
Returns the value of attribute original_debtor_account.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def original_debtor_account @original_debtor_account end |
#original_mandate_id ⇒ Object
Returns the value of attribute original_mandate_id.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def original_mandate_id @original_mandate_id end |
#same_mandate_new_debtor_agent ⇒ Object
Returns the value of attribute same_mandate_new_debtor_agent.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def same_mandate_new_debtor_agent @same_mandate_new_debtor_agent end |
#sequence_type ⇒ Object
Returns the value of attribute sequence_type.
9 10 11 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 9 def sequence_type @sequence_type end |
Instance Method Details
#amendment_informations? ⇒ Boolean
54 55 56 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 54 def amendment_informations? original_mandate_id || original_debtor_account || same_mandate_new_debtor_agent || original_creditor_account end |
#compatible_capabilities?(profile) ⇒ Boolean
58 59 60 61 62 63 |
# File 'lib/sepa_rator/transaction/direct_debit_transaction.rb', line 58 def compatible_capabilities?(profile) requires_capability?(uetr, profile, :uetr) && requires_capability?(agent_lei, profile, :lei) && requires_capability?(creditor_account&.agent_lei, profile, :lei) && (!profile.features.requires_bic || (bic && !bic.empty?)) end |