class Paymentwall::Product

Constants

PERIOD_TYPE_DAY
PERIOD_TYPE_MONTH
PERIOD_TYPE_WEEK
PERIOD_TYPE_YEAR
TYPE_FIXED
TYPE_SUBSCRIPTION

Public Class Methods

new(productId, amount = 0.0, currencyCode = nil, name = nil, productType = self.class::TYPE_FIXED, periodLength = 0, periodType = nil, recurring = false, trialProduct = nil) click to toggle source
# 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

Public Instance Methods

getAmount() click to toggle source
# File lib/Paymentwall/Product.rb, line 30
def getAmount()
        @amount
end
getCurrencyCode() click to toggle source
# File lib/Paymentwall/Product.rb, line 34
def getCurrencyCode
        @currencyCode
end
getId() click to toggle source
# File lib/Paymentwall/Product.rb, line 26
def getId()
        @productId
end
getName() click to toggle source
# File lib/Paymentwall/Product.rb, line 38
def getName()
        @name
end
getPeriodLength() click to toggle source
# File lib/Paymentwall/Product.rb, line 50
def getPeriodLength()
        @periodLength
end
getPeriodType() click to toggle source
# File lib/Paymentwall/Product.rb, line 46
def getPeriodType()
        @periodType
end
getTrialProduct() click to toggle source
# File lib/Paymentwall/Product.rb, line 58
def getTrialProduct()
        @trialProduct
end
getType() click to toggle source
# File lib/Paymentwall/Product.rb, line 42
def getType()
        @productType
end
isRecurring() click to toggle source
# File lib/Paymentwall/Product.rb, line 54
def isRecurring()
        @recurring
end