cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
129 lines (108 loc) • 8.83 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'], 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.Riskv1addressverificationsOrderInformationLineItems = factory(root.CyberSource.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Riskv1addressverificationsOrderInformationLineItems model module.
* @module model/Riskv1addressverificationsOrderInformationLineItems
* @version 0.0.1
*/
/**
* Constructs a new <code>Riskv1addressverificationsOrderInformationLineItems</code>.
* @alias module:model/Riskv1addressverificationsOrderInformationLineItems
* @class
* @param unitPrice {String} 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)
*/
var exports = function(unitPrice) {
var _this = this;
_this['unitPrice'] = unitPrice;
};
/**
* Constructs a <code>Riskv1addressverificationsOrderInformationLineItems</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/Riskv1addressverificationsOrderInformationLineItems} obj Optional instance to populate.
* @return {module:model/Riskv1addressverificationsOrderInformationLineItems} The populated <code>Riskv1addressverificationsOrderInformationLineItems</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('unitPrice')) {
obj['unitPrice'] = ApiClient.convertToType(data['unitPrice'], 'String');
}
if (data.hasOwnProperty('quantity')) {
obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Number');
}
if (data.hasOwnProperty('productSKU')) {
obj['productSKU'] = ApiClient.convertToType(data['productSKU'], 'String');
}
if (data.hasOwnProperty('productRisk')) {
obj['productRisk'] = ApiClient.convertToType(data['productRisk'], 'String');
}
if (data.hasOwnProperty('productName')) {
obj['productName'] = ApiClient.convertToType(data['productName'], 'String');
}
if (data.hasOwnProperty('productCode')) {
obj['productCode'] = ApiClient.convertToType(data['productCode'], 'String');
}
}
return obj;
}
/**
* 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;
/**
* 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;
/**
* 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;
/**
* Indicates the level of risk for the product. This field can contain one of the following values: - `low`: The product is associated with few chargebacks. - `normal`: The product is associated with a normal number of chargebacks. - `high`: The product is associated with many chargebacks.
* @member {String} productRisk
*/
exports.prototype['productRisk'] = 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;
/**
* Type of product. The value for this field is used to identify the product category (electronic, handling, physical, service, or shipping). The default value is `default`. If you are performing an authorization transaction (`processingOptions.capture` is set to `false`), and you set this field to a value other than `default` or one of the values related to shipping and/or handling, then `orderInformation.lineItems[].quantity`, `orderInformation.lineItems[].productName`, and `orderInformation.lineItems[].productSku` fields are required. Optional field. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes. The Product Codes for the tax service are located in the Cybersource Tax Codes guide. Contact Customer Support to request the guide. If you don't send a tax service Product Code in your tax request, product-based rules or exemptions will not be applied and the transaction will default to fully taxable in the locations where you've indicated you need to collect tax [by way of nexus, no nexus, or seller registration number fields].
* @member {String} productCode
*/
exports.prototype['productCode'] = undefined;
return exports;
}));