Method: Paymentwall::Product#initialize
- Defined in:
- lib/Paymentwall/Product.rb
#initialize(productId, amount = 0.0, currencyCode = nil, name = nil, productType = self.class::TYPE_FIXED, periodLength = 0, periodType = nil, recurring = false, trialProduct = nil) ⇒ Product
Returns a new instance of Product.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/Paymentwall/Product.rb', line 12 def initialize(productId, amount = 0.0, currencyCode = nil, name = nil, productType = self.class::TYPE_FIXED, periodLength = 0, periodType = nil, recurring = false, trialProduct = nil) @productId = productId @amount = amount.round(2) @currencyCode = currencyCode @name = name @productType = productType @periodLength = periodLength @periodType = periodType @recurring = recurring if (productType == Paymentwall::Product::TYPE_SUBSCRIPTION && recurring && recurring != 0) @trialProduct = trialProduct end end |