Exception: AchClient::ICheckGateway::InstantRejectionError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- AchClient::ICheckGateway::InstantRejectionError
- Defined in:
- lib/ach_client/providers/soap/i_check_gateway/instant_rejection_error.rb
Overview
ICheckGateway sometimes returns an API error when a valid ACH transaction is sent in a handful of
rejection scenarios. This is unusual because most providers will accept the transaction, return an
external_ach_id, and then supply the rejection info when you poll for responses at a later date.
So far we have observed this happening in the following scenarios:
- When an invalid routing number is supplied (X13 - Invalid ACH Routing Number - Entry contains a Receiving DFI
Identification or Gateway Identification that is not a valid ACH routing number.)
- When there is a Notice of Change for the account number (C01 - ACH Change Code. Incorrect Account Number)
- When there is a Notice of Change for the routing number (C02 - ACH Change Code. Incorrect Transit Route)
This exception can be caught to handle the API error in the appropriate manner. The NACHA return code inferred from the error message is retrievable from the exception instance as well as any
addendum information provided by the API error (ie the correct new account/routing number)
Instance Attribute Summary collapse
-
#ach_response ⇒ Object
readonly
Returns the value of attribute ach_response.
Instance Method Summary collapse
-
#initialize(message = nil, nacha_return_code:, addendum: nil, transaction:) ⇒ InstantRejectionError
constructor
A new instance of InstantRejectionError.
Constructor Details
#initialize(message = nil, nacha_return_code:, addendum: nil, transaction:) ⇒ InstantRejectionError
Returns a new instance of InstantRejectionError.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ach_client/providers/soap/i_check_gateway/instant_rejection_error.rb', line 17 def initialize( = nil, nacha_return_code:, addendum: nil, transaction:) super() return_code = ReturnCodes.find_by(code: nacha_return_code) response_args = { amount: transaction.amount, date: transaction.effective_entry_date, return_code: return_code, } @ach_response = if return_code.correction? CorrectedAchResponse.new(**response_args, corrections: addendum) else ReturnedAchResponse.new(**response_args) end end |
Instance Attribute Details
#ach_response ⇒ Object (readonly)
Returns the value of attribute ach_response.
15 16 17 |
# File 'lib/ach_client/providers/soap/i_check_gateway/instant_rejection_error.rb', line 15 def ach_response @ach_response end |