cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
176 lines (151 loc) • 7.71 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.Ptsv2paymentsRecurringPaymentInformation = factory(root.CyberSource.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Ptsv2paymentsRecurringPaymentInformation model module.
* @module model/Ptsv2paymentsRecurringPaymentInformation
* @version 0.0.1
*/
/**
* Constructs a new <code>Ptsv2paymentsRecurringPaymentInformation</code>.
* This object contains recurring payment information.
* @alias module:model/Ptsv2paymentsRecurringPaymentInformation
* @class
* @param endDate {String} The date after which no further recurring authorizations should be performed. Format: `YYYY-MM-DD` **Note** This field is required for recurring transactions.
* @param frequency {Number} Integer value indicating the minimum number of days between recurring authorizations. A frequency of monthly is indicated by the value 28. Multiple of 28 days will be used to indicate months. Example: 6 months = 168 Example values accepted (31 days): - 31 - 031 - 0031 **Note** This field is required for recurring transactions.
*/
var exports = function(endDate, frequency) {
var _this = this;
_this['endDate'] = endDate;
_this['frequency'] = frequency;
};
/**
* Constructs a <code>Ptsv2paymentsRecurringPaymentInformation</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/Ptsv2paymentsRecurringPaymentInformation} obj Optional instance to populate.
* @return {module:model/Ptsv2paymentsRecurringPaymentInformation} The populated <code>Ptsv2paymentsRecurringPaymentInformation</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('endDate')) {
obj['endDate'] = ApiClient.convertToType(data['endDate'], 'String');
}
if (data.hasOwnProperty('frequency')) {
obj['frequency'] = ApiClient.convertToType(data['frequency'], 'Number');
}
if (data.hasOwnProperty('numberOfPayments')) {
obj['numberOfPayments'] = ApiClient.convertToType(data['numberOfPayments'], 'Number');
}
if (data.hasOwnProperty('originalPurchaseDate')) {
obj['originalPurchaseDate'] = ApiClient.convertToType(data['originalPurchaseDate'], 'String');
}
if (data.hasOwnProperty('sequenceNumber')) {
obj['sequenceNumber'] = ApiClient.convertToType(data['sequenceNumber'], 'Number');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('occurrence')) {
obj['occurrence'] = ApiClient.convertToType(data['occurrence'], 'String');
}
if (data.hasOwnProperty('validationIndicator')) {
obj['validationIndicator'] = ApiClient.convertToType(data['validationIndicator'], 'String');
}
if (data.hasOwnProperty('amountType')) {
obj['amountType'] = ApiClient.convertToType(data['amountType'], 'String');
}
if (data.hasOwnProperty('maximumAmount')) {
obj['maximumAmount'] = ApiClient.convertToType(data['maximumAmount'], 'String');
}
if (data.hasOwnProperty('referenceNumber')) {
obj['referenceNumber'] = ApiClient.convertToType(data['referenceNumber'], 'String');
}
}
return obj;
}
/**
* The date after which no further recurring authorizations should be performed. Format: `YYYY-MM-DD` **Note** This field is required for recurring transactions.
* @member {String} endDate
*/
exports.prototype['endDate'] = undefined;
/**
* Integer value indicating the minimum number of days between recurring authorizations. A frequency of monthly is indicated by the value 28. Multiple of 28 days will be used to indicate months. Example: 6 months = 168 Example values accepted (31 days): - 31 - 031 - 0031 **Note** This field is required for recurring transactions.
* @member {Number} frequency
*/
exports.prototype['frequency'] = undefined;
/**
* Total number of payments for the duration of the recurring subscription.
* @member {Number} numberOfPayments
*/
exports.prototype['numberOfPayments'] = undefined;
/**
* Date of original purchase. Required for recurring transactions. Format: `YYYY-MM-DDTHH:MM:SSZ` **Note**: If this field is empty, the current date is used.
* @member {String} originalPurchaseDate
*/
exports.prototype['originalPurchaseDate'] = undefined;
/**
* This field is mandatory for Cartes Bancaires recurring transactions on Credit Mutuel-CIC. This field records recurring sequence, e.g. 1st for initial, 2 for subsequent, 3 etc
* @member {Number} sequenceNumber
*/
exports.prototype['sequenceNumber'] = undefined;
/**
* This contains the type of recurring payment. Valid Values : 1 - Registration/First transaction 2 - Subsequent transaction 3 - Modification 4 - Cancellation
* @member {String} type
*/
exports.prototype['type'] = undefined;
/**
* This value indicates how often a recurring payment occurs. Valid Values : • 01 (Daily) • 02 (Twice weekly) • 03 (Weekly) • 04 (Ten days) • 05 (Fortnightly) • 06 (Monthly) • 07 (Every two months) • 08 (Trimester) • 09 (Quarterly) • 10 (Twice yearly) • 11 (Annually) • 12 (Unscheduled)
* @member {String} occurrence
*/
exports.prototype['occurrence'] = undefined;
/**
* This tag will contain a value that indicates whether or not the recurring payment transaction has been validated. Valid values : 0- Not validated 1- Validated
* @member {String} validationIndicator
*/
exports.prototype['validationIndicator'] = undefined;
/**
* Indicates recurring amount type agreed by the cardholder Valid Values : 1- Fixed amount recurring payment 2- Recurring payment with maximum amount
* @member {String} amountType
*/
exports.prototype['amountType'] = undefined;
/**
* This API field will contain the maximum amount agreed to by the cardholder. The currency of this amount will be specified in Field 49—Currency Code,Transaction.
* @member {String} maximumAmount
*/
exports.prototype['maximumAmount'] = undefined;
/**
* This will contain a unique reference number for the recurring payment transaction.
* @member {String} referenceNumber
*/
exports.prototype['referenceNumber'] = undefined;
return exports;
}));