Class: ESRPayment

Inherits:
DTA::Payments::Base show all
Includes:
DTA::Payment::Sortable
Defined in:
lib/payment_dta/payments/esr_payment.rb

Constant Summary

Constants included from DTA::CharacterConversion

DTA::CharacterConversion::CONVERSION_MAP_UTF8

Instance Method Summary collapse

Methods included from DTA::Payment::Sortable

#<=>

Methods inherited from DTA::Payments::Base

#account_to_be_debited, #amount, #bank_payment_instructions, #beneficiary_address, #beneficiary_address_line1, #beneficiary_address_line2, #beneficiary_address_line3, #beneficiary_address_line4, #beneficiary_bank_account_number, #beneficiary_bank_clearing_number, #beneficiary_iban_number, #beneficiary_institution_address, #beneficiary_institution_address_line1, #beneficiary_institution_address_line2, #beneficiary_institution_address_line3, #beneficiary_institution_address_line4, #beneficiary_institution_bank_account_number, #creation_date, #data_file_sender_identification, #entry_sequence_number, #header, #identification_bank_address, #identification_purpose, #initialize, #issuer_identification, #ordering_party_bank_clearing_number, #ordering_partys_address, #ordering_partys_address_line1, #ordering_partys_address_line2, #ordering_partys_address_line3, #ordering_partys_address_line4, #output_sequence_number, #output_sequence_number=, #payment_amount, #payment_amount_currency, #payment_amount_value, #payment_amount_value_date, #processing_flag, #purpose, #reason_for_payment_message, #reason_for_payment_message_line1, #reason_for_payment_message_line2, #reason_for_payment_message_line3, #reason_for_payment_message_line4, #reference_number, #requested_processing_date, #rule_of_charge, #segment1, #segment2, #segment3, #segment4, #segment5, #segment6, #to_dta, #transaction_number, #transaction_number=

Methods included from DTA::CharacterConversion

#dta_string, #encode_characters, #map_characters

Constructor Details

This class inherits a constructor from DTA::Payments::Base

Instance Method Details

#beneficiarys_esr_party_numberObject



19
20
21
# File 'lib/payment_dta/payments/esr_payment.rb', line 19

def beneficiarys_esr_party_number
 "/C/#{@data[:beneficiarys_esr_party_number].to_s.rjust(9,'0')}"
end

#beneficiarys_esr_party_number_checkObject



31
32
33
# File 'lib/payment_dta/payments/esr_payment.rb', line 31

def beneficiarys_esr_party_number_check
 @data[:beneficiarys_esr_party_number_check].to_s.ljust(2)
end

#payment_typeObject



15
16
17
# File 'lib/payment_dta/payments/esr_payment.rb', line 15

def payment_type
  '0'
end

#reason_for_payment_esr_reference_numberObject



23
24
25
26
27
28
29
# File 'lib/payment_dta/payments/esr_payment.rb', line 23

def reason_for_payment_esr_reference_number
 if @data[:beneficiarys_esr_party_number].to_s.size == 5
   @data[:reason_for_payment_esr_reference_number].to_s.ljust(27)
 else
   @data[:reason_for_payment_esr_reference_number].to_s.rjust(27,'0')
 end
end

#recordObject



7
8
9
# File 'lib/payment_dta/payments/esr_payment.rb', line 7

def record
  @record ||= segment1 + segment2 + segment3
end

#transaction_typeObject



11
12
13
# File 'lib/payment_dta/payments/esr_payment.rb', line 11

def transaction_type
  '826'
end