1/** 2 * @param {AdsSubscriptionOptions|CompanyPromoPaymentOptions|UserAccountPaymentOptions|UserAdsLimitPaymentOptions} options 3 * @constructor 4 */ 5var CisPaymentSettings = function (options) { 6 var _defaultSettings = { 7 locale: "en", 8 el: {}, 9 allowServicesWithoutTariffs: false, 10 priceDataAttribute: "price", 11 priceTitleDataAttribute: "priceTitle", 12 servicesData: [], 13 merchantsData: [], 14 selectedServices: [], 15 excludedServices: [], 16 allowChangeServicePrice: false, 17 tariffDropDownPrompt: "Custom", 18 errorMessageTemplate: "An error occurred, server response: \"{response}\"", 19 amountTooSmallMessage: "Summary amount too small", 20 minAmount: 0.01, 21 commonValidationErrorMessage: "An error occurred while validating payment's data", 22 extraAttributes: [], 23 merchantValidationFieldId: "merchant-validation-field", 24 userSchedule: [] 25 }; 26 27 /** @type {CompanyPromoPaymentOptions|UserAccountPaymentOptions|UserAdsLimitPaymentOptions} */ 28 this._settings = $.extend(true, {}, _defaultSettings, options); 29 30 /** 31 * @this CisPaymentSettings 32 * @param {string} name 33 * @param [defaultValue] 34 */ 35 CisPaymentSettings.prototype.getOption = function (name, defaultValue) { 36 var path = name.split("."), 37 optionName = path.pop(), 38 option = this._settings; 39 path.forEach(function (item) { 40 if (!option.hasOwnProperty(item)) { 41 option[item] = {}; 42 } 43 option = option[item]; 44 }); 45 46 return option.hasOwnProperty(optionName) ? option[optionName] : defaultValue; 47 }; 48 49 /** 50 * @this CisPaymentSettings 51 * @param {string} name 52 * @param value 53 */ 54 CisPaymentSettings.prototype.setOption = function (name, value) { 55 var path = name.split("."), 56 optionName = path.pop(), 57 option = this._settings; 58 path.forEach(function (item) { 59 if (!option.hasOwnProperty(item)) { 60 option[item] = {}; 61 } 62 option = option[item]; 63 }); 64 option[optionName] = value; 65 }; 66 67 /** 68 * @this CisPaymentSettings 69 * @param {string} name 70 */ 71 CisPaymentSettings.prototype.getElement = function (name) { 72 return this.getOption("el." + name, ""); 73 }; 74};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.