Class: SEPA::CreditTransferTransaction
- Inherits:
-
Transaction
- Object
- Transaction
- SEPA::CreditTransferTransaction
- Includes:
- RegulatoryReportingValidator
- Defined in:
- lib/sepa_rator/transaction/credit_transfer_transaction.rb
Constant Summary collapse
- CHARGE_BEARERS =
%w[DEBT CRED SHAR SLEV].freeze
- INSTRUCTION3_CODES =
%w[CHQB HOLD PHOB TELB].freeze
- FREQUENCY_CODES =
%w[YEAR MNTH QURT MIAN WEEK DAIL ADHO INDA FRTN].freeze
- REGULATORY_INDICATORS =
RegulatoryReportingValidator::REGULATORY_INDICATORS
Constants included from RegulatoryReportingValidator
RegulatoryReportingValidator::COUNTRY_CODE_REGEX, RegulatoryReportingValidator::CURRENCY_CODE_REGEX
Constants inherited from Transaction
Transaction::DEFAULT_REQUESTED_DATE, Transaction::UETR_REGEX
Instance Attribute Summary collapse
-
#category_purpose ⇒ Object
Returns the value of attribute category_purpose.
-
#charge_bearer ⇒ Object
Returns the value of attribute charge_bearer.
-
#credit_transfer_mandate_date_of_signature ⇒ Object
Returns the value of attribute credit_transfer_mandate_date_of_signature.
-
#credit_transfer_mandate_frequency ⇒ Object
Returns the value of attribute credit_transfer_mandate_frequency.
-
#credit_transfer_mandate_id ⇒ Object
Returns the value of attribute credit_transfer_mandate_id.
-
#creditor_address ⇒ Object
Returns the value of attribute creditor_address.
-
#creditor_contact_details ⇒ Object
Returns the value of attribute creditor_contact_details.
-
#debtor_agent_instruction ⇒ Object
Returns the value of attribute debtor_agent_instruction.
-
#instruction_for_debtor_agent ⇒ Object
Returns the value of attribute instruction_for_debtor_agent.
-
#instruction_for_debtor_agent_code ⇒ Object
Returns the value of attribute instruction_for_debtor_agent_code.
-
#instructions_for_creditor_agent ⇒ Object
Returns the value of attribute instructions_for_creditor_agent.
-
#regulatory_reportings ⇒ Object
Returns the value of attribute regulatory_reportings.
-
#service_level ⇒ Object
Returns the value of attribute service_level.
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
-
#compatible_capabilities?(profile) ⇒ Boolean
Driven by capabilities advertised on the profile.
- #credit_transfer_mandate? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ CreditTransferTransaction
constructor
A new instance of CreditTransferTransaction.
Methods inherited from Transaction
Methods included from Converter
Constructor Details
#initialize(attributes = {}) ⇒ CreditTransferTransaction
Returns a new instance of CreditTransferTransaction.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 52 def initialize(attributes = {}) super # Ergonomic default: EUR transactions get SvcLvl=SEPA unless the # caller overrides it. EPC profiles require SvcLvl to be emitted # explicitly, and the alternative (URGP) is rare enough that callers # who want it set it explicitly. Profiles that forbid SEPA (e.g. # future non-EPC SEPA-zone profiles) can still override via a # transaction-level nil assignment. self.service_level ||= 'SEPA' if currency == 'EUR' end |
Instance Attribute Details
#category_purpose ⇒ Object
Returns the value of attribute category_purpose.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def category_purpose @category_purpose end |
#charge_bearer ⇒ Object
Returns the value of attribute charge_bearer.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def charge_bearer @charge_bearer end |
#credit_transfer_mandate_date_of_signature ⇒ Object
Returns the value of attribute credit_transfer_mandate_date_of_signature.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def credit_transfer_mandate_date_of_signature @credit_transfer_mandate_date_of_signature end |
#credit_transfer_mandate_frequency ⇒ Object
Returns the value of attribute credit_transfer_mandate_frequency.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def credit_transfer_mandate_frequency @credit_transfer_mandate_frequency end |
#credit_transfer_mandate_id ⇒ Object
Returns the value of attribute credit_transfer_mandate_id.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def credit_transfer_mandate_id @credit_transfer_mandate_id end |
#creditor_address ⇒ Object
Returns the value of attribute creditor_address.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def creditor_address @creditor_address end |
#creditor_contact_details ⇒ Object
Returns the value of attribute creditor_contact_details.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def creditor_contact_details @creditor_contact_details end |
#debtor_agent_instruction ⇒ Object
Returns the value of attribute debtor_agent_instruction.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def debtor_agent_instruction @debtor_agent_instruction end |
#instruction_for_debtor_agent ⇒ Object
Returns the value of attribute instruction_for_debtor_agent.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def instruction_for_debtor_agent @instruction_for_debtor_agent end |
#instruction_for_debtor_agent_code ⇒ Object
Returns the value of attribute instruction_for_debtor_agent_code.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def instruction_for_debtor_agent_code @instruction_for_debtor_agent_code end |
#instructions_for_creditor_agent ⇒ Object
Returns the value of attribute instructions_for_creditor_agent.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def instructions_for_creditor_agent @instructions_for_creditor_agent end |
#regulatory_reportings ⇒ Object
Returns the value of attribute regulatory_reportings.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def regulatory_reportings @regulatory_reportings end |
#service_level ⇒ Object
Returns the value of attribute service_level.
7 8 9 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 7 def service_level @service_level end |
Instance Method Details
#compatible_capabilities?(profile) ⇒ Boolean
Driven by capabilities advertised on the profile. Profile-level rules (currency, service level, charge bearer) flow via ‘profile.accept_transaction` in the base Transaction#compatible_with?.
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 70 def compatible_capabilities?(profile) requires_capability?(uetr, profile, :uetr) && requires_capability?(agent_lei, profile, :lei) && requires_capability?(debtor_agent_instruction, profile, :pmtinf_debtor_agent_instruction) && requires_capability?(credit_transfer_mandate?, profile, :mandate_related_info) && requires_capability?(instruction_for_debtor_agent, profile, :txn_instruction_for_debtor_agent) && requires_capability?(regulatory_reportings&.any?, profile, :regulatory_reporting) && instr_for_dbtr_agt_code_compatible?(profile) && instructions_for_creditor_agent_compatible?(profile) && regulatory_reportings_compatible?(profile) && (!profile.features.requires_bic || (bic && !bic.empty?)) end |
#credit_transfer_mandate? ⇒ Boolean
63 64 65 |
# File 'lib/sepa_rator/transaction/credit_transfer_transaction.rb', line 63 def credit_transfer_mandate? credit_transfer_mandate_id || credit_transfer_mandate_date_of_signature || credit_transfer_mandate_frequency end |