cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
236 lines (202 loc) • 17.6 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.Ptsv2paymentsInstallmentInformation = factory(root.CyberSource.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Ptsv2paymentsInstallmentInformation model module.
* @module model/Ptsv2paymentsInstallmentInformation
* @version 0.0.1
*/
/**
* Constructs a new <code>Ptsv2paymentsInstallmentInformation</code>.
* @alias module:model/Ptsv2paymentsInstallmentInformation
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Ptsv2paymentsInstallmentInformation</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/Ptsv2paymentsInstallmentInformation} obj Optional instance to populate.
* @return {module:model/Ptsv2paymentsInstallmentInformation} The populated <code>Ptsv2paymentsInstallmentInformation</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('amount')) {
obj['amount'] = ApiClient.convertToType(data['amount'], 'String');
}
if (data.hasOwnProperty('frequency')) {
obj['frequency'] = ApiClient.convertToType(data['frequency'], 'String');
}
if (data.hasOwnProperty('planType')) {
obj['planType'] = ApiClient.convertToType(data['planType'], 'String');
}
if (data.hasOwnProperty('sequence')) {
obj['sequence'] = ApiClient.convertToType(data['sequence'], 'Number');
}
if (data.hasOwnProperty('totalAmount')) {
obj['totalAmount'] = ApiClient.convertToType(data['totalAmount'], 'String');
}
if (data.hasOwnProperty('totalCount')) {
obj['totalCount'] = ApiClient.convertToType(data['totalCount'], 'Number');
}
if (data.hasOwnProperty('firstInstallmentDate')) {
obj['firstInstallmentDate'] = ApiClient.convertToType(data['firstInstallmentDate'], 'String');
}
if (data.hasOwnProperty('invoiceData')) {
obj['invoiceData'] = ApiClient.convertToType(data['invoiceData'], 'String');
}
if (data.hasOwnProperty('paymentType')) {
obj['paymentType'] = ApiClient.convertToType(data['paymentType'], 'String');
}
if (data.hasOwnProperty('eligibilityInquiry')) {
obj['eligibilityInquiry'] = ApiClient.convertToType(data['eligibilityInquiry'], 'String');
}
if (data.hasOwnProperty('gracePeriodDuration')) {
obj['gracePeriodDuration'] = ApiClient.convertToType(data['gracePeriodDuration'], 'String');
}
if (data.hasOwnProperty('gracePeriodDurationType')) {
obj['gracePeriodDurationType'] = ApiClient.convertToType(data['gracePeriodDurationType'], 'String');
}
if (data.hasOwnProperty('firstInstallmentAmount')) {
obj['firstInstallmentAmount'] = ApiClient.convertToType(data['firstInstallmentAmount'], 'String');
}
if (data.hasOwnProperty('validationIndicator')) {
obj['validationIndicator'] = ApiClient.convertToType(data['validationIndicator'], 'String');
}
if (data.hasOwnProperty('identifier')) {
obj['identifier'] = ApiClient.convertToType(data['identifier'], 'String');
}
if (data.hasOwnProperty('annualInterestRate')) {
obj['annualInterestRate'] = ApiClient.convertToType(data['annualInterestRate'], 'String');
}
if (data.hasOwnProperty('interestIndicator')) {
obj['interestIndicator'] = ApiClient.convertToType(data['interestIndicator'], 'String');
}
if (data.hasOwnProperty('isGovernmentPlan')) {
obj['isGovernmentPlan'] = ApiClient.convertToType(data['isGovernmentPlan'], 'Boolean');
}
}
return obj;
}
/**
* Amount for the current installment payment. This field is supported only for CyberSource through VisaNet.
* @member {String} amount
*/
exports.prototype['amount'] = undefined;
/**
* Frequency of the installment payments. When you do not include this field in a request for a Crediario installment payment, CyberSource sends a space character to the processor. This field is supported only for CyberSource through VisaNet. Possible values: - `B`: Biweekly - `M`: Monthly - `W`: Weekly For Crediario installment payments, the value for this field corresponds to the following data in the TC 33 capture file5: - Record: CP01 TCR9 - Position: 41 - Field: Installment Frequency
* @member {String} frequency
*/
exports.prototype['frequency'] = undefined;
/**
* #### American Express Direct, Cielo, and CyberSource Latin American Processing Flag that indicates the type of funding for the installment plan associated with the payment. Possible values: - `1`: Merchant-funded installment plan - `2`: Issuer-funded installment plan If you do not include this field in the request, CyberSource uses the value in your CyberSource account. To change the value in your CyberSource account, contact CyberSource Customer Service. #### CyberSource through VisaNet and American Express Defined code that indicates the type of installment plan for this transaction. Contact American Express for: - Information about the kinds of installment plans that American Express provides - Values for this field For installment payments with American Express in Brazil, the value for this field corresponds to the following data in the TC 33 capture file*: - Record: CP07 TCR3 - Position: 5-6 - Field: Plan Type * The TC 33 Capture file contains information about the purchases and refunds that a merchant submits to CyberSource. CyberSource through VisaNet creates the TC 33 Capture file at the end of the day and sends it to the merchant's acquirer, who uses this information to facilitate end-of-day clearing processing with payment card companies. #### CyberSource through VisaNet with Visa or Mastercard Flag indicating the type of funding for the installment plan associated with the payment. Possible values: - 1 or 01: Merchant-funded installment plan - 2 or 02: Issuer-funded installment plan - 43: Crediario installment plan—only with Visa in Brazil For installment payments with Visa in Brazil, the value for this field corresponds to the following data in the TC 33 capture file5: - Record: CP07 TCR1 - Position: 5-6 - Field: Installment Type For all other kinds of installment payments, the value for this field corresponds to the following data in the TC 33 capture file5: - Record: CP01 TCR5 - Position: 39-40 - Field: Installment Plan Type (Issuer or Merchant)
* @member {String} planType
*/
exports.prototype['planType'] = undefined;
/**
* Installment number when making payments in installments. Used along with `totalCount` to track which payment is being processed. For example, the second of 5 payments would be passed to CyberSource as `sequence` = 2 and `totalCount` = 5. #### Chase Paymentech Solutions and FDC Compass This field is optional because this value is required in the merchant descriptors. #### CyberSource through VisaNet When you do not include this field in a request for a Crediario installment payment, CyberSource sends a value of 0 to the processor. For Crediario installment payments, the value for this field corresponds to the following data in the TC 33 capture file*: - Record: CP01 TCR9 - Position: 38-40 - Field: Installment Payment Number * The TC 33 Capture file contains information about the purchases and refunds that a merchant submits to CyberSource. CyberSource through VisaNet creates the TC 33 Capture file at the end of the day and sends it to the merchant's acquirer, who uses this information to facilitate end-of-day clearing processing with payment card companies.
* @member {Number} sequence
*/
exports.prototype['sequence'] = undefined;
/**
* Total amount of the loan that is being paid in installments. This field is supported only for CyberSource through VisaNet.
* @member {String} totalAmount
*/
exports.prototype['totalAmount'] = undefined;
/**
* Total number of installments when making payments in installments. #### Chase Paymentech Solutions and FDC Compass This field is optional because this value is required in the merchant descriptors. #### American Express Direct, Cielo, and Comercio Latino This value is the total number of installments you approved. #### CyberSource Latin American Processing in Brazil This value is the total number of installments that you approved. The default is 1. #### All Other Processors This value is used along with _sequence_ to track which payment is being processed. For example, the second of 5 payments would be passed to CyberSource as _sequence_ = 2 and _totalCount_ = 5. #### CyberSource through VisaNet For Crediario installment payments, the value for this field corresponds to the following data in the TC 33 capture file*: - Record: CP01 TCR9 - Position: 23-25 - Field: Number of Installments For installment payments with American Express in Brazil, the value for this field corresponds to the following data in the TC 33 capture file*: - Record: CP07 TCR3 - Position: 7-8 - Field: Number of Installments For installment payments with Visa in Brazil, the value for this field corresponds to the following data in the TC 33 capture file*: - Record: CP07 TCR1 - Position: 7-8 - Field: Number of Installments For all other kinds of installment payments, the value for this field corresponds to the following data in the TC 33 capture file*: - Record: CP01 TCR5 - Position: 20-22 - Field: Installment Total Count **Note** The TC 33 Capture file contains information about the purchases and refunds that a merchant submits to CyberSource. CyberSource through VisaNet creates the TC 33 Capture file at the end of the day and sends it to the merchant's acquirer, who uses this information to facilitate end-of-day clearing processing with payment card companies.
* @member {Number} totalCount
*/
exports.prototype['totalCount'] = undefined;
/**
* Date of the first installment payment. Format: YYMMDD. When you do not include this field, CyberSource sends a string of six zeros (000000) to the processor. This field is supported only for Crediario installment payments in Brazil on CyberSource through VisaNet. The value for this field corresponds to the following data in the TC 33 capture file: - Record: CP01 TCR9 - Position: 42-47 - Field: Date of First Installment
* @member {String} firstInstallmentDate
*/
exports.prototype['firstInstallmentDate'] = undefined;
/**
* Invoice information that you want to provide to the issuer. This value is similar to a tracking number and is the same for all installment payments for one purchase. This field is supported only for installment payments with Mastercard on CyberSource through VisaNet in Brazil. The value for this field corresponds to the following data in the TC 33 capture file5: - Record: CP07 TCR4 - Position: 51-70 - Field: Purchase Identification
* @member {String} invoiceData
*/
exports.prototype['invoiceData'] = undefined;
/**
* Payment plan for the installments. This field is supported only for installment payments on Visa Platform Connect, RuPay and SPG-KSA seamless flow. Possible values for a standing-instruction (SI) merchant-initiated transaction (MIT) with Diners Club or Mastercard in India or with an India-issued card: - 1: SI with a fixed amount. - 2: SI with a maximum amount. - 3: Other kind of SI. Possible values for a type of Installment transaction for on-soil transaction in Kingdom of Saudi Arabia - 1: Registration or first transaction. - 2: Subsequent transaction. Possible values for other kinds of installment payments: - 0 (default): Regular installment. This value is not allowed for airline transactions. - 1: Installment payment with down payment. - 2: Installment payment without down payment. This value is supported only for airline transactions. - 3: Installment payment; down payment and boarding fee will follow. This value is supported only for airline transactions. - 4: Down payment only; regular installment payment will follow. - 5: Boarding fee only. This value is supported only for airline transactions. - 6: SI de-registration on RuPay for the payer authentication seamless flow.
* @member {String} paymentType
*/
exports.prototype['paymentType'] = undefined;
/**
* Indicates whether the authorization request is a Crediario eligibility inquiry. Set the value for this field to `Crediario`. This field is supported only for Crediario installment payments in Brazil on CyberSource through VisaNet.
* @member {String} eligibilityInquiry
*/
exports.prototype['eligibilityInquiry'] = undefined;
/**
* Grace period requested by the customer before the first installment payment is due. When you include this field in a request, you must also include the grace period duration type field. The value for this field corresponds to the following data in the TC 33 capture file3: Record: CP01 TCR5, Position: 100-101, Field: Mastercard Grace Period Details. This field is supported only for Mastercard installment payments in Brazil and Greece.
* @member {String} gracePeriodDuration
*/
exports.prototype['gracePeriodDuration'] = undefined;
/**
* Unit for the requested grace period duration. Possible values: - `D`: Days - `W`: Weeks - `M`: Months The value for this field corresponds to the following data in the TC 33 capture file3: Record: CP01 TCR5, Position: 99, Field: Mastercard Grace Period Details This field is supported only for Mastercard installment payments in Brazil and Greece on CyberSource through VisaNet.
* @member {String} gracePeriodDurationType
*/
exports.prototype['gracePeriodDurationType'] = undefined;
/**
* Amount of the first installment payment. The issuer provides this value when the first installment payment is successful. This field is supported for Mastercard installment payments on CyberSource through VisaNet in all countries except Brazil,Croatia, Georgia, and Greece. The value for this field corresponds to the following data in the TC 33 capture file: - Record: CP01 TCR5 - Position: 23-34 - Field: Amount of Each Installment
* @member {String} firstInstallmentAmount
*/
exports.prototype['firstInstallmentAmount'] = undefined;
/**
* Standing Instruction/Installment validation indicator. - '1': Prevalidated - '2': Not Validated
* @member {String} validationIndicator
*/
exports.prototype['validationIndicator'] = undefined;
/**
* Standing Instruction/Installment identifier.
* @member {String} identifier
*/
exports.prototype['identifier'] = undefined;
/**
* Annual interest rate. This field is returned only for two kinds of installment payments on Visa Platform Connect: - Crediario with Visa in Brazil: this field is included in the authorization response for the Crediario eligibility request when the issuer approves the customer's request for Crediario installment payments. - Mastercard in all countries except Brazil, Croatia, Georgia, and Greece. Example: A value of 1.0 specifies 1%. Example: A value of 4.0 specifies 4%. #### Brazil The value for this field corresponds to the following data in the TC 33 capture file: - Record: CP01 TCR9 - Position: 151-157 - Field: Annual Interest Rate #### Other Countries The value for this field corresponds to the following data in the TC 33 capture file: - Record: CP01 TCR5 - Position: 58-62 SCMP API Fields| 216 - Field: Mastercard Annual Percentage Rate
* @member {String} annualInterestRate
*/
exports.prototype['annualInterestRate'] = undefined;
/**
* Indicates if the installment plan has interest. Possible values: -Y - with interest -N - without interest -NULL - Do not send the field if no information available
* @member {String} interestIndicator
*/
exports.prototype['interestIndicator'] = undefined;
/**
* Indicates if an installment plan is a government sponsored or part of a government program. Possible values: -true -false This field defaults to false when no value is provided.
* @member {Boolean} isGovernmentPlan
*/
exports.prototype['isGovernmentPlan'] = undefined;
return exports;
}));