Class: AdvancedBilling::Product
- Defined in:
- lib/advanced_billing/models/product.rb
Overview
Product Model.
Instance Attribute Summary collapse
-
#accounting_code ⇒ String
E.g.
-
#archived_at ⇒ DateTime
Timestamp indicating when this product was archived.
-
#created_at ⇒ DateTime
Timestamp indicating when this product was created.
-
#default_product_price_point_id ⇒ Integer
A string representing the tax code related to the product type.
-
#description ⇒ String
The product description.
-
#expiration_interval ⇒ Integer
A numerical interval for the length a subscription to this product will run before it expires.
-
#expiration_interval_unit ⇒ ExpirationIntervalUnit
A string representing the expiration interval unit for this product, either month, day or never.
-
#handle ⇒ String
The product API handle.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#initial_charge_after_trial ⇒ TrueClass | FalseClass
The url to which a customer will be returned after a successful account update.
-
#initial_charge_in_cents ⇒ Integer
The up front charge you have specified.
-
#interval ⇒ Integer
The numerical interval.
-
#interval_unit ⇒ IntervalUnit
A string representing the interval unit for this product, either month or day.
-
#item_category ⇒ String
One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other.
-
#name ⇒ String
The product name.
-
#price_in_cents ⇒ Integer
The product price, in integer cents.
-
#product_family ⇒ ProductFamily
The parameters will append to the url after a successful account update.
-
#product_price_point_handle ⇒ String
One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other.
-
#product_price_point_id ⇒ Integer
One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other.
-
#product_price_point_name ⇒ String
The parameters will append to the url after a successful account update.
-
#public_signup_pages ⇒ Array[PublicSignupPage]
The parameters will append to the url after a successful account update.
-
#request_billing_address ⇒ TrueClass | FalseClass
A boolean indicating whether to request a billing address on any Self-Service Pages that are used by subscribers of this product.
-
#request_credit_card ⇒ TrueClass | FalseClass
Deprecated value that can be ignored unless you have legacy hosted pages.
-
#require_billing_address ⇒ TrueClass | FalseClass
A boolean indicating whether a billing address is required to add a payment profile, especially at signup.
-
#require_credit_card ⇒ TrueClass | FalseClass
Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product.
-
#require_shipping_address ⇒ TrueClass | FalseClass
A boolean indicating whether a shipping address is required for the customer, especially at signup.
-
#return_params ⇒ String
Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product.
-
#tax_code ⇒ String
A string representing the tax code related to the product type.
-
#taxable ⇒ TrueClass | FalseClass
Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product.
-
#trial_interval ⇒ Integer
A numerical interval for the length of the trial period of a subscription to this product.
-
#trial_interval_unit ⇒ IntervalUnit
A string representing the trial interval unit for this product, either month or day.
-
#trial_price_in_cents ⇒ Integer
The price of the trial period for a subscription to this product, in integer cents.
-
#update_return_params ⇒ String
The parameters will append to the url after a successful account update.
-
#update_return_url ⇒ String
The url to which a customer will be returned after a successful account update.
-
#updated_at ⇒ DateTime
Timestamp indicating when this product was last updated.
-
#use_site_exchange_rate ⇒ TrueClass | FalseClass
A string representing the tax code related to the product type.
-
#version_number ⇒ Integer
The version of the product.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(id: SKIP, name: SKIP, handle: SKIP, description: SKIP, accounting_code: SKIP, request_credit_card: SKIP, expiration_interval: SKIP, expiration_interval_unit: SKIP, created_at: SKIP, updated_at: SKIP, price_in_cents: SKIP, interval: SKIP, interval_unit: SKIP, initial_charge_in_cents: SKIP, trial_price_in_cents: SKIP, trial_interval: SKIP, trial_interval_unit: SKIP, archived_at: SKIP, require_credit_card: SKIP, return_params: SKIP, taxable: SKIP, update_return_url: SKIP, initial_charge_after_trial: SKIP, version_number: SKIP, update_return_params: SKIP, product_family: SKIP, public_signup_pages: SKIP, product_price_point_name: SKIP, request_billing_address: SKIP, require_billing_address: SKIP, require_shipping_address: SKIP, tax_code: SKIP, default_product_price_point_id: SKIP, use_site_exchange_rate: SKIP, item_category: SKIP, product_price_point_id: SKIP, product_price_point_handle: SKIP, additional_properties: {}) ⇒ Product
constructor
A new instance of Product.
- #to_custom_archived_at ⇒ Object
- #to_custom_created_at ⇒ Object
- #to_custom_updated_at ⇒ Object
Methods inherited from BaseModel
Constructor Details
#initialize(id: SKIP, name: SKIP, handle: SKIP, description: SKIP, accounting_code: SKIP, request_credit_card: SKIP, expiration_interval: SKIP, expiration_interval_unit: SKIP, created_at: SKIP, updated_at: SKIP, price_in_cents: SKIP, interval: SKIP, interval_unit: SKIP, initial_charge_in_cents: SKIP, trial_price_in_cents: SKIP, trial_interval: SKIP, trial_interval_unit: SKIP, archived_at: SKIP, require_credit_card: SKIP, return_params: SKIP, taxable: SKIP, update_return_url: SKIP, initial_charge_after_trial: SKIP, version_number: SKIP, update_return_params: SKIP, product_family: SKIP, public_signup_pages: SKIP, product_price_point_name: SKIP, request_billing_address: SKIP, require_billing_address: SKIP, require_shipping_address: SKIP, tax_code: SKIP, default_product_price_point_id: SKIP, use_site_exchange_rate: SKIP, item_category: SKIP, product_price_point_id: SKIP, product_price_point_handle: SKIP, additional_properties: {}) ⇒ Product
Returns a new instance of Product.
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/advanced_billing/models/product.rb', line 313 def initialize(id: SKIP, name: SKIP, handle: SKIP, description: SKIP, accounting_code: SKIP, request_credit_card: SKIP, expiration_interval: SKIP, expiration_interval_unit: SKIP, created_at: SKIP, updated_at: SKIP, price_in_cents: SKIP, interval: SKIP, interval_unit: SKIP, initial_charge_in_cents: SKIP, trial_price_in_cents: SKIP, trial_interval: SKIP, trial_interval_unit: SKIP, archived_at: SKIP, require_credit_card: SKIP, return_params: SKIP, taxable: SKIP, update_return_url: SKIP, initial_charge_after_trial: SKIP, version_number: SKIP, update_return_params: SKIP, product_family: SKIP, public_signup_pages: SKIP, product_price_point_name: SKIP, request_billing_address: SKIP, require_billing_address: SKIP, require_shipping_address: SKIP, tax_code: SKIP, default_product_price_point_id: SKIP, use_site_exchange_rate: SKIP, item_category: SKIP, product_price_point_id: SKIP, product_price_point_handle: SKIP, additional_properties: {}) @id = id unless id == SKIP @name = name unless name == SKIP @handle = handle unless handle == SKIP @description = description unless description == SKIP @accounting_code = accounting_code unless accounting_code == SKIP @request_credit_card = request_credit_card unless request_credit_card == SKIP @expiration_interval = expiration_interval unless expiration_interval == SKIP @expiration_interval_unit = expiration_interval_unit unless expiration_interval_unit == SKIP @created_at = created_at unless created_at == SKIP @updated_at = updated_at unless updated_at == SKIP @price_in_cents = price_in_cents unless price_in_cents == SKIP @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP @initial_charge_in_cents = initial_charge_in_cents unless initial_charge_in_cents == SKIP @trial_price_in_cents = trial_price_in_cents unless trial_price_in_cents == SKIP @trial_interval = trial_interval unless trial_interval == SKIP @trial_interval_unit = trial_interval_unit unless trial_interval_unit == SKIP @archived_at = archived_at unless archived_at == SKIP @require_credit_card = require_credit_card unless require_credit_card == SKIP @return_params = return_params unless return_params == SKIP @taxable = taxable unless taxable == SKIP @update_return_url = update_return_url unless update_return_url == SKIP unless initial_charge_after_trial == SKIP @initial_charge_after_trial = initial_charge_after_trial end @version_number = version_number unless version_number == SKIP @update_return_params = update_return_params unless update_return_params == SKIP @product_family = product_family unless product_family == SKIP @public_signup_pages = public_signup_pages unless public_signup_pages == SKIP @product_price_point_name = product_price_point_name unless product_price_point_name == SKIP @request_billing_address = request_billing_address unless request_billing_address == SKIP @require_billing_address = require_billing_address unless require_billing_address == SKIP @require_shipping_address = require_shipping_address unless require_shipping_address == SKIP @tax_code = tax_code unless tax_code == SKIP unless default_product_price_point_id == SKIP @default_product_price_point_id = default_product_price_point_id end @use_site_exchange_rate = use_site_exchange_rate unless use_site_exchange_rate == SKIP @item_category = item_category unless item_category == SKIP @product_price_point_id = product_price_point_id unless product_price_point_id == SKIP unless product_price_point_handle == SKIP @product_price_point_handle = product_price_point_handle end # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end end |
Instance Attribute Details
#accounting_code ⇒ String
E.g. Internal ID or SKU Number
31 32 33 |
# File 'lib/advanced_billing/models/product.rb', line 31 def accounting_code @accounting_code end |
#archived_at ⇒ DateTime
Timestamp indicating when this product was archived
95 96 97 |
# File 'lib/advanced_billing/models/product.rb', line 95 def archived_at @archived_at end |
#created_at ⇒ DateTime
Timestamp indicating when this product was created
53 54 55 |
# File 'lib/advanced_billing/models/product.rb', line 53 def created_at @created_at end |
#default_product_price_point_id ⇒ Integer
A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
179 180 181 |
# File 'lib/advanced_billing/models/product.rb', line 179 def default_product_price_point_id @default_product_price_point_id end |
#description ⇒ String
The product description
27 28 29 |
# File 'lib/advanced_billing/models/product.rb', line 27 def description @description end |
#expiration_interval ⇒ Integer
A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval
44 45 46 |
# File 'lib/advanced_billing/models/product.rb', line 44 def expiration_interval @expiration_interval end |
#expiration_interval_unit ⇒ ExpirationIntervalUnit
A string representing the expiration interval unit for this product, either month, day or never
49 50 51 |
# File 'lib/advanced_billing/models/product.rb', line 49 def expiration_interval_unit @expiration_interval_unit end |
#handle ⇒ String
The product API handle
23 24 25 |
# File 'lib/advanced_billing/models/product.rb', line 23 def handle @handle end |
#id ⇒ Integer
TODO: Write general description for this method
15 16 17 |
# File 'lib/advanced_billing/models/product.rb', line 15 def id @id end |
#initial_charge_after_trial ⇒ TrueClass | FalseClass
The url to which a customer will be returned after a successful account update
120 121 122 |
# File 'lib/advanced_billing/models/product.rb', line 120 def initial_charge_after_trial @initial_charge_after_trial end |
#initial_charge_in_cents ⇒ Integer
The up front charge you have specified.
75 76 77 |
# File 'lib/advanced_billing/models/product.rb', line 75 def initial_charge_in_cents @initial_charge_in_cents end |
#interval ⇒ Integer
The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days
66 67 68 |
# File 'lib/advanced_billing/models/product.rb', line 66 def interval @interval end |
#interval_unit ⇒ IntervalUnit
A string representing the interval unit for this product, either month or day
71 72 73 |
# File 'lib/advanced_billing/models/product.rb', line 71 def interval_unit @interval_unit end |
#item_category ⇒ String
One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other
190 191 192 |
# File 'lib/advanced_billing/models/product.rb', line 190 def item_category @item_category end |
#name ⇒ String
The product name
19 20 21 |
# File 'lib/advanced_billing/models/product.rb', line 19 def name @name end |
#price_in_cents ⇒ Integer
The product price, in integer cents
61 62 63 |
# File 'lib/advanced_billing/models/product.rb', line 61 def price_in_cents @price_in_cents end |
#product_family ⇒ ProductFamily
The parameters will append to the url after a successful account update. See [help documentation](help.chargify.com/products/product-editing.html#ret urn-parameters-after-account-update)
138 139 140 |
# File 'lib/advanced_billing/models/product.rb', line 138 def product_family @product_family end |
#product_price_point_handle ⇒ String
One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other
200 201 202 |
# File 'lib/advanced_billing/models/product.rb', line 200 def product_price_point_handle @product_price_point_handle end |
#product_price_point_id ⇒ Integer
One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other
195 196 197 |
# File 'lib/advanced_billing/models/product.rb', line 195 def product_price_point_id @product_price_point_id end |
#product_price_point_name ⇒ String
The parameters will append to the url after a successful account update. See [help documentation](help.chargify.com/products/product-editing.html#ret urn-parameters-after-account-update)
152 153 154 |
# File 'lib/advanced_billing/models/product.rb', line 152 def product_price_point_name @product_price_point_name end |
#public_signup_pages ⇒ Array[PublicSignupPage]
The parameters will append to the url after a successful account update. See [help documentation](help.chargify.com/products/product-editing.html#ret urn-parameters-after-account-update)
145 146 147 |
# File 'lib/advanced_billing/models/product.rb', line 145 def public_signup_pages @public_signup_pages end |
#request_billing_address ⇒ TrueClass | FalseClass
A boolean indicating whether to request a billing address on any Self-Service Pages that are used by subscribers of this product.
157 158 159 |
# File 'lib/advanced_billing/models/product.rb', line 157 def request_billing_address @request_billing_address end |
#request_credit_card ⇒ TrueClass | FalseClass
Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page.
37 38 39 |
# File 'lib/advanced_billing/models/product.rb', line 37 def request_credit_card @request_credit_card end |
#require_billing_address ⇒ TrueClass | FalseClass
A boolean indicating whether a billing address is required to add a payment profile, especially at signup.
162 163 164 |
# File 'lib/advanced_billing/models/product.rb', line 162 def require_billing_address @require_billing_address end |
#require_credit_card ⇒ TrueClass | FalseClass
Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product.
100 101 102 |
# File 'lib/advanced_billing/models/product.rb', line 100 def require_credit_card @require_credit_card end |
#require_shipping_address ⇒ TrueClass | FalseClass
A boolean indicating whether a shipping address is required for the customer, especially at signup.
167 168 169 |
# File 'lib/advanced_billing/models/product.rb', line 167 def require_shipping_address @require_shipping_address end |
#return_params ⇒ String
Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product.
105 106 107 |
# File 'lib/advanced_billing/models/product.rb', line 105 def return_params @return_params end |
#tax_code ⇒ String
A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
173 174 175 |
# File 'lib/advanced_billing/models/product.rb', line 173 def tax_code @tax_code end |
#taxable ⇒ TrueClass | FalseClass
Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product.
110 111 112 |
# File 'lib/advanced_billing/models/product.rb', line 110 def taxable @taxable end |
#trial_interval ⇒ Integer
A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval
86 87 88 |
# File 'lib/advanced_billing/models/product.rb', line 86 def trial_interval @trial_interval end |
#trial_interval_unit ⇒ IntervalUnit
A string representing the trial interval unit for this product, either month or day
91 92 93 |
# File 'lib/advanced_billing/models/product.rb', line 91 def trial_interval_unit @trial_interval_unit end |
#trial_price_in_cents ⇒ Integer
The price of the trial period for a subscription to this product, in integer cents.
80 81 82 |
# File 'lib/advanced_billing/models/product.rb', line 80 def trial_price_in_cents @trial_price_in_cents end |
#update_return_params ⇒ String
The parameters will append to the url after a successful account update. See [help documentation](help.chargify.com/products/product-editing.html#ret urn-parameters-after-account-update)
131 132 133 |
# File 'lib/advanced_billing/models/product.rb', line 131 def update_return_params @update_return_params end |
#update_return_url ⇒ String
The url to which a customer will be returned after a successful account update
115 116 117 |
# File 'lib/advanced_billing/models/product.rb', line 115 def update_return_url @update_return_url end |
#updated_at ⇒ DateTime
Timestamp indicating when this product was last updated
57 58 59 |
# File 'lib/advanced_billing/models/product.rb', line 57 def updated_at @updated_at end |
#use_site_exchange_rate ⇒ TrueClass | FalseClass
A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
185 186 187 |
# File 'lib/advanced_billing/models/product.rb', line 185 def use_site_exchange_rate @use_site_exchange_rate end |
#version_number ⇒ Integer
The version of the product
124 125 126 |
# File 'lib/advanced_billing/models/product.rb', line 124 def version_number @version_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
# File 'lib/advanced_billing/models/product.rb', line 385 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP handle = hash.key?('handle') ? hash['handle'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP accounting_code = hash.key?('accounting_code') ? hash['accounting_code'] : SKIP request_credit_card = hash.key?('request_credit_card') ? hash['request_credit_card'] : SKIP expiration_interval = hash.key?('expiration_interval') ? hash['expiration_interval'] : SKIP expiration_interval_unit = hash.key?('expiration_interval_unit') ? hash['expiration_interval_unit'] : SKIP created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) else SKIP end updated_at = if hash.key?('updated_at') (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) else SKIP end price_in_cents = hash.key?('price_in_cents') ? hash['price_in_cents'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP initial_charge_in_cents = hash.key?('initial_charge_in_cents') ? hash['initial_charge_in_cents'] : SKIP trial_price_in_cents = hash.key?('trial_price_in_cents') ? hash['trial_price_in_cents'] : SKIP trial_interval = hash.key?('trial_interval') ? hash['trial_interval'] : SKIP trial_interval_unit = hash.key?('trial_interval_unit') ? hash['trial_interval_unit'] : SKIP archived_at = if hash.key?('archived_at') (DateTimeHelper.from_rfc3339(hash['archived_at']) if hash['archived_at']) else SKIP end require_credit_card = hash.key?('require_credit_card') ? hash['require_credit_card'] : SKIP return_params = hash.key?('return_params') ? hash['return_params'] : SKIP taxable = hash.key?('taxable') ? hash['taxable'] : SKIP update_return_url = hash.key?('update_return_url') ? hash['update_return_url'] : SKIP initial_charge_after_trial = hash.key?('initial_charge_after_trial') ? hash['initial_charge_after_trial'] : SKIP version_number = hash.key?('version_number') ? hash['version_number'] : SKIP update_return_params = hash.key?('update_return_params') ? hash['update_return_params'] : SKIP product_family = ProductFamily.from_hash(hash['product_family']) if hash['product_family'] # Parameter is an array, so we need to iterate through it public_signup_pages = nil unless hash['public_signup_pages'].nil? public_signup_pages = [] hash['public_signup_pages'].each do |structure| public_signup_pages << (PublicSignupPage.from_hash(structure) if structure) end end public_signup_pages = SKIP unless hash.key?('public_signup_pages') product_price_point_name = hash.key?('product_price_point_name') ? hash['product_price_point_name'] : SKIP request_billing_address = hash.key?('request_billing_address') ? hash['request_billing_address'] : SKIP require_billing_address = hash.key?('require_billing_address') ? hash['require_billing_address'] : SKIP require_shipping_address = hash.key?('require_shipping_address') ? hash['require_shipping_address'] : SKIP tax_code = hash.key?('tax_code') ? hash['tax_code'] : SKIP default_product_price_point_id = hash.key?('default_product_price_point_id') ? hash['default_product_price_point_id'] : SKIP use_site_exchange_rate = hash.key?('use_site_exchange_rate') ? hash['use_site_exchange_rate'] : SKIP item_category = hash.key?('item_category') ? hash['item_category'] : SKIP product_price_point_id = hash.key?('product_price_point_id') ? hash['product_price_point_id'] : SKIP product_price_point_handle = hash.key?('product_price_point_handle') ? hash['product_price_point_handle'] : SKIP # Clean out expected properties from Hash. names.each_value { |k| hash.delete(k) } # Create object from extracted values. Product.new(id: id, name: name, handle: handle, description: description, accounting_code: accounting_code, request_credit_card: request_credit_card, expiration_interval: expiration_interval, expiration_interval_unit: expiration_interval_unit, created_at: created_at, updated_at: updated_at, price_in_cents: price_in_cents, interval: interval, interval_unit: interval_unit, initial_charge_in_cents: initial_charge_in_cents, trial_price_in_cents: trial_price_in_cents, trial_interval: trial_interval, trial_interval_unit: trial_interval_unit, archived_at: archived_at, require_credit_card: require_credit_card, return_params: return_params, taxable: taxable, update_return_url: update_return_url, initial_charge_after_trial: initial_charge_after_trial, version_number: version_number, update_return_params: update_return_params, product_family: product_family, public_signup_pages: public_signup_pages, product_price_point_name: product_price_point_name, request_billing_address: request_billing_address, require_billing_address: require_billing_address, require_shipping_address: require_shipping_address, tax_code: tax_code, default_product_price_point_id: default_product_price_point_id, use_site_exchange_rate: use_site_exchange_rate, item_category: item_category, product_price_point_id: product_price_point_id, product_price_point_handle: product_price_point_handle, additional_properties: hash) end |
.names ⇒ Object
A mapping from model property names to API property names.
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/advanced_billing/models/product.rb', line 203 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['name'] = 'name' @_hash['handle'] = 'handle' @_hash['description'] = 'description' @_hash['accounting_code'] = 'accounting_code' @_hash['request_credit_card'] = 'request_credit_card' @_hash['expiration_interval'] = 'expiration_interval' @_hash['expiration_interval_unit'] = 'expiration_interval_unit' @_hash['created_at'] = 'created_at' @_hash['updated_at'] = 'updated_at' @_hash['price_in_cents'] = 'price_in_cents' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' @_hash['initial_charge_in_cents'] = 'initial_charge_in_cents' @_hash['trial_price_in_cents'] = 'trial_price_in_cents' @_hash['trial_interval'] = 'trial_interval' @_hash['trial_interval_unit'] = 'trial_interval_unit' @_hash['archived_at'] = 'archived_at' @_hash['require_credit_card'] = 'require_credit_card' @_hash['return_params'] = 'return_params' @_hash['taxable'] = 'taxable' @_hash['update_return_url'] = 'update_return_url' @_hash['initial_charge_after_trial'] = 'initial_charge_after_trial' @_hash['version_number'] = 'version_number' @_hash['update_return_params'] = 'update_return_params' @_hash['product_family'] = 'product_family' @_hash['public_signup_pages'] = 'public_signup_pages' @_hash['product_price_point_name'] = 'product_price_point_name' @_hash['request_billing_address'] = 'request_billing_address' @_hash['require_billing_address'] = 'require_billing_address' @_hash['require_shipping_address'] = 'require_shipping_address' @_hash['tax_code'] = 'tax_code' @_hash['default_product_price_point_id'] = 'default_product_price_point_id' @_hash['use_site_exchange_rate'] = 'use_site_exchange_rate' @_hash['item_category'] = 'item_category' @_hash['product_price_point_id'] = 'product_price_point_id' @_hash['product_price_point_handle'] = 'product_price_point_handle' @_hash end |
.nullables ⇒ Object
An array for nullable fields
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/advanced_billing/models/product.rb', line 290 def self.nullables %w[ handle description accounting_code expiration_interval expiration_interval_unit initial_charge_in_cents trial_price_in_cents trial_interval trial_interval_unit archived_at return_params update_return_url initial_charge_after_trial update_return_params tax_code use_site_exchange_rate item_category product_price_point_handle ] end |
.optionals ⇒ Object
An array for optional fields
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/advanced_billing/models/product.rb', line 247 def self.optionals %w[ id name handle description accounting_code request_credit_card expiration_interval expiration_interval_unit created_at updated_at price_in_cents interval interval_unit initial_charge_in_cents trial_price_in_cents trial_interval trial_interval_unit archived_at require_credit_card return_params taxable update_return_url initial_charge_after_trial version_number update_return_params product_family public_signup_pages product_price_point_name request_billing_address require_billing_address require_shipping_address tax_code default_product_price_point_id use_site_exchange_rate item_category product_price_point_id product_price_point_handle ] end |
Instance Method Details
#to_custom_archived_at ⇒ Object
522 523 524 |
# File 'lib/advanced_billing/models/product.rb', line 522 def to_custom_archived_at DateTimeHelper.to_rfc3339(archived_at) end |
#to_custom_created_at ⇒ Object
514 515 516 |
# File 'lib/advanced_billing/models/product.rb', line 514 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_updated_at ⇒ Object
518 519 520 |
# File 'lib/advanced_billing/models/product.rb', line 518 def to_custom_updated_at DateTimeHelper.to_rfc3339(updated_at) end |