Class: Io::Flow::V0::Models::AchAuthorizationForm
- Inherits:
-
AuthorizationForm
- Object
- AuthorizationForm
- Io::Flow::V0::Models::AchAuthorizationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Used for initiating an ACH (Automated Clearing House) bank transfer.
Instance Attribute Summary collapse
-
#account_number ⇒ Object
readonly
Returns the value of attribute account_number.
-
#account_owner_name ⇒ Object
readonly
Returns the value of attribute account_owner_name.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#billing_address ⇒ Object
readonly
Returns the value of attribute billing_address.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#routing_number ⇒ Object
readonly
Returns the value of attribute routing_number.
Attributes inherited from AuthorizationForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AchAuthorizationForm
constructor
A new instance of AchAuthorizationForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from AuthorizationForm
Constructor Details
#initialize(incoming = {}) ⇒ AchAuthorizationForm
Returns a new instance of AchAuthorizationForm.
21690 21691 21692 21693 21694 21695 21696 21697 21698 21699 21700 21701 21702 21703 21704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21690 def initialize(incoming={}) super(:discriminator => AuthorizationForm::Types::ACH_AUTHORIZATION_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:account_owner_name, :account_number, :routing_number, :billing_address, :amount, :currency], 'AchAuthorizationForm') @account_owner_name = HttpClient::Preconditions.assert_class('account_owner_name', opts.delete(:account_owner_name), String) @account_number = HttpClient::Preconditions.assert_class('account_number', opts.delete(:account_number), String) @routing_number = HttpClient::Preconditions.assert_class('routing_number', opts.delete(:routing_number), String) @billing_address = (x = opts.delete(:billing_address); x.is_a?(::Io::Flow::V0::Models::BillingAddress) ? x : ::Io::Flow::V0::Models::BillingAddress.new(x)) @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String)) @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)) end |
Instance Attribute Details
#account_number ⇒ Object (readonly)
Returns the value of attribute account_number.
21688 21689 21690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def account_number @account_number end |
#account_owner_name ⇒ Object (readonly)
Returns the value of attribute account_owner_name.
21688 21689 21690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def account_owner_name @account_owner_name end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
21688 21689 21690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def amount @amount end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
21688 21689 21690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def attributes @attributes end |
#billing_address ⇒ Object (readonly)
Returns the value of attribute billing_address.
21688 21689 21690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def billing_address @billing_address end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
21688 21689 21690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def currency @currency end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
21688 21689 21690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def ip @ip end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
21688 21689 21690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def key @key end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
21688 21689 21690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def order_number @order_number end |
#routing_number ⇒ Object (readonly)
Returns the value of attribute routing_number.
21688 21689 21690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def routing_number @routing_number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
21710 21711 21712 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21710 def copy(incoming={}) AchAuthorizationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
21714 21715 21716 21717 21718 21719 21720 21721 21722 21723 21724 21725 21726 21727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21714 def subtype_to_hash { :account_owner_name => account_owner_name, :account_number => account_number, :routing_number => routing_number, :billing_address => billing_address.to_hash, :order_number => order_number, :amount => amount.to_f.to_s, :currency => currency, :key => key, :attributes => attributes.nil? ? nil : attributes, :ip => ip } end |
#to_json ⇒ Object
21706 21707 21708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21706 def to_json JSON.dump(to_hash) end |