Class: CyberSource::Ptsv2paymentsTravelInformationAutoRental

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Ptsv2paymentsTravelInformationAutoRental

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 238

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'noShowIndicator')
    self.no_show_indicator = attributes[:'noShowIndicator']
  end

  if attributes.has_key?(:'customerName')
    self.customer_name = attributes[:'customerName']
  end

  if attributes.has_key?(:'vehicleClass')
    self.vehicle_class = attributes[:'vehicleClass']
  end

  if attributes.has_key?(:'distanceTravelled')
    self.distance_travelled = attributes[:'distanceTravelled']
  end

  if attributes.has_key?(:'distanceUnit')
    self.distance_unit = attributes[:'distanceUnit']
  end

  if attributes.has_key?(:'returnDateTime')
    self.return_date_time = attributes[:'returnDateTime']
  end

  if attributes.has_key?(:'rentalDateTime')
    self.rental_date_time = attributes[:'rentalDateTime']
  end

  if attributes.has_key?(:'maxFreeDistance')
    self.max_free_distance = attributes[:'maxFreeDistance']
  end

  if attributes.has_key?(:'insuranceIndicator')
    self.insurance_indicator = attributes[:'insuranceIndicator']
  end

  if attributes.has_key?(:'programCode')
    self.program_code = attributes[:'programCode']
  end

  if attributes.has_key?(:'returnAddress')
    self.return_address = attributes[:'returnAddress']
  end

  if attributes.has_key?(:'rentalAddress')
    self.rental_address = attributes[:'rentalAddress']
  end

  if attributes.has_key?(:'agreementNumber')
    self.agreement_number = attributes[:'agreementNumber']
  end

  if attributes.has_key?(:'odometerReading')
    self.odometer_reading = attributes[:'odometerReading']
  end

  if attributes.has_key?(:'vehicleIdentificationNumber')
    self.vehicle_identification_number = attributes[:'vehicleIdentificationNumber']
  end

  if attributes.has_key?(:'companyId')
    self.company_id = attributes[:'companyId']
  end

  if attributes.has_key?(:'numberOfAdditionalDrivers')
    self.number_of_additional_drivers = attributes[:'numberOfAdditionalDrivers']
  end

  if attributes.has_key?(:'driverAge')
    self.driver_age = attributes[:'driverAge']
  end

  if attributes.has_key?(:'specialProgramCode')
    self.special_program_code = attributes[:'specialProgramCode']
  end

  if attributes.has_key?(:'vehicleMake')
    self.vehicle_make = attributes[:'vehicleMake']
  end

  if attributes.has_key?(:'vehicleModel')
    self.vehicle_model = attributes[:'vehicleModel']
  end

  if attributes.has_key?(:'timePeriod')
    self.time_period = attributes[:'timePeriod']
  end

  if attributes.has_key?(:'commodityCode')
    self.commodity_code = attributes[:'commodityCode']
  end

  if attributes.has_key?(:'customerServicePhoneNumber')
    self.customer_service_phone_number = attributes[:'customerServicePhoneNumber']
  end

  if attributes.has_key?(:'taxDetails')
    self.tax_details = attributes[:'taxDetails']
  end

  if attributes.has_key?(:'insuranceAmount')
    self.insurance_amount = attributes[:'insuranceAmount']
  end

  if attributes.has_key?(:'oneWayDropOffAmount')
    self.one_way_drop_off_amount = attributes[:'oneWayDropOffAmount']
  end

  if attributes.has_key?(:'adjustedAmountIndicator')
    self.adjusted_amount_indicator = attributes[:'adjustedAmountIndicator']
  end

  if attributes.has_key?(:'adjustedAmount')
    self.adjusted_amount = attributes[:'adjustedAmount']
  end

  if attributes.has_key?(:'fuelCharges')
    self.fuel_charges = attributes[:'fuelCharges']
  end

  if attributes.has_key?(:'weeklyRentalRate')
    self.weekly_rental_rate = attributes[:'weeklyRentalRate']
  end

  if attributes.has_key?(:'dailyRentalRate')
    self.daily_rental_rate = attributes[:'dailyRentalRate']
  end

  if attributes.has_key?(:'ratePerMile')
    self.rate_per_mile = attributes[:'ratePerMile']
  end

  if attributes.has_key?(:'mileageCharge')
    self.mileage_charge = attributes[:'mileageCharge']
  end

  if attributes.has_key?(:'extraMileageCharge')
    self.extra_mileage_charge = attributes[:'extraMileageCharge']
  end

  if attributes.has_key?(:'lateFeeAmount')
    self.late_fee_amount = attributes[:'lateFeeAmount']
  end

  if attributes.has_key?(:'towingCharge')
    self.towing_charge = attributes[:'towingCharge']
  end

  if attributes.has_key?(:'extraCharge')
    self.extra_charge = attributes[:'extraCharge']
  end

  if attributes.has_key?(:'gpsCharge')
    self.gps_charge = attributes[:'gpsCharge']
  end

  if attributes.has_key?(:'phoneCharge')
    self.phone_charge = attributes[:'phoneCharge']
  end

  if attributes.has_key?(:'parkingViolationCharge')
    self.parking_violation_charge = attributes[:'parkingViolationCharge']
  end

  if attributes.has_key?(:'otherCharges')
    self.other_charges = attributes[:'otherCharges']
  end
end

Instance Attribute Details

#adjusted_amountObject

Adjusted Amount indicates whether any miscellaneous charges were incurred after the vehicle was returned. For authorizations, this field is supported only for American Express. For captures, this field is supported only for MasterCard and American Express. NOTE For American Express, this field is required if the ‘travelInformation.autoRental.adjustedAmountIndicator` field is included in the request and has a value; otherwise, this field is optional. For all other card types, this field is ignored.



99
100
101
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 99

def adjusted_amount
  @adjusted_amount
end

#adjusted_amount_indicatorObject

For MasterCard and Discover: Adjusted amount indicator code that indicates any miscellaneous charges incurred after the auto was returned. Possible values: - ‘A` - Drop-off charges - `B` - Delivery charges - `C` - Parking expenses - `D` - Extra hours - `E` - Violations - `X` - More than one of the above charges For **American Express**: Audit indicator code that indicates any adjustment for mileage, fuel, auto damage, etc. made to a rental agreement and whether the cardholder was notified. Possible value for the authorization service: - `A` (default): adjustment amount greater than 0 (zero) Possible values for the capture service: - `X` - Multiple adjustments - `Y` - One adjustment only; Cardmember notified - `Z` - One adjustment only; Cardmember not notified. This value is used as the default if the request does not include this field and includes an adjustment amount greater than 0 (zero). This is an optional field.



96
97
98
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 96

def adjusted_amount_indicator
  @adjusted_amount_indicator
end

#agreement_numberObject

Auto rental agency’s agreement (invoice) number provided to the customer. It is used to trace any inquiries about transactions. This field is supported for Visa, MasterCard, and American Express. This Merchant-defined value, which may be composed of any combination of characters and/or numerals, may become part of the descriptive bill on the Cardmember’s statement.



52
53
54
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 52

def agreement_number
  @agreement_number
end

#commodity_codeObject

Commodity code or International description code used to classify the item. Contact your acquirer for a list of codes.



82
83
84
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 82

def commodity_code
  @commodity_code
end

#company_idObject

Corporate Identifier provides the unique identifier of the corporation or entity renting the vehicle: |Card Specific Validation|VISA|MasterCard|Discover|AMEX| |— |— |— |— | | Filed Length| NA| 12| NA| NA| | Field Type| NA| AN| NA| NA| | M/O/C| NA| O| NA| NA|



61
62
63
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 61

def company_id
  @company_id
end

#customer_nameObject

Name of the individual making the rental agreement. Valid data lengths by card: |Card Specific Validation|VISA|MasterCard|Discover|AMEX| |— |— |— |— | | Filed Length| 40| 40| 29| 26| | Field Type| AN| ANS| AN| AN| | M/O/C| O| M| M| M|



21
22
23
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 21

