UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

102 lines (81 loc) 3.41 kB
/** * 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'); /** * The TipSettings model module. * @module model/TipSettings */ /** * Constructs a new <code>TipSettings</code>. * * @alias module:model/TipSettings * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>TipSettings</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/TipSettings} obj Optional instance to populate. * @return {module:model/TipSettings} The populated <code>TipSettings</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('allow_tipping')) { obj['allow_tipping'] = ApiClient.convertToType(data['allow_tipping'], 'Boolean'); } if (data.hasOwnProperty('separate_tip_screen')) { obj['separate_tip_screen'] = ApiClient.convertToType(data['separate_tip_screen'], 'Boolean'); } if (data.hasOwnProperty('custom_tip_field')) { obj['custom_tip_field'] = ApiClient.convertToType(data['custom_tip_field'], 'Boolean'); } if (data.hasOwnProperty('tip_percentages')) { obj['tip_percentages'] = ApiClient.convertToType(data['tip_percentages'], ['Number']); } if (data.hasOwnProperty('smart_tipping')) { obj['smart_tipping'] = ApiClient.convertToType(data['smart_tipping'], 'Boolean'); } } return obj; } /** * Indicates whether tipping is enabled for this checkout. Defaults to false. * @member {Boolean} allow_tipping */ exports.prototype['allow_tipping'] = undefined; /** * Indicates whether tip options should be presented on their own screen before presenting the signature screen during card payment. Defaults to false. * @member {Boolean} separate_tip_screen */ exports.prototype['separate_tip_screen'] = undefined; /** * Indicates whether custom tip amounts are allowed during the checkout flow. Defaults to false. * @member {Boolean} custom_tip_field */ exports.prototype['custom_tip_field'] = undefined; /** * A list of tip percentages that should be presented during the checkout flow. Specified as up to 3 non-negative integers from 0 to 100 (inclusive). Defaults to [15, 20, 25] * @member {Array.<Number>} tip_percentages */ exports.prototype['tip_percentages'] = undefined; /** * Enables the \"Smart Tip Amounts\" behavior described in https://squareup.com/help/us/en/article/5069-accept-tips-with-the-square-app. Exact tipping options depend on the region the Square seller is active in. In the United States and Canada, tipping options will be presented in whole dollar amounts for payments under 10 USD/CAD respectively. If set to true, the tip_percentages settings is ignored. Defaults to false. * @member {Boolean} smart_tipping */ exports.prototype['smart_tipping'] = undefined; module.exports = exports;