Class: ActivePayment::Models::Payable

Inherits:
Object
  • Object
show all
Includes:
PaypalPayable
Defined in:
lib/active_payment/models/payable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PaypalPayable

#to_paypal_hash

Constructor Details

#initialize(params = {}) ⇒ Payable



11
12
13
14
15
16
17
18
19
# File 'lib/active_payment/models/payable.rb', line 11

def initialize(params = {})
  @tax = 0
  @shipping = 0
  @number = 1
  @quantity = 1
  @currency = 'USD'

  params.each { |key, value| send "#{key}=", value }
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def amount
  @amount
end

#classObject

Returns the value of attribute class.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def class
  @class
end

#currencyObject

Returns the value of attribute currency.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def currency
  @currency
end

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def description
  @description
end

#external_idObject

Returns the value of attribute external_id.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def external_id
  @external_id
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def id
  @id
end

#numberObject

Returns the value of attribute number.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def number
  @number
end

#quantityObject

Returns the value of attribute quantity.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def quantity
  @quantity
end

#reference_numberObject

Returns the value of attribute reference_number.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def reference_number
  @reference_number
end

#shippingObject

Returns the value of attribute shipping.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def shipping
  @shipping
end

#taxObject

Returns the value of attribute tax.



6
7
8
# File 'lib/active_payment/models/payable.rb', line 6

def tax
  @tax
end