UNPKG

cybersource-rest-client

Version:

Node.js SDK for the CyberSource REST API

157 lines (133 loc) 8.59 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.Iplv2paymentlinksOrderInformationLineItems = factory(root.CyberSource.ApiClient); } }(this, function(ApiClient) { 'use strict'; /** * The Iplv2paymentlinksOrderInformationLineItems model module. * @module model/Iplv2paymentlinksOrderInformationLineItems * @version 0.0.1 */ /** * Constructs a new <code>Iplv2paymentlinksOrderInformationLineItems</code>. * Line item from the order. * @alias module:model/Iplv2paymentlinksOrderInformationLineItems * @class * @param productName {String} For an authorization or capture transaction (`processingOptions.capture` is `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not `default` or one of the other values that are related to shipping and/or handling. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes. */ var exports = function(productName) { var _this = this; _this['productName'] = productName; }; /** * Constructs a <code>Iplv2paymentlinksOrderInformationLineItems</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/Iplv2paymentlinksOrderInformationLineItems} obj Optional instance to populate. * @return {module:model/Iplv2paymentlinksOrderInformationLineItems} The populated <code>Iplv2paymentlinksOrderInformationLineItems</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('productSku')) { obj['productSku'] = ApiClient.convertToType(data['productSku'], 'String'); } if (data.hasOwnProperty('productName')) { obj['productName'] = ApiClient.convertToType(data['productName'], '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('productDescription')) { obj['productDescription'] = ApiClient.convertToType(data['productDescription'], 'String'); } if (data.hasOwnProperty('discountAmount')) { obj['discountAmount'] = ApiClient.convertToType(data['discountAmount'], 'String'); } if (data.hasOwnProperty('discountPercent')) { obj['discountPercent'] = ApiClient.convertToType(data['discountPercent'], 'String'); } if (data.hasOwnProperty('taxAmount')) { obj['taxAmount'] = ApiClient.convertToType(data['taxAmount'], 'String'); } if (data.hasOwnProperty('taxRate')) { obj['taxRate'] = ApiClient.convertToType(data['taxRate'], 'String'); } } return obj; } /** * Product identifier code. Also known as the Stock Keeping Unit (SKU) code for the product. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not set to **default** or one of the other values that are related to shipping and/or handling. #### Tax Calculation Optional field for U.S. and Canadian taxes. Not applicable to international and value added taxes. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not `default` or one of the values related to shipping and/or handling. * @member {String} productSku */ exports.prototype['productSku'] = undefined; /** * For an authorization or capture transaction (`processingOptions.capture` is `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not `default` or one of the other values that are related to shipping and/or handling. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes. * @member {String} productName */ exports.prototype['productName'] = undefined; /** * Number of units for this order. Must be a non-negative integer. The default is `1`. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not `default` or one of the other values related to shipping and/or handling. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes. * @member {Number} quantity */ exports.prototype['quantity'] = undefined; /** * Per-item price of the product. This value for this field cannot be negative. You must include either this field or the request-level field `orderInformation.amountDetails.totalAmount` in your request. You can include a decimal point (.), but you cannot include any other special characters. The value is truncated to the correct number of decimal places. #### DCC with a Third-Party Provider Set this field to the converted amount that was returned by the DCC provider. You must include either the 1st line item in the order and this field, or the request-level field `orderInformation.amountDetails.totalAmount` in your request. #### Tax Calculation Required field for U.S., Canadian, international and value added taxes. #### Zero Amount Authorizations If your processor supports zero amount authorizations, you can set this field to 0 for the authorization to check if the card is lost or stolen. #### Maximum Field Lengths For GPN and JCN Gateway: Decimal (10) All other processors: Decimal (15) * @member {String} unitPrice */ exports.prototype['unitPrice'] = undefined; /** * Brief description of item. * @member {String} productDescription */ exports.prototype['productDescription'] = undefined; /** * Discount amount applied to the item. Maximum of 2 decimal places. You may provide either discountAmount or discountPercent (not both). If both are present, their values must be consistent. Otherwise, a validation error will be returned. * @member {String} discountAmount */ exports.prototype['discountAmount'] = undefined; /** * Discount rate applied to the item. Maximum of 3 decimal places. You may provide either discountAmount or discountPercent (not both). If both are present, their values must be consistent; otherwise, a validation error will be returned. Example: 5.25 (=5.25%) * @member {String} discountPercent */ exports.prototype['discountPercent'] = undefined; /** * Tax amount applied to the item. This value cannot be negative. Maximum of 2 decimal places. The tax amount and the offer amount must be in the same currency. The tax amount field is additive. If taxAmount is provided but taxRate is not, the taxRate will be calculated. * @member {String} taxAmount */ exports.prototype['taxAmount'] = undefined; /** * Tax rate applied to the item. Valid range: 1.001% to 99.999%. Maximum of 3 decimal places. If a taxRate is provided but taxAmount is missing or incorrect, the taxAmount based on the given taxRate will be overwritten. Example: 21.00 (=21.00%) * @member {String} taxRate */ exports.prototype['taxRate'] = undefined; return exports; }));