UNPKG

cybersource-rest-client

Version:

Node.js SDK for the CyberSource REST API

137 lines (114 loc) 5.85 kB
/** * 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'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient')); } else { // Browser globals (root is window) if (!root.CyberSource) { root.CyberSource = {}; } root.CyberSource.TssV2TransactionsGet200ResponseOrderInformationLineItems = factory(root.CyberSource.ApiClient); } }(this, function(ApiClient) { 'use strict'; /** * The TssV2TransactionsGet200ResponseOrderInformationLineItems model module. * @module model/TssV2TransactionsGet200ResponseOrderInformationLineItems * @version 0.0.1 */ /** * Constructs a new <code>TssV2TransactionsGet200ResponseOrderInformationLineItems</code>. * @alias module:model/TssV2TransactionsGet200ResponseOrderInformationLineItems * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>TssV2TransactionsGet200ResponseOrderInformationLineItems</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/TssV2TransactionsGet200ResponseOrderInformationLineItems} obj Optional instance to populate. * @return {module:model/TssV2TransactionsGet200ResponseOrderInformationLineItems} The populated <code>TssV2TransactionsGet200ResponseOrderInformationLineItems</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('productCode')) { obj['productCode'] = ApiClient.convertToType(data['productCode'], 'String'); } if (data.hasOwnProperty('productName')) { obj['productName'] = ApiClient.convertToType(data['productName'], 'String'); } if (data.hasOwnProperty('productSku')) { obj['productSku'] = ApiClient.convertToType(data['productSku'], 'String'); } if (data.hasOwnProperty('taxAmount')) { obj['taxAmount'] = ApiClient.convertToType(data['taxAmount'], 'String'); } if (data.hasOwnProperty('quantity')) { obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Number'); } if (data.hasOwnProperty('unitPrice')) { obj['unitPrice'] = ApiClient.convertToType(data['unitPrice'], 'String'); } if (data.hasOwnProperty('fulfillmentType')) { obj['fulfillmentType'] = ApiClient.convertToType(data['fulfillmentType'], 'String'); } } return obj; } /** * Type of product. This value is used to determine the category that the product is in: electronic, handling, physical, service, or shipping. The default value is **default**. For a payment, when you set this field to a value other than default or any of the values related to shipping and handling, below fields _quantity_, _productName_, and _productSKU_ are required. * @member {String} productCode */ exports.prototype['productCode'] = undefined; /** * For PAYMENT and CAPTURE API, this field is required when above _productCode_ is not **default** or one of the values related to shipping and handling. * @member {String} productName */ exports.prototype['productName'] = undefined; /** * Identification code for the product. For Payment and Capture APIs, this field is required when above `productCode` is not **default** or one of the values related to shipping and/or handling. * @member {String} productSku */ exports.prototype['productSku'] = undefined; /** * Total tax to apply to the product. This value cannot be negative. The tax amount and the offer amount must be in the same currency. The tax amount field is additive. The following example uses a two-exponent currency such as USD: 1. You include each line item in your request. - 1st line item has `amount=10.00`, `quantity=1`, and `taxAmount=0.80` - 2nd line item has `amount=20.00`, `quantity=1`, and `taxAmount=1.60` 2. The total amount authorized will be 32.40, not 30.00 with 2.40 of tax included. This field is frequently used for Level II and Level III transactions. * @member {String} taxAmount */ exports.prototype['taxAmount'] = undefined; /** * For a payment or capture, this field is required when _productCode_ is not **default** or one of the values related to shipping and handling. * @member {Number} quantity */ exports.prototype['quantity'] = undefined; /** * Per-item price of the product. This value cannot be negative. You can include a decimal point (.), but you cannot include any other special characters. CyberSource truncates the amount to the correct number of decimal places. * @member {String} unitPrice */ exports.prototype['unitPrice'] = undefined; /** * The description for this field is not available. * @member {String} fulfillmentType */ exports.prototype['fulfillmentType'] = undefined; return exports; }));