Class: AdvancedBilling::ACHAgreement
- Defined in:
- lib/advanced_billing/models/ach_agreement.rb
Overview
(Optional) If passed, the proof of the authorized ACH agreement terms will be persisted.
Instance Attribute Summary collapse
-
#agreement_terms ⇒ String
(Required when providing ACH agreement params) The ACH authorization agreement terms.
-
#authorizer_first_name ⇒ String
(Required when providing ACH agreement params) The first name of the person authorizing the ACH agreement.
-
#authorizer_last_name ⇒ String
(Required when providing ACH agreement params) The last name of the person authorizing the ACH agreement.
-
#ip_address ⇒ String
(Required when providing ACH agreement params) The IP address of the person authorizing the ACH agreement.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(agreement_terms: SKIP, authorizer_first_name: SKIP, authorizer_last_name: SKIP, ip_address: SKIP, additional_properties: {}) ⇒ ACHAgreement
constructor
A new instance of ACHAgreement.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(agreement_terms: SKIP, authorizer_first_name: SKIP, authorizer_last_name: SKIP, ip_address: SKIP, additional_properties: {}) ⇒ ACHAgreement
Returns a new instance of ACHAgreement.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/advanced_billing/models/ach_agreement.rb', line 58 def initialize(agreement_terms: SKIP, authorizer_first_name: SKIP, authorizer_last_name: SKIP, ip_address: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end @agreement_terms = agreement_terms unless agreement_terms == SKIP @authorizer_first_name = unless == SKIP @authorizer_last_name = unless == SKIP @ip_address = ip_address unless ip_address == SKIP end |
Instance Attribute Details
#agreement_terms ⇒ String
(Required when providing ACH agreement params) The ACH authorization agreement terms.
16 17 18 |
# File 'lib/advanced_billing/models/ach_agreement.rb', line 16 def agreement_terms @agreement_terms end |
#authorizer_first_name ⇒ String
(Required when providing ACH agreement params) The first name of the person authorizing the ACH agreement.
21 22 23 |
# File 'lib/advanced_billing/models/ach_agreement.rb', line 21 def @authorizer_first_name end |
#authorizer_last_name ⇒ String
(Required when providing ACH agreement params) The last name of the person authorizing the ACH agreement.
26 27 28 |
# File 'lib/advanced_billing/models/ach_agreement.rb', line 26 def @authorizer_last_name end |
#ip_address ⇒ String
(Required when providing ACH agreement params) The IP address of the person authorizing the ACH agreement.
31 32 33 |
# File 'lib/advanced_billing/models/ach_agreement.rb', line 31 def ip_address @ip_address end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/advanced_billing/models/ach_agreement.rb', line 73 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. agreement_terms = hash.key?('agreement_terms') ? hash['agreement_terms'] : SKIP = hash.key?('authorizer_first_name') ? hash['authorizer_first_name'] : SKIP = hash.key?('authorizer_last_name') ? hash['authorizer_last_name'] : SKIP ip_address = hash.key?('ip_address') ? hash['ip_address'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } # Create object from extracted values. ACHAgreement.new(agreement_terms: agreement_terms, authorizer_first_name: , authorizer_last_name: , ip_address: ip_address, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 |
# File 'lib/advanced_billing/models/ach_agreement.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['agreement_terms'] = 'agreement_terms' @_hash['authorizer_first_name'] = 'authorizer_first_name' @_hash['authorizer_last_name'] = 'authorizer_last_name' @_hash['ip_address'] = 'ip_address' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/advanced_billing/models/ach_agreement.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 |
# File 'lib/advanced_billing/models/ach_agreement.rb', line 44 def self.optionals %w[ agreement_terms authorizer_first_name authorizer_last_name ip_address ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
98 99 100 101 102 103 104 |
# File 'lib/advanced_billing/models/ach_agreement.rb', line 98 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |