cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
467 lines (407 loc) • 22.7 kB
JavaScript
/**
* CyberSource Merged Spec
* All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
*
* OpenAPI spec version: 0.0.1
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.38
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Ptsv2paymentsTravelInformationAutoRentalRentalAddress', 'model/Ptsv2paymentsTravelInformationAutoRentalReturnAddress', 'model/Ptsv2paymentsTravelInformationAutoRentalTaxDetails'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Ptsv2paymentsTravelInformationAutoRentalRentalAddress'), require('./Ptsv2paymentsTravelInformationAutoRentalReturnAddress'), require('./Ptsv2paymentsTravelInformationAutoRentalTaxDetails'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.Ptsv2paymentsTravelInformationAutoRental = factory(root.CyberSource.ApiClient, root.CyberSource.Ptsv2paymentsTravelInformationAutoRentalRentalAddress, root.CyberSource.Ptsv2paymentsTravelInformationAutoRentalReturnAddress, root.CyberSource.Ptsv2paymentsTravelInformationAutoRentalTaxDetails);
}
}(this, function(ApiClient, Ptsv2paymentsTravelInformationAutoRentalRentalAddress, Ptsv2paymentsTravelInformationAutoRentalReturnAddress, Ptsv2paymentsTravelInformationAutoRentalTaxDetails) {
'use strict';
/**
* The Ptsv2paymentsTravelInformationAutoRental model module.
* @module model/Ptsv2paymentsTravelInformationAutoRental
* @version 0.0.1
*/
/**
* Constructs a new <code>Ptsv2paymentsTravelInformationAutoRental</code>.
* @alias module:model/Ptsv2paymentsTravelInformationAutoRental
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Ptsv2paymentsTravelInformationAutoRental</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Ptsv2paymentsTravelInformationAutoRental} obj Optional instance to populate.
* @return {module:model/Ptsv2paymentsTravelInformationAutoRental} The populated <code>Ptsv2paymentsTravelInformationAutoRental</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('noShowIndicator')) {
obj['noShowIndicator'] = ApiClient.convertToType(data['noShowIndicator'], 'Boolean');
}
if (data.hasOwnProperty('customerName')) {
obj['customerName'] = ApiClient.convertToType(data['customerName'], 'String');
}
if (data.hasOwnProperty('vehicleClass')) {
obj['vehicleClass'] = ApiClient.convertToType(data['vehicleClass'], 'String');
}
if (data.hasOwnProperty('distanceTravelled')) {
obj['distanceTravelled'] = ApiClient.convertToType(data['distanceTravelled'], 'String');
}
if (data.hasOwnProperty('distanceUnit')) {
obj['distanceUnit'] = ApiClient.convertToType(data['distanceUnit'], 'String');
}
if (data.hasOwnProperty('returnDateTime')) {
obj['returnDateTime'] = ApiClient.convertToType(data['returnDateTime'], 'String');
}
if (data.hasOwnProperty('rentalDateTime')) {
obj['rentalDateTime'] = ApiClient.convertToType(data['rentalDateTime'], 'String');
}
if (data.hasOwnProperty('maxFreeDistance')) {
obj['maxFreeDistance'] = ApiClient.convertToType(data['maxFreeDistance'], 'String');
}
if (data.hasOwnProperty('insuranceIndicator')) {
obj['insuranceIndicator'] = ApiClient.convertToType(data['insuranceIndicator'], 'Boolean');
}
if (data.hasOwnProperty('programCode')) {
obj['programCode'] = ApiClient.convertToType(data['programCode'], 'String');
}
if (data.hasOwnProperty('returnAddress')) {
obj['returnAddress'] = Ptsv2paymentsTravelInformationAutoRentalReturnAddress.constructFromObject(data['returnAddress']);
}
if (data.hasOwnProperty('rentalAddress')) {
obj['rentalAddress'] = Ptsv2paymentsTravelInformationAutoRentalRentalAddress.constructFromObject(data['rentalAddress']);
}
if (data.hasOwnProperty('agreementNumber')) {
obj['agreementNumber'] = ApiClient.convertToType(data['agreementNumber'], 'String');
}
if (data.hasOwnProperty('odometerReading')) {
obj['odometerReading'] = ApiClient.convertToType(data['odometerReading'], 'String');
}
if (data.hasOwnProperty('vehicleIdentificationNumber')) {
obj['vehicleIdentificationNumber'] = ApiClient.convertToType(data['vehicleIdentificationNumber'], 'String');
}
if (data.hasOwnProperty('companyId')) {
obj['companyId'] = ApiClient.convertToType(data['companyId'], 'String');
}
if (data.hasOwnProperty('numberOfAdditionalDrivers')) {
obj['numberOfAdditionalDrivers'] = ApiClient.convertToType(data['numberOfAdditionalDrivers'], 'String');
}
if (data.hasOwnProperty('driverAge')) {
obj['driverAge'] = ApiClient.convertToType(data['driverAge'], 'String');
}
if (data.hasOwnProperty('specialProgramCode')) {
obj['specialProgramCode'] = ApiClient.convertToType(data['specialProgramCode'], 'String');
}
if (data.hasOwnProperty('vehicleMake')) {
obj['vehicleMake'] = ApiClient.convertToType(data['vehicleMake'], 'String');
}
if (data.hasOwnProperty('vehicleModel')) {
obj['vehicleModel'] = ApiClient.convertToType(data['vehicleModel'], 'String');
}
if (data.hasOwnProperty('timePeriod')) {
obj['timePeriod'] = ApiClient.convertToType(data['timePeriod'], 'String');
}
if (data.hasOwnProperty('commodityCode')) {
obj['commodityCode'] = ApiClient.convertToType(data['commodityCode'], 'String');
}
if (data.hasOwnProperty('customerServicePhoneNumber')) {
obj['customerServicePhoneNumber'] = ApiClient.convertToType(data['customerServicePhoneNumber'], 'String');
}
if (data.hasOwnProperty('taxDetails')) {
obj['taxDetails'] = Ptsv2paymentsTravelInformationAutoRentalTaxDetails.constructFromObject(data['taxDetails']);
}
if (data.hasOwnProperty('insuranceAmount')) {
obj['insuranceAmount'] = ApiClient.convertToType(data['insuranceAmount'], 'String');
}
if (data.hasOwnProperty('oneWayDropOffAmount')) {
obj['oneWayDropOffAmount'] = ApiClient.convertToType(data['oneWayDropOffAmount'], 'String');
}
if (data.hasOwnProperty('adjustedAmountIndicator')) {
obj['adjustedAmountIndicator'] = ApiClient.convertToType(data['adjustedAmountIndicator'], 'String');
}
if (data.hasOwnProperty('adjustedAmount')) {
obj['adjustedAmount'] = ApiClient.convertToType(data['adjustedAmount'], 'String');
}
if (data.hasOwnProperty('fuelCharges')) {
obj['fuelCharges'] = ApiClient.convertToType(data['fuelCharges'], 'String');
}
if (data.hasOwnProperty('weeklyRentalRate')) {
obj['weeklyRentalRate'] = ApiClient.convertToType(data['weeklyRentalRate'], 'String');
}
if (data.hasOwnProperty('dailyRentalRate')) {
obj['dailyRentalRate'] = ApiClient.convertToType(data['dailyRentalRate'], 'String');
}
if (data.hasOwnProperty('ratePerMile')) {
obj['ratePerMile'] = ApiClient.convertToType(data['ratePerMile'], 'String');
}
if (data.hasOwnProperty('mileageCharge')) {
obj['mileageCharge'] = ApiClient.convertToType(data['mileageCharge'], 'String');
}
if (data.hasOwnProperty('extraMileageCharge')) {
obj['extraMileageCharge'] = ApiClient.convertToType(data['extraMileageCharge'], 'String');
}
if (data.hasOwnProperty('lateFeeAmount')) {
obj['lateFeeAmount'] = ApiClient.convertToType(data['lateFeeAmount'], 'String');
}
if (data.hasOwnProperty('towingCharge')) {
obj['towingCharge'] = ApiClient.convertToType(data['towingCharge'], 'String');
}
if (data.hasOwnProperty('extraCharge')) {
obj['extraCharge'] = ApiClient.convertToType(data['extraCharge'], 'String');
}
if (data.hasOwnProperty('gpsCharge')) {
obj['gpsCharge'] = ApiClient.convertToType(data['gpsCharge'], 'String');
}
if (data.hasOwnProperty('phoneCharge')) {
obj['phoneCharge'] = ApiClient.convertToType(data['phoneCharge'], 'String');
}
if (data.hasOwnProperty('parkingViolationCharge')) {
obj['parkingViolationCharge'] = ApiClient.convertToType(data['parkingViolationCharge'], 'String');
}
if (data.hasOwnProperty('otherCharges')) {
obj['otherCharges'] = ApiClient.convertToType(data['otherCharges'], 'String');
}
if (data.hasOwnProperty('companyName')) {
obj['companyName'] = ApiClient.convertToType(data['companyName'], 'String');
}
if (data.hasOwnProperty('affiliateName')) {
obj['affiliateName'] = ApiClient.convertToType(data['affiliateName'], 'String');
}
}
return obj;
}
/**
* 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
* @member {Boolean} noShowIndicator
*/
exports.prototype['noShowIndicator'] = undefined;
/**
* 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|
* @member {String} customerName
*/
exports.prototype['customerName'] = undefined;
/**
* 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|
* @member {String} vehicleClass
*/
exports.prototype['vehicleClass'] = undefined;
/**
* Total number of miles driven by the customer. This field is supported only for MasterCard and American Express.
* @member {String} distanceTravelled
*/
exports.prototype['distanceTravelled'] = undefined;
/**
* Miles/Kilometers Indicator shows whether the \"miles\" fields are expressed in miles or kilometers. Allowed values: - `K` - Kilometers - `M` - Miles
* @member {String} distanceUnit
*/
exports.prototype['distanceUnit'] = undefined;
/**
* 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.
* @member {String} returnDateTime
*/
exports.prototype['returnDateTime'] = undefined;
/**
* 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.
* @member {String} rentalDateTime
*/
exports.prototype['rentalDateTime'] = undefined;
/**
* 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.
* @member {String} maxFreeDistance
*/
exports.prototype['maxFreeDistance'] = undefined;
/**
* Used for MC and Discover Valid values: - `true` - Yes (insurance was purchased) - `false` - No (insurance was not purchased)
* @member {Boolean} insuranceIndicator
*/
exports.prototype['insuranceIndicator'] = undefined;
/**
* 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.
* @member {String} programCode
*/
exports.prototype['programCode'] = undefined;
/**
* @member {module:model/Ptsv2paymentsTravelInformationAutoRentalReturnAddress} returnAddress
*/
exports.prototype['returnAddress'] = undefined;
/**
* @member {module:model/Ptsv2paymentsTravelInformationAutoRentalRentalAddress} rentalAddress
*/
exports.prototype['rentalAddress'] = undefined;
/**
* 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.
* @member {String} agreementNumber
*/
exports.prototype['agreementNumber'] = undefined;
/**
* Odometer reading at time of vehicle rental.
* @member {String} odometerReading
*/
exports.prototype['odometerReading'] = undefined;
/**
* This field contains a unique identifier assigned by the company to the vehicle.
* @member {String} vehicleIdentificationNumber
*/
exports.prototype['vehicleIdentificationNumber'] = undefined;
/**
* 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|
* @member {String} companyId
*/
exports.prototype['companyId'] = undefined;
/**
* The number of additional drivers included on the rental agreement not including the individual who signed the rental agreement.
* @member {String} numberOfAdditionalDrivers
*/
exports.prototype['numberOfAdditionalDrivers'] = undefined;
/**
* Age of the driver renting the vehicle.
* @member {String} driverAge
*/
exports.prototype['driverAge'] = undefined;
/**
* 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.
* @member {String} specialProgramCode
*/
exports.prototype['specialProgramCode'] = undefined;
/**
* Make of the vehicle being rented (e.g., Chevrolet or Ford).
* @member {String} vehicleMake
*/
exports.prototype['vehicleMake'] = undefined;
/**
* Model of the vehicle being rented (e.g., Cavalier or Focus).
* @member {String} vehicleModel
*/
exports.prototype['vehicleModel'] = undefined;
/**
* Indicates the time period for which the vehicle rental rate applies (e.g., daily, weekly or monthly). Daily, Weekly and Monthly are valid values.
* @member {String} timePeriod
*/
exports.prototype['timePeriod'] = undefined;
/**
* Commodity code or International description code used to classify the item. Contact your acquirer for a list of codes.
* @member {String} commodityCode
*/
exports.prototype['commodityCode'] = undefined;
/**
* 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.
* @member {String} customerServicePhoneNumber
*/
exports.prototype['customerServicePhoneNumber'] = undefined;
/**
* @member {module:model/Ptsv2paymentsTravelInformationAutoRentalTaxDetails} taxDetails
*/
exports.prototype['taxDetails'] = undefined;
/**
* Insurance charges. Field is conditional and can include decimal point.
* @member {String} insuranceAmount
*/
exports.prototype['insuranceAmount'] = undefined;
/**
* Extra charges incurred for a one-way rental agreement for the auto. This field is supported only for Visa.
* @member {String} oneWayDropOffAmount
*/
exports.prototype['oneWayDropOffAmount'] = undefined;
/**
* 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.
* @member {String} adjustedAmountIndicator
*/
exports.prototype['adjustedAmountIndicator'] = undefined;
/**
* 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.
* @member {String} adjustedAmount
*/
exports.prototype['adjustedAmount'] = undefined;
/**
* Extra gasoline charges that extend beyond the basic rental agreement. This field is supported only for Visa.
* @member {String} fuelCharges
*/
exports.prototype['fuelCharges'] = undefined;
/**
* 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
* @member {String} weeklyRentalRate
*/
exports.prototype['weeklyRentalRate'] = undefined;
/**
* 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
* @member {String} dailyRentalRate
*/
exports.prototype['dailyRentalRate'] = undefined;
/**
* Rate charged for each mile. This field is supported only for MasterCard and American Express.
* @member {String} ratePerMile
*/
exports.prototype['ratePerMile'] = undefined;
/**
* Regular Mileage Charge provides the amount charged for regular miles traveled during vehicle rental. Two decimal places
* @member {String} mileageCharge
*/
exports.prototype['mileageCharge'] = undefined;
/**
* Extra mileage charges that extend beyond the basic rental agreement. This field is supported only for Visa.
* @member {String} extraMileageCharge
*/
exports.prototype['extraMileageCharge'] = undefined;
/**
* Extra charges related to a late return of the rented auto. This field is supported only for Visa.
* @member {String} lateFeeAmount
*/
exports.prototype['lateFeeAmount'] = undefined;
/**
* (Towing Charges) provides the amount charged to tow the rental vehicle.
* @member {String} towingCharge
*/
exports.prototype['towingCharge'] = undefined;
/**
* (Extra Charges) provides the extra charges associated with the vehicle rental.
* @member {String} extraCharge
*/
exports.prototype['extraCharge'] = undefined;
/**
* Amount charged for renting a Global Positioning Service (GPS).
* @member {String} gpsCharge
*/
exports.prototype['gpsCharge'] = undefined;
/**
* Additional charges incurred for phone usage included on the total bill.
* @member {String} phoneCharge
*/
exports.prototype['phoneCharge'] = undefined;
/**
* Extra charges incurred due to a parking violation for the auto. This field is supported only for Visa.
* @member {String} parkingViolationCharge
*/
exports.prototype['parkingViolationCharge'] = undefined;
/**
* Total amount charged for all other miscellaneous charges not previously defined.
* @member {String} otherCharges
*/
exports.prototype['otherCharges'] = undefined;
/**
* Merchant to send their auto rental company name
* @member {String} companyName
*/
exports.prototype['companyName'] = undefined;
/**
* When merchant wants to send the affiliate name.
* @member {String} affiliateName
*/
exports.prototype['affiliateName'] = undefined;
return exports;
}));