Class: VisaAcceptanceMergedSpec::BillTo1

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/bill_to1.rb

Overview

BillTo1 Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(first_name: SKIP, last_name: SKIP, address1: SKIP, address2: SKIP, locality: SKIP, postal_code: SKIP, administrative_area: SKIP, country: SKIP, email: SKIP, alternate_phone_number_verification_status: SKIP, alternate_email_verification_status: SKIP, phone_number: SKIP, name_suffix: SKIP, additional_properties: nil) ⇒ BillTo1

Returns a new instance of BillTo1.



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 158

def initialize(first_name: SKIP, last_name: SKIP, address1: SKIP,
               address2: SKIP, locality: SKIP, postal_code: SKIP,
               administrative_area: SKIP, country: SKIP, email: SKIP,
               alternate_phone_number_verification_status: SKIP,
               alternate_email_verification_status: SKIP,
               phone_number: SKIP, name_suffix: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @first_name = first_name unless first_name == SKIP
  @last_name = last_name unless last_name == SKIP
  @address1 = address1 unless address1 == SKIP
  @address2 = address2 unless address2 == SKIP
  @locality = locality unless locality == SKIP
  @postal_code = postal_code unless postal_code == SKIP
  @administrative_area = administrative_area unless administrative_area == SKIP
  @country = country unless country == SKIP
  @email = email unless email == SKIP
  unless alternate_phone_number_verification_status == SKIP
    @alternate_phone_number_verification_status =
      alternate_phone_number_verification_status
  end
  unless alternate_email_verification_status == SKIP
    @alternate_email_verification_status =
      alternate_email_verification_status
  end
  @phone_number = phone_number unless phone_number == SKIP
  @name_suffix = name_suffix unless name_suffix == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#address1String

First line of the billing street address.

Returns:

  • (String)


22
23
24
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 22

def address1
  @address1
end

#address2String

Second line of the billing street address.

Returns:

  • (String)


26
27
28
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 26

def address2
  @address2
end

#administrative_areaString

State or province of the billing address. Use the State, Province, and Territory Codes for the United States and Canada.

Returns:

  • (String)


49
50
51
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 49

def administrative_area
  @administrative_area
end

#alternate_email_verification_statusString

Visa Platform Connect

Contains one of the following values that will identify the phone number result code in the account verification response message: 'VERIFIED' - Customer verified 'UNVERIFIED' - Customer not verified 'FAILED' - Customer verification failed

Returns:

  • (String)


76
77
78
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 76

def alternate_email_verification_status
  @alternate_email_verification_status
end

#alternate_phone_number_verification_statusString

Visa Platform Connect

Contains one of the following values that will identify the phone number result code in the account verification response message: 'VERIFIED' - Customer verified 'UNVERIFIED' - Customer not verified 'FAILED' - Customer verification failed

Returns:

  • (String)


67
68
69
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 67

def alternate_phone_number_verification_status
  @alternate_phone_number_verification_status
end

#countryString

Country of the billing address. Use the two-character ISO Standard Country Codes.

Returns:

  • (String)


54
55
56
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 54

def country
  @country
end

#emailString

Email address of the customer.

Returns:

  • (String)


58
59
60
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 58

def email
  @email
end

#first_nameString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 14

def first_name
  @first_name
end

#last_nameString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 18

def last_name
  @last_name
end

#localityString

City of the billing address.

Returns:

  • (String)


30
31
32
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 30

def locality
  @locality
end

#name_suffixString

Customer’s name suffix.

Returns:

  • (String)


111
112
113
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 111

def name_suffix
  @name_suffix
end

#phone_numberString

Customer’s phone number. It is recommended that you include the country code when the order is from outside the U.S.

Chase Paymentech Solutions

Optional field.

Credit Mutuel-CIC

Optional field.

Visa Acceptance through VisaNet

Credit card networks cannot process transactions that contain non-ASCII characters. Visa Acceptance through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent Visa Acceptance through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, Visa Acceptance through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks.

For Payouts:

This field may be sent only for FDC Compass.

OmniPay Direct

Optional field.

SIX

Optional field.

TSYS Acquiring Solutions

Optional field.

Worldpay VAP

Optional field.

All other processors

Not used.

Returns:

  • (String)


107
108
109
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 107

def phone_number
  @phone_number
end

#postal_codeString

Postal code for the billing address. The postal code must consist of 5 to 9 digits. When the billing country is the U.S., the 9-digit postal code must follow this format: [5 digits][dash][4 digits] Example: 12345-6789 When the billing country is Canada, the 6-digit postal code must follow this format: [alpha][numeric][alpha][space] [numeric][alpha][numeric] Example: A1B 2C3

Returns:

  • (String)


44
45
46
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 44

def postal_code
  @postal_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 191

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  first_name = hash.key?('firstName') ? hash['firstName'] : SKIP
  last_name = hash.key?('lastName') ? hash['lastName'] : SKIP
  address1 = hash.key?('address1') ? hash['address1'] : SKIP
  address2 = hash.key?('address2') ? hash['address2'] : SKIP
  locality = hash.key?('locality') ? hash['locality'] : SKIP
  postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP
  administrative_area =
    hash.key?('administrativeArea') ? hash['administrativeArea'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  email = hash.key?('email') ? hash['email'] : SKIP
  alternate_phone_number_verification_status =
    hash.key?('alternatePhoneNumberVerificationStatus') ? hash['alternatePhoneNumberVerificationStatus'] : SKIP
  alternate_email_verification_status =
    hash.key?('alternateEmailVerificationStatus') ? hash['alternateEmailVerificationStatus'] : SKIP
  phone_number = hash.key?('phoneNumber') ? hash['phoneNumber'] : SKIP
  name_suffix = hash.key?('nameSuffix') ? hash['nameSuffix'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  BillTo1.new(first_name: first_name,
              last_name: last_name,
              address1: address1,
              address2: address2,
              locality: locality,
              postal_code: postal_code,
              administrative_area: administrative_area,
              country: country,
              email: email,
              alternate_phone_number_verification_status: alternate_phone_number_verification_status,
              alternate_email_verification_status: alternate_email_verification_status,
              phone_number: phone_number,
              name_suffix: name_suffix,
              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 114

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['first_name'] = 'firstName'
  @_hash['last_name'] = 'lastName'
  @_hash['address1'] = 'address1'
  @_hash['address2'] = 'address2'
  @_hash['locality'] = 'locality'
  @_hash['postal_code'] = 'postalCode'
  @_hash['administrative_area'] = 'administrativeArea'
  @_hash['country'] = 'country'
  @_hash['email'] = 'email'
  @_hash['alternate_phone_number_verification_status'] =
    'alternatePhoneNumberVerificationStatus'
  @_hash['alternate_email_verification_status'] =
    'alternateEmailVerificationStatus'
  @_hash['phone_number'] = 'phoneNumber'
  @_hash['name_suffix'] = 'nameSuffix'
  @_hash
end

.nullablesObject

An array for nullable fields



154
155
156
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 154

def self.nullables
  []
end

.optionalsObject

An array for optional fields



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 135

def self.optionals
  %w[
    first_name
    last_name
    address1
    address2
    locality
    postal_code
    administrative_area
    country
    email
    alternate_phone_number_verification_status
    alternate_email_verification_status
    phone_number
    name_suffix
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 249

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} first_name: #{@first_name.inspect}, last_name: #{@last_name.inspect},"\
  " address1: #{@address1.inspect}, address2: #{@address2.inspect}, locality:"\
  " #{@locality.inspect}, postal_code: #{@postal_code.inspect}, administrative_area:"\
  " #{@administrative_area.inspect}, country: #{@country.inspect}, email: #{@email.inspect},"\
  ' alternate_phone_number_verification_status:'\
  " #{@alternate_phone_number_verification_status.inspect},"\
  " alternate_email_verification_status: #{@alternate_email_verification_status.inspect},"\
  " phone_number: #{@phone_number.inspect}, name_suffix: #{@name_suffix.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



237
238
239
240
241
242
243
244
245
246
# File 'lib/visa_acceptance_merged_spec/models/bill_to1.rb', line 237

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} first_name: #{@first_name}, last_name: #{@last_name}, address1:"\
  " #{@address1}, address2: #{@address2}, locality: #{@locality}, postal_code:"\
  " #{@postal_code}, administrative_area: #{@administrative_area}, country: #{@country},"\
  " email: #{@email}, alternate_phone_number_verification_status:"\
  " #{@alternate_phone_number_verification_status}, alternate_email_verification_status:"\
  " #{@alternate_email_verification_status}, phone_number: #{@phone_number}, name_suffix:"\
  " #{@name_suffix}, additional_properties: #{@additional_properties}>"
end