Class: Klarna::Checkout::Cart

Inherits:
Resource
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/klarna/checkout/cart.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

defaults, defaults=, #initialize, #json_sanitize, #to_json

Methods included from HasOne

#has_one

Methods included from HasMany

#has_many

Constructor Details

This class inherits a constructor from Klarna::Checkout::Resource

Instance Attribute Details

#total_price_excluding_taxObject

Returns the value of attribute total_price_excluding_tax.



9
10
11
# File 'lib/klarna/checkout/cart.rb', line 9

def total_price_excluding_tax
  @total_price_excluding_tax
end

#total_price_including_taxObject

Returns the value of attribute total_price_including_tax.



9
10
11
# File 'lib/klarna/checkout/cart.rb', line 9

def total_price_including_tax
  @total_price_including_tax
end

#total_tax_amountObject

Returns the value of attribute total_tax_amount.



9
10
11
# File 'lib/klarna/checkout/cart.rb', line 9

def total_tax_amount
  @total_tax_amount
end

Instance Method Details

#as_jsonObject



16
17
18
19
20
# File 'lib/klarna/checkout/cart.rb', line 16

def as_json
  json_sanitize({
    :items => @items.map(&:as_json)
  })
end