Class: AchClient::Sftp::AchTransaction

Inherits:
Abstract::AchTransaction show all
Defined in:
lib/ach_client/providers/sftp/ach_transaction.rb

Overview

Generic SFTP provider representation of a single ACH Transaction

Instance Method Summary collapse

Methods inherited from Abstract::AchTransaction

arguments, #credit?, #debit?, #initialize, #send, #sendable?

Constructor Details

This class inherits a constructor from AchClient::Abstract::AchTransaction

Instance Method Details

#do_sendObject

Most SFTP providers only support batch transactions



7
8
9
# File 'lib/ach_client/providers/sftp/ach_transaction.rb', line 7

def do_send
  raise 'NACHA/SFTP providers do not support individual transactions'
end

#to_entry_detailACH::EntryDetail

Converts this ach transaction to the ACH gem’s representation of a ach transaction for eventual NACHA transformation

Returns:

  • (ACH::EntryDetail)

    ACH gem’s ach transaction record



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ach_client/providers/sftp/ach_transaction.rb', line 14

def to_entry_detail
  entry = ACH::EntryDetail.new
  entry.transaction_code = remove_newlines(transaction_code)
  entry.routing_number = remove_newlines(routing_number)
  entry. = remove_newlines()
  entry.amount = amount_in_cents
  entry.individual_id_number = remove_newlines(external_ach_id) # Doesn't need to be a number
  entry.individual_name = remove_newlines(merchant_name)
  entry.originating_dfi_identification = remove_newlines(
    self.class.module_parent.originating_dfi_identification
  )
  entry.trace_number = remove_non_digits(external_ach_id).to_i # Must be number
  entry
end