Class: UnivapayClientSdk::TransactionTokenUpdateRequestData

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/transaction_token_update_request_data.rb

Overview

Transaction Token Update Request Data schema.

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(cvv: SKIP, cardholder: SKIP, card_number: SKIP, exp_month: SKIP, exp_year: SKIP, line1: SKIP, line2: SKIP, state: SKIP, city: SKIP, country: SKIP, zip: SKIP, phone_number: SKIP, additional_properties: nil) ⇒ TransactionTokenUpdateRequestData

Returns a new instance of TransactionTokenUpdateRequestData.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 101

def initialize(cvv: SKIP, cardholder: SKIP, card_number: SKIP,
               exp_month: SKIP, exp_year: SKIP, line1: SKIP, line2: SKIP,
               state: SKIP, city: SKIP, country: SKIP, zip: SKIP,
               phone_number: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @cvv = cvv unless cvv == SKIP
  @cardholder = cardholder unless cardholder == SKIP
  @card_number = card_number unless card_number == SKIP
  @exp_month = exp_month unless exp_month == SKIP
  @exp_year = exp_year unless exp_year == SKIP
  @line1 = line1 unless line1 == SKIP
  @line2 = line2 unless line2 == SKIP
  @state = state unless state == SKIP
  @city = city unless city == SKIP
  @country = country unless country == SKIP
  @zip = zip unless zip == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#card_numberString

Card number.

Returns:

  • (String)


22
23
24
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 22

def card_number
  @card_number
end

#cardholderString

Cardholder name.

Returns:

  • (String)


18
19
20
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 18

def cardholder
  @cardholder
end

#cityString

City or locality.

Returns:

  • (String)


46
47
48
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 46

def city
  @city
end

#countryString

Country code.

Returns:

  • (String)


50
51
52
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 50

def country
  @country
end

#cvvString

Update if RECURRING_USAGE_REQUIRES_CVV error occurs.

Returns:

  • (String)


14
15
16
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 14

def cvv
  @cvv
end

#exp_monthInteger

Card expiration month.

Returns:

  • (Integer)


26
27
28
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 26

def exp_month
  @exp_month
end

#exp_yearInteger

Card expiration year.

Returns:

  • (Integer)


30
31
32
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 30

def exp_year
  @exp_year
end

#line1String

Primary street address line.

Returns:

  • (String)


34
35
36
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 34

def line1
  @line1
end

#line2String

Secondary street address line.

Returns:

  • (String)


38
39
40
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 38

def line2
  @line2
end

#phone_numberTransactionTokenUpdateRequestDataPhoneNumber

Transaction Token Update Request Data Phone Number schema.



58
59
60
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 58

def phone_number
  @phone_number
end

#stateString

State or prefecture.

Returns:

  • (String)


42
43
44
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 42

def state
  @state
end

#zipString

Postal code.

Returns:

  • (String)


54
55
56
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 54

def zip
  @zip
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 124

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  cvv = hash.key?('cvv') ? hash['cvv'] : SKIP
  cardholder = hash.key?('cardholder') ? hash['cardholder'] : SKIP
  card_number = hash.key?('card_number') ? hash['card_number'] : SKIP
  exp_month = hash.key?('exp_month') ? hash['exp_month'] : SKIP
  exp_year = hash.key?('exp_year') ? hash['exp_year'] : SKIP
  line1 = hash.key?('line1') ? hash['line1'] : SKIP
  line2 = hash.key?('line2') ? hash['line2'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  city = hash.key?('city') ? hash['city'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  zip = hash.key?('zip') ? hash['zip'] : SKIP
  phone_number = TransactionTokenUpdateRequestDataPhoneNumber.from_hash(hash['phone_number']) if
    hash['phone_number']

  # 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.
  TransactionTokenUpdateRequestData.new(cvv: cvv,
                                        cardholder: cardholder,
                                        card_number: card_number,
                                        exp_month: exp_month,
                                        exp_year: exp_year,
                                        line1: line1,
                                        line2: line2,
                                        state: state,
                                        city: city,
                                        country: country,
                                        zip: zip,
                                        phone_number: phone_number,
                                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cvv'] = 'cvv'
  @_hash['cardholder'] = 'cardholder'
  @_hash['card_number'] = 'card_number'
  @_hash['exp_month'] = 'exp_month'
  @_hash['exp_year'] = 'exp_year'
  @_hash['line1'] = 'line1'
  @_hash['line2'] = 'line2'
  @_hash['state'] = 'state'
  @_hash['city'] = 'city'
  @_hash['country'] = 'country'
  @_hash['zip'] = 'zip'
  @_hash['phone_number'] = 'phone_number'
  @_hash
end

.nullablesObject

An array for nullable fields



97
98
99
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 97

def self.nullables
  []
end

.optionalsObject

An array for optional fields



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 79

def self.optionals
  %w[
    cvv
    cardholder
    card_number
    exp_month
    exp_year
    line1
    line2
    state
    city
    country
    zip
    phone_number
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



175
176
177
178
179
180
181
182
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 175

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} cvv: #{@cvv.inspect}, cardholder: #{@cardholder.inspect}, card_number:"\
  " #{@card_number.inspect}, exp_month: #{@exp_month.inspect}, exp_year: #{@exp_year.inspect},"\
  " line1: #{@line1.inspect}, line2: #{@line2.inspect}, state: #{@state.inspect}, city:"\
  " #{@city.inspect}, country: #{@country.inspect}, zip: #{@zip.inspect}, phone_number:"\
  " #{@phone_number.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



166
167
168
169
170
171
172
# File 'lib/univapay_client_sdk/models/transaction_token_update_request_data.rb', line 166

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cvv: #{@cvv}, cardholder: #{@cardholder}, card_number: #{@card_number},"\
  " exp_month: #{@exp_month}, exp_year: #{@exp_year}, line1: #{@line1}, line2: #{@line2},"\
  " state: #{@state}, city: #{@city}, country: #{@country}, zip: #{@zip}, phone_number:"\
  " #{@phone_number}, additional_properties: #{@additional_properties}>"
end