Class: AchClient::Abstract::AchBatch
- Inherits:
-
Object
- Object
- AchClient::Abstract::AchBatch
- Defined in:
- lib/ach_client/providers/abstract/ach_batch.rb
Overview
Base class for sending batched ACH transactions to various providers
Direct Known Subclasses
AchClient::AchWorks::AchBatch, Fake::AchBatch, ICheckGateway::AchBatch, Sftp::AchBatch
Instance Method Summary collapse
-
#do_send_batch ⇒ Array<String>
Implementation of sending the ACH batch to the provider, to be implemented by the subclass processing later on.
-
#initialize(ach_transactions: []) ⇒ AchBatch
constructor
A new instance of AchBatch.
-
#send_batch ⇒ Array<String>
Sends the batch to the provider, and returns a tracking identifier processing later on.
Constructor Details
#initialize(ach_transactions: []) ⇒ AchBatch
Returns a new instance of AchBatch.
10 11 12 |
# File 'lib/ach_client/providers/abstract/ach_batch.rb', line 10 def initialize(ach_transactions: []) @ach_transactions = ach_transactions end |
Instance Method Details
#do_send_batch ⇒ Array<String>
Implementation of sending the ACH batch to the provider, to be
implemented by the subclass
processing later on.
30 31 32 |
# File 'lib/ach_client/providers/abstract/ach_batch.rb', line 30 def do_send_batch raise AbstractMethodError end |
#send_batch ⇒ Array<String>
Sends the batch to the provider, and returns a tracking identifier processing later on.
18 19 20 21 22 23 24 |
# File 'lib/ach_client/providers/abstract/ach_batch.rb', line 18 def send_batch if @ach_transactions.all?(&:sendable?) do_send_batch else raise InvalidAchTransactionError end end |