Module: Klarna

Defined in:
lib/klarna.rb,
lib/klarna/order.rb,
lib/klarna/client.rb,
lib/klarna/refund.rb,
lib/klarna/capture.rb,
lib/klarna/payment.rb,
lib/klarna/version.rb,
lib/klarna/response.rb,
lib/klarna/configuration.rb,
lib/klarna/customer_token.rb

Defined Under Namespace

Classes: Capture, Client, Configuration, CustomerToken, Order, Payment, Refund, Response

Constant Summary collapse

VERSION =
'0.9.3'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject



18
19
20
# File 'lib/klarna.rb', line 18

def self.configuration
  @configuration ||= Configuration.new
end

Class Method Details

.client(type = :order) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/klarna.rb', line 26

def self.client(type = :order)
  case type
  when :payment
    Payment.new(configuration)
  when :order
    Order.new(configuration)
  when :refund
    Refund.new(configuration)
  when :capture
    Capture.new(configuration)
  when :customer_token
    CustomerToken.new(configuration)
  end
end

.configure {|configuration| ... } ⇒ Object

Yields:



22
23
24
# File 'lib/klarna.rb', line 22

def self.configure
  yield(configuration)
end