Class: Klarna::Checkout::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/klarna/checkout/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/klarna/checkout/configuration.rb', line 17

def initialize
  @purchase_country  = nil
  @purchase_currency = nil
  @locale            = nil
  @terms_uri         = nil
  @checkout_uri      = nil
  @confirmation_uri  = nil
  @push_uri          = nil
  @environment       = nil
  @user_id           = nil
  @passcode          = nil
  @checkout_url      = nil
end

Instance Attribute Details

#checkout_uriObject



61
62
63
64
65
66
67
# File 'lib/klarna/checkout/configuration.rb', line 61

def checkout_uri
  unless @checkout_uri
    raise Klarna::Checkout::Errors::ConfigurationError.new('checkout_uri', 'missing_configuration_item')
  end

  @checkout_uri
end

#confirmation_uriObject



69
70
71
72
73
74
75
# File 'lib/klarna/checkout/configuration.rb', line 69

def confirmation_uri
  unless @confirmation_uri
    raise Klarna::Checkout::Errors::ConfigurationError.new('confirmation_uri', 'missing_configuration_item')
  end

  @confirmation_uri
end

#environmentObject



85
86
87
88
89
90
91
# File 'lib/klarna/checkout/configuration.rb', line 85

def environment
  unless @environment
    raise Klarna::Checkout::Errors::ConfigurationError.new('environment', 'missing_configuration_item')
  end

  @environment
end

#localeObject



47
48
49
50
51
# File 'lib/klarna/checkout/configuration.rb', line 47

def locale
  raise Klarna::Checkout::Errors::ConfigurationError.new('locale', 'missing_configuration_item') unless @locale

  @locale
end

#passcodeObject



99
100
101
102
103
104
105
# File 'lib/klarna/checkout/configuration.rb', line 99

def passcode
  unless @passcode
    raise Klarna::Checkout::Errors::ConfigurationError.new('passcode', 'missing_configuration_item')
  end

  @passcode
end

#purchase_countryObject



31
32
33
34
35
36
37
# File 'lib/klarna/checkout/configuration.rb', line 31

def purchase_country
  unless @purchase_country
    raise Klarna::Checkout::Errors::ConfigurationError.new('purchase_country', 'missing_configuration_item')
  end

  @purchase_country
end

#purchase_currencyObject



39
40
41
42
43
44
45
# File 'lib/klarna/checkout/configuration.rb', line 39

def purchase_currency
  unless @purchase_currency
    raise Klarna::Checkout::Errors::ConfigurationError.new('purchase_currency', 'missing_configuration_item')
  end

  @purchase_currency
end

#push_uriObject



77
78
79
80
81
82
83
# File 'lib/klarna/checkout/configuration.rb', line 77

def push_uri
  unless @push_uri
    raise Klarna::Checkout::Errors::ConfigurationError.new('push_uri', 'missing_configuration_item')
  end

  @push_uri
end

#terms_uriObject



53
54
55
56
57
58
59
# File 'lib/klarna/checkout/configuration.rb', line 53

def terms_uri
  unless @terms_uri
    raise Klarna::Checkout::Errors::ConfigurationError.new('terms_uri', 'missing_configuration_item')
  end

  @terms_uri
end

#user_idObject



93
94
95
96
97
# File 'lib/klarna/checkout/configuration.rb', line 93

def user_id
  raise Klarna::Checkout::Errors::ConfigurationError.new('user_id', 'missing_configuration_item') unless @user_id

  @user_id
end

Instance Method Details

#checkout_urlObject



107
108
109
110
111
112
113
# File 'lib/klarna/checkout/configuration.rb', line 107

def checkout_url
  unless @checkout_url
    raise Klarna::Checkout::Errors::ConfigurationError.new('checkout_url', 'missing_configuration_item')
  end

  @checkout_url
end