Class: AchClient::AchWorks::AchTransaction
- Inherits:
-
AchClient::Abstract::AchTransaction
- Object
- AchClient::Abstract::AchTransaction
- AchClient::AchWorks::AchTransaction
- Defined in:
- lib/ach_client/providers/soap/ach_works/ach_transaction.rb
Overview
AchWorks implementation for AchTransaction
Instance Attribute Summary collapse
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#front_end_trace ⇒ String
AchWorks Ach needs a “FrontEndTrace”, for each ACH transaction.
-
#send ⇒ String
Send this transaction individually to AchWorks.
-
#to_hash ⇒ Hash
AchWorks.
Methods inherited from AchClient::Abstract::AchTransaction
#credit?, #debit?, #initialize
Constructor Details
This class inherits a constructor from AchClient::Abstract::AchTransaction
Instance Attribute Details
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
14 15 16 |
# File 'lib/ach_client/providers/soap/ach_works/ach_transaction.rb', line 14 def customer_id @customer_id end |
Class Method Details
.arguments ⇒ Object
10 11 12 |
# File 'lib/ach_client/providers/soap/ach_works/ach_transaction.rb', line 10 def self.arguments super + [:customer_id] end |
Instance Method Details
#front_end_trace ⇒ String
AchWorks Ach needs a “FrontEndTrace”, for each ACH transaction. These can be used to track the processing of the ACH after it has been submitted. You can use the id of your Ach record It should be unique per ACH The consumer is responsible for ensuring the uniqueness of this value
66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/ach_client/providers/soap/ach_works/ach_transaction.rb', line 66 def front_end_trace # I want to stop this before it goes through because AchWorks might # just truncate the value, which could result in lost Achs. if external_ach_id.length > 11 raise 'AchWorks requires a FrontEndTrace of 12 chars or less' else # The front end trace MUST NOT start with a W. # Our front end trace starts with a Z. # The letter Z is not the letter W. "Z#{external_ach_id}" end end |
#send ⇒ String
Send this transaction individually to AchWorks
18 19 20 21 22 23 24 25 26 |
# File 'lib/ach_client/providers/soap/ach_works/ach_transaction.rb', line 18 def send AchClient::AchWorks.wrap_request( method: :send_ach_trans, message: AchClient::AchWorks::CompanyInfo.build.to_hash.merge({ InpACHTransRecord: self.to_hash }), path: [:send_ach_trans_response, :send_ach_trans_result] )[:front_end_trace] end |
#to_hash ⇒ Hash
AchWorks
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/ach_client/providers/soap/ach_works/ach_transaction.rb', line 31 def to_hash { SSS: AchClient::AchWorks.s_s_s, LocID: AchClient::AchWorks.loc_i_d, FrontEndTrace: front_end_trace, CustomerName: merchant_name, CustomerRoutingNo: routing_number.to_s, CustomerAcctNo: account_number.to_s, OriginatorName: originator_name.try(:first, 16), TransactionCode: sec_code, CustTransType: AchClient::AchWorks::TransactionTypeTransformer.serialize_to_provider_value( transaction_type ), CustomerID: customer_id, CustomerAcctType: AchClient::AchWorks::AccountTypeTransformer.serialize_to_provider_value( self.account_type ), TransAmount: amount, CheckOrTransDate: DateFormatter.format(effective_entry_date), EffectiveDate: DateFormatter.format(effective_entry_date), Memo: memo.try(:first, 10), OpCode: 'S', # Check this AccountSet: '1' } end |