def customer_name
  @customer_name
end

#customer_service_phone_numberObject

Customer service telephone number that is used to resolve questions or disputes. Include the area code, exchange, and number. This field is supported only for MasterCard and American Express.



85
86
87
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 85

def customer_service_phone_number
  @customer_service_phone_number
end

#daily_rental_rateObject

Daily auto rental rate charged. This field is supported only for MasterCard and American Express. Field - Time Period needs to be populated with Daily if this field is present



108
109
110
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 108

def daily_rental_rate
  @daily_rental_rate
end

#distance_travelledObject

Total number of miles driven by the customer. This field is supported only for MasterCard and American Express.



27
28
29
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 27

def distance_travelled
  @distance_travelled
end

#distance_unitObject

Miles/Kilometers Indicator shows whether the “miles” fields are expressed in miles or kilometers. Allowed values: - ‘K` - Kilometers - `M` - Miles



30
31
32
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 30

def distance_unit
  @distance_unit
end

#driver_ageObject

Age of the driver renting the vehicle.



67
68
69
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 67

def driver_age
  @driver_age
end

#extra_chargeObject

(Extra Charges) provides the extra charges associated with the vehicle rental.



126
127
128
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 126

def extra_charge
  @extra_charge
end

#extra_mileage_chargeObject

Extra mileage charges that extend beyond the basic rental agreement. This field is supported only for Visa.



117
118
119
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 117

def extra_mileage_charge
  @extra_mileage_charge
end

#fuel_chargesObject

Extra gasoline charges that extend beyond the basic rental agreement. This field is supported only for Visa.



102
103
104
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 102

def fuel_charges
  @fuel_charges
end

#gps_chargeObject

Amount charged for renting a Global Positioning Service (GPS).



129
130
131
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 129

def gps_charge
  @gps_charge
end

#insurance_amountObject

Insurance charges. Field is conditional and can include decimal point.



90
91
92
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 90

def insurance_amount
  @insurance_amount
end

#insurance_indicatorObject

Used for MC and Discover Valid values: - ‘true` - Yes (insurance was purchased) - `false` - No (insurance was not purchased)



42
43
44
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 42

def insurance_indicator
  @insurance_indicator
end

#late_fee_amountObject

Extra charges related to a late return of the rented auto. This field is supported only for Visa.



120
121
122
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 120

def late_fee_amount
  @late_fee_amount
end

#max_free_distanceObject

Maximum number of free miles or kilometers allowed to a customer for the duration of the auto rental agreement. This field is supported only for MasterCard and American Express.



39
40
41
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 39

def max_free_distance
  @max_free_distance
end

#mileage_chargeObject

Regular Mileage Charge provides the amount charged for regular miles traveled during vehicle rental. Two decimal places



114
115
116
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 114

def mileage_charge
  @mileage_charge
end

#no_show_indicatorObject

No Show Indicator provides an indicator noting that the individual did not show up after making a reservation for a vehicle. Possible values: - true - false



18
19
20
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 18

def no_show_indicator
  @no_show_indicator
end

#number_of_additional_driversObject

The number of additional drivers included on the rental agreement not including the individual who signed the rental agreement.



64
65
66
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 64

def number_of_additional_drivers
  @number_of_additional_drivers
end

#odometer_readingObject

Odometer reading at time of vehicle rental.



55
56
57
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 55

def odometer_reading
  @odometer_reading
end

#one_way_drop_off_amountObject

Extra charges incurred for a one-way rental agreement for the auto. This field is supported only for Visa.



93
94
95
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 93

def one_way_drop_off_amount
  @one_way_drop_off_amount
end

#other_chargesObject

Total amount charged for all other miscellaneous charges not previously defined.



138
139
140
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 138

def other_charges
  @other_charges
end

#parking_violation_chargeObject

Extra charges incurred due to a parking violation for the auto. This field is supported only for Visa.



135
136
137
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 135

def parking_violation_charge
  @parking_violation_charge
end

#phone_chargeObject

Additional charges incurred for phone usage included on the total bill.



132
133
134
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 132

def phone_charge
  @phone_charge
end

#program_codeObject

Used to identify special circumstances applicable to the Card Transaction or Cardholder, such as "renter” or ”show”. This code is ‘2 digit` value agreed by Merchant and processor.



45
46
47
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 45

def program_code
  @program_code
end

#rate_per_mileObject

Rate charged for each mile. This field is supported only for MasterCard and American Express.



111
112
113
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 111

def rate_per_mile
  @rate_per_mile
end

#rental_addressObject

Returns the value of attribute rental_address.



49
50
51
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 49

def rental_address
  @rental_address
end

#rental_date_timeObject

Date/time the auto was picked up from the rental agency. Format: ‘yyyy-MM-dd HH-mm-ss z` This field is supported for Visa, MasterCard, and American Express.



36
37
38
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 36

def rental_date_time
  @rental_date_time
end

#return_addressObject

Returns the value of attribute return_address.



47
48
49
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 47

def return_address
  @return_address
end

#return_date_timeObject

Date/time the auto was returned to the rental agency. Format: “yyyy-MM-dd HH-mm-ss z“ This field is supported for Visa, MasterCard, and American Express.



33
34
35
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 33

def return_date_time
  @return_date_time
end

#special_program_codeObject

Program code used to identify special circumstances, such as “frequent renter” or “no show” status for the renter. Possible values: - ‘0`: not applicable (default) - `1`: frequent renter - `2`: no show For authorizations, this field is supported only for Visa. For captures, this field is supported for Visa, MasterCard, and American Express. Code for special programs applicable to the Card Transaction or the Cardholder.



70
71
72
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 70

def special_program_code
  @special_program_code
end

#tax_detailsObject

Returns the value of attribute tax_details.



87
88
89
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 87

def tax_details
  @tax_details
end

#time_periodObject

Indicates the time period for which the vehicle rental rate applies (e.g., daily, weekly or monthly). Daily, Weekly and Monthly are valid values.



79
80
81
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 79

def time_period
  @time_period
end

#towing_chargeObject

(Towing Charges) provides the amount charged to tow the rental vehicle.



123
124
125
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 123

def towing_charge
  @towing_charge
end

#vehicle_classObject

Classification of the rented auto. NOTE For VISA, this is a 2-byte optional code. Valid values for American Express & MasterCard: |American Express |MasterCard |Description| |— |— |— | | 0001| 0001| Mini| | 0002| 0002| Subcompact| | 0003| 0003| Economy| | 0004| 0004| Compact| | 0005| 0005| Midsize| | 0006| 0006| Intermediate| | 0007| 0007| Standard| | 0008| 0008| Fulll size| | 0009| 0009| Luxury| | 0010| 0010| Premium| | 0011| 0011| Minivan| | 0012| 0012| 12-passenger van| | 0013| 0013| Moving van| | 0014| 0014| 15-passenger van| | 0015| 0015| Cargo van| | 0016| 0016| 12-foot truck| | 0017| 0017| 20-foot truck| | 0018| 0018| 24-foot truck| | 0019| 0019| 26-foot truck| | 0020| 0020| Moped| | 0021| 0021| Stretch| | 0022| 0022| Regular| | 0023| 0023| Unique| | 0024| 0024| Exotic| | 0025| 0025| Small/medium truck| | 0026| 0026| Large truck| | 0027| 0027| Small SUV| | 0028| 0028| Medium SUV| | 0029| 0029| Large SUV| | 0030| 0030| Exotic SUV| | 9999| 9999| Miscellaneous| Additional Values allowed only for ‘American Express`: |American Express|MasterCard|Description| |— |— |— | | 0031| NA| Four Wheel Drive| | 0032| NA| Special| | 0099| NA| Taxi|



24
25
26
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 24

def vehicle_class
  @vehicle_class
end

#vehicle_identification_numberObject

This field contains a unique identifier assigned by the company to the vehicle.



58
59
60
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 58

def vehicle_identification_number
  @vehicle_identification_number
end

#vehicle_makeObject

Make of the vehicle being rented (e.g., Chevrolet or Ford).



73
74
75
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 73

def vehicle_make
  @vehicle_make
end

#vehicle_modelObject

Model of the vehicle being rented (e.g., Cavalier or Focus).



76
77
78
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 76

def vehicle_model
  @vehicle_model
end

#weekly_rental_rateObject

Weekly Rental Amount provides the amount charged for a seven-day rental period. Field - Time Period needs to be populated with Weekly if this field is present



105
106
107
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 105

def weekly_rental_rate
  @weekly_rental_rate
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
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
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 141

def self.attribute_map
  {
    :'no_show_indicator' => :'noShowIndicator',
    :'customer_name' => :'customerName',
    :'vehicle_class' => :'vehicleClass',
    :'distance_travelled' => :'distanceTravelled',
    :'distance_unit' => :'distanceUnit',
    :'return_date_time' => :'returnDateTime',
    :'rental_date_time' => :'rentalDateTime',
    :'max_free_distance' => :'maxFreeDistance',
    :'insurance_indicator' => :'insuranceIndicator',
    :'program_code' => :'programCode',
    :'return_address' => :'returnAddress',
    :'rental_address' => :'rentalAddress',
    :'agreement_number' => :'agreementNumber',
    :'odometer_reading' => :'odometerReading',
    :'vehicle_identification_number' => :'vehicleIdentificationNumber',
    :'company_id' => :'companyId',
    :'number_of_additional_drivers' => :'numberOfAdditionalDrivers',
    :'driver_age' => :'driverAge',
    :'special_program_code' => :'specialProgramCode',
    :'vehicle_make' => :'vehicleMake',
    :'vehicle_model' => :'vehicleModel',
    :'time_period' => :'timePeriod',
    :'commodity_code' => :'commodityCode',
    :'customer_service_phone_number' => :'customerServicePhoneNumber',
    :'tax_details' => :'taxDetails',
    :'insurance_amount' => :'insuranceAmount',
    :'one_way_drop_off_amount' => :'oneWayDropOffAmount',
    :'adjusted_amount_indicator' => :'adjustedAmountIndicator',
    :'adjusted_amount' => :'adjustedAmount',
    :'fuel_charges' => :'fuelCharges',
    :'weekly_rental_rate' => :'weeklyRentalRate',
    :'daily_rental_rate' => :'dailyRentalRate',
    :'rate_per_mile' => :'ratePerMile',
    :'mileage_charge' => :'mileageCharge',
    :'extra_mileage_charge' => :'extraMileageCharge',
    :'late_fee_amount' => :'lateFeeAmount',
    :'towing_charge' => :'towingCharge',
    :'extra_charge' => :'extraCharge',
    :'gps_charge' => :'gpsCharge',
    :'phone_charge' => :'phoneCharge',
    :'parking_violation_charge' => :'parkingViolationCharge',
    :'other_charges' => :'otherCharges'
  }
end

.swagger_typesObject

Attribute type mapping.



189
190
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/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 189

def self.swagger_types
  {
    :'no_show_indicator' => :'BOOLEAN',
    :'customer_name' => :'String',
    :'vehicle_class' => :'String',
    :'distance_travelled' => :'String',
    :'distance_unit' => :'String',
    :'return_date_time' => :'String',
    :'rental_date_time' => :'String',
    :'max_free_distance' => :'String',
    :'insurance_indicator' => :'BOOLEAN',
    :'program_code' => :'String',
    :'return_address' => :'Ptsv2paymentsTravelInformationAutoRentalReturnAddress',
    :'rental_address' => :'Ptsv2paymentsTravelInformationAutoRentalRentalAddress',
    :'agreement_number' => :'String',
    :'odometer_reading' => :'String',
    :'vehicle_identification_number' => :'String',
    :'company_id' => :'String',
    :'number_of_additional_drivers' => :'String',
    :'driver_age' => :'String',
    :'special_program_code' => :'String',
    :'vehicle_make' => :'String',
    :'vehicle_model' => :'String',
    :'time_period' => :'String',
    :'commodity_code' => :'String',
    :'customer_service_phone_number' => :'String',
    :'tax_details' => :'Ptsv2paymentsTravelInformationAutoRentalTaxDetails',
    :'insurance_amount' => :'String',
    :'one_way_drop_off_amount' => :'String',
    :'adjusted_amount_indicator' => :'String',
    :'adjusted_amount' => :'String',
    :'fuel_charges' => :'String',
    :'weekly_rental_rate' => :'String',
    :'daily_rental_rate' => :'String',
    :'rate_per_mile' => :'String',
    :'mileage_charge' => :'String',
    :'extra_mileage_charge' => :'String',
    :'late_fee_amount' => :'String',
    :'towing_charge' => :'String',
    :'extra_charge' => :'String',
    :'gps_charge' => :'String',
    :'phone_charge' => :'String',
    :'parking_violation_charge' => :'String',
    :'other_charges' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 650

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      no_show_indicator == o.no_show_indicator &&
      customer_name == o.customer_name &&
      vehicle_class == o.vehicle_class &&
      distance_travelled == o.distance_travelled &&
      distance_unit == o.distance_unit &&
      return_date_time == o.return_date_time &&
      rental_date_time == o.rental_date_time &&
      max_free_distance == o.max_free_distance &&
      insurance_indicator == o.insurance_indicator &&
      program_code == o.program_code &&
      return_address == o.return_address &&
      rental_address == o.rental_address &&
      agreement_number == o.agreement_number &&
      odometer_reading == o.odometer_reading &&
      vehicle_identification_number == o.vehicle_identification_number &&
      company_id == o.company_id &&
      number_of_additional_drivers == o.number_of_additional_drivers &&
      driver_age == o.driver_age &&
      special_program_code == o.special_program_code &&
      vehicle_make == o.vehicle_make &&
      vehicle_model == o.vehicle_model &&
      time_period == o.time_period &&
      commodity_code == o.commodity_code &&
      customer_service_phone_number == o.customer_service_phone_number &&
      tax_details == o.tax_details &&
      insurance_amount == o.insurance_amount &&
      one_way_drop_off_amount == o.one_way_drop_off_amount &&
      adjusted_amount_indicator == o.adjusted_amount_indicator &&
      adjusted_amount == o.adjusted_amount &&
      fuel_charges == o.fuel_charges &&
      weekly_rental_rate == o.weekly_rental_rate &&
      daily_rental_rate == o.daily_rental_rate &&
      rate_per_mile == o.rate_per_mile &&
      mileage_charge == o.mileage_charge &&
      extra_mileage_charge == o.extra_mileage_charge &&
      late_fee_amount == o.late_fee_amount &&
      towing_charge == o.towing_charge &&
      extra_charge == o.extra_charge &&
      gps_charge == o.gps_charge &&
      phone_charge == o.phone_charge &&
      parking_violation_charge == o.parking_violation_charge &&
      other_charges == o.other_charges
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 733

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = CyberSource.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



799
800
801
802
803
804
805
806
807
808
809
810
811
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 799

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 712

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


699
700
701
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 699

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



705
706
707
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 705

def hash
  [no_show_indicator, customer_name, vehicle_class, distance_travelled, distance_unit, return_date_time, rental_date_time, max_free_distance, insurance_indicator, program_code, return_address, rental_address, agreement_number, odometer_reading, vehicle_identification_number, company_id, number_of_additional_drivers, driver_age, special_program_code, vehicle_make, vehicle_model, time_period, commodity_code, customer_service_phone_number, tax_details, insurance_amount, one_way_drop_off_amount, adjusted_amount_indicator, adjusted_amount, fuel_charges, weekly_rental_rate, daily_rental_rate, rate_per_mile, mileage_charge, extra_mileage_charge, late_fee_amount, towing_charge, extra_charge, gps_charge, phone_charge, parking_violation_charge, other_charges].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



415
416
417
418
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 415

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



779
780
781
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 779

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



785
786
787
788
789
790
791
792
793
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 785

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



773
774
775
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 773

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



422
423
424
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_auto_rental.rb', line 422

def valid?
  true
end