square-connect
Version:
JavaScript client library for the Square Connect v2 API
77 lines (59 loc) • 2.31 kB
JavaScript
/**
* Square Connect API
* Client library for accessing the Square Connect APIs
*
* OpenAPI spec version: 2.0
* Contact: developers@squareup.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.3.0-SNAPSHOT
*
*/
var ApiClient = require('../ApiClient');
var RiskEvaluationRiskLevel = require('./RiskEvaluationRiskLevel');
/**
* The RiskEvaluation model module.
* Note: This model is in beta.
* @module model/RiskEvaluation
*/
/**
* Constructs a new <code>RiskEvaluation</code>.
* Represents fraud risk information for the associated payment. When you take a payment through Square's Payments API (using the `CreatePayment` endpoint), Square evaluates it and assigns a risk level to the payment. Sellers can use this information to determine the course of action (for example, provide the goods/services or refund the payment).
* @alias module:model/RiskEvaluation
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>RiskEvaluation</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/RiskEvaluation} obj Optional instance to populate.
* @return {module:model/RiskEvaluation} The populated <code>RiskEvaluation</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('created_at')) {
obj['created_at'] = ApiClient.convertToType(data['created_at'], 'String');
}
if (data.hasOwnProperty('risk_level')) {
obj['risk_level'] = RiskEvaluationRiskLevel.constructFromObject(data['risk_level']);
}
}
return obj;
}
/**
* The timestamp when payment risk was evaluated, in RFC3339 format.
* @member {String} created_at
*/
exports.prototype['created_at'] = undefined;
/**
* The risk level associated with the payment
* @member {module:model/RiskEvaluationRiskLevel} risk_level
*/
exports.prototype['risk_level'] = undefined;
module.exports = exports;