Class: AuthorizeNet::ECheck
- Inherits:
-
Object
- Object
- AuthorizeNet::ECheck
- Defined in:
- lib/authorize_net/payment_methods/echeck.rb
Overview
Models an eCheck.
Defined Under Namespace
Modules: AccountType, CheckType
Constant Summary collapse
- PAYMENT_METHOD_CODE =
AuthorizeNet::PaymentMethodType::ECHECK
- @@option_defaults =
The option defaults for the constructor.
{ :echeck_type => CheckType::INTERNET_INITIATED, :check_number => nil, :account_type => AccountType::CHECKING }
Instance Attribute Summary collapse
-
#account_holder_name ⇒ Object
Returns the value of attribute account_holder_name.
-
#account_number ⇒ Object
Returns the value of attribute account_number.
-
#account_type ⇒ Object
Returns the value of attribute account_type.
-
#bank_name ⇒ Object
Returns the value of attribute bank_name.
-
#check_number ⇒ Object
Returns the value of attribute check_number.
-
#echeck_type ⇒ Object
Returns the value of attribute echeck_type.
-
#routing_number ⇒ Object
Returns the value of attribute routing_number.
Instance Method Summary collapse
-
#initialize(routing_number, account_number, bank_name, account_holder_name, options = {}) ⇒ ECheck
constructor
Constructs a new eCheck object.
- #to_hash ⇒ Object
Constructor Details
#initialize(routing_number, account_number, bank_name, account_holder_name, options = {}) ⇒ ECheck
Constructs a new eCheck object.
routing_number
-
The bank routing number as a string.
account_number
-
The bank account number as a string.
bank_name
-
The legal name of the bank. This should match the name associated with the
routing_number
. account_holder_name
-
The full name on the bank account represented by
account_number
. options
-
A hash of options. Accepts
echeck_type
(the type of check, can usually be ignored),check_number
(the number on the check, only needed for some check types), andaccount_type
(the type of bank account the check draws from). All values should be passed as strings.
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/authorize_net/payment_methods/echeck.rb', line 46 def initialize(routing_number, account_number, bank_name, account_holder_name, = {}) @routing_number = routing_number @account_number = account_number @bank_name = bank_name @account_holder_name = account_holder_name = @@option_defaults.merge() @echeck_type = [:echeck_type] @check_number = [:check_number] @account_type = [:account_type] end |
Instance Attribute Details
#account_holder_name ⇒ Object
Returns the value of attribute account_holder_name.
36 37 38 |
# File 'lib/authorize_net/payment_methods/echeck.rb', line 36 def account_holder_name @account_holder_name end |
#account_number ⇒ Object
Returns the value of attribute account_number.
36 37 38 |
# File 'lib/authorize_net/payment_methods/echeck.rb', line 36 def account_number @account_number end |
#account_type ⇒ Object
Returns the value of attribute account_type.
36 37 38 |
# File 'lib/authorize_net/payment_methods/echeck.rb', line 36 def account_type @account_type end |
#bank_name ⇒ Object
Returns the value of attribute bank_name.
36 37 38 |
# File 'lib/authorize_net/payment_methods/echeck.rb', line 36 def bank_name @bank_name end |
#check_number ⇒ Object
Returns the value of attribute check_number.
36 37 38 |
# File 'lib/authorize_net/payment_methods/echeck.rb', line 36 def check_number @check_number end |
#echeck_type ⇒ Object
Returns the value of attribute echeck_type.
36 37 38 |
# File 'lib/authorize_net/payment_methods/echeck.rb', line 36 def echeck_type @echeck_type end |
#routing_number ⇒ Object
Returns the value of attribute routing_number.
36 37 38 |
# File 'lib/authorize_net/payment_methods/echeck.rb', line 36 def routing_number @routing_number end |
Instance Method Details
#to_hash ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/authorize_net/payment_methods/echeck.rb', line 57 def to_hash hash = { :method => PAYMENT_METHOD_CODE, :bank_aba_code => @routing_number, :bank_acct_num => @account_number, :bank_acct_type => @account_type, :bank_name => @bank_name, :bank_acct_name => @account_holder_name, :echeck_type => @echeck_type } hash[:bank_check_number] = @check_number unless @check_number.nil? hash end |