klarna-checkout 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/klarna/checkout/address.rb +2 -2
- data/lib/klarna/checkout/cart.rb +2 -2
- data/lib/klarna/checkout/cart_item.rb +2 -2
- data/lib/klarna/checkout/customer.rb +2 -2
- data/lib/klarna/checkout/gui.rb +2 -2
- data/lib/klarna/checkout/merchant.rb +2 -2
- data/lib/klarna/checkout/order.rb +2 -4
- data/lib/klarna/checkout/resource.rb +5 -1
- data/lib/klarna/checkout/version.rb +1 -1
- data/spec/lib/klarna/checkout/version_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68c4ba576274af3db9c447772890887e1629b4b5
|
4
|
+
data.tar.gz: 2756414abb23952ead4aae51f7b199b690b29bb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0a29c206f6ec94ae8c7a23ad66c05665c23bd3c0121c11f42519507f7a2367d5acf0b46f781848f6d84c8d430cc34d121ce5e0468bfe8a38c4d3edb75642fe8
|
7
|
+
data.tar.gz: 5b209756de08e709f2e48e342b9d87ec32446d81ef432b35a8406ce11f13a25effb323aa0adc4a683e6dd37a925f1ac0ba0367a79031d1a3da6358b43d22f875
|
@@ -5,7 +5,7 @@ module Klarna
|
|
5
5
|
:postal_code, :city, :country, :email, :phone
|
6
6
|
|
7
7
|
def as_json
|
8
|
-
{
|
8
|
+
json_sanitize({
|
9
9
|
:given_name => @given_name,
|
10
10
|
:family_name => @family_name,
|
11
11
|
:care_of => @care_of,
|
@@ -15,7 +15,7 @@ module Klarna
|
|
15
15
|
:country => @country,
|
16
16
|
:email => @email,
|
17
17
|
:phone => @phone
|
18
|
-
}
|
18
|
+
})
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
data/lib/klarna/checkout/cart.rb
CHANGED
@@ -9,12 +9,12 @@ module Klarna
|
|
9
9
|
has_many :items, Klarna::Checkout::CartItem
|
10
10
|
|
11
11
|
def as_json
|
12
|
-
{
|
12
|
+
json_sanitize({
|
13
13
|
:total_price_including_tax => @total_price_including_tax,
|
14
14
|
:total_price_excluding_tax => @total_price_excluding_tax,
|
15
15
|
:total_tax_amount => @total_tax_amount,
|
16
16
|
:items => @items.map(&:as_json)
|
17
|
-
}
|
17
|
+
})
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -6,7 +6,7 @@ module Klarna
|
|
6
6
|
:total_price_including_tax, :discount_rate, :tax_rate
|
7
7
|
|
8
8
|
def as_json
|
9
|
-
{
|
9
|
+
json_sanitize({
|
10
10
|
:type => @type,
|
11
11
|
:ean => @ean,
|
12
12
|
:reference => @reference,
|
@@ -20,7 +20,7 @@ module Klarna
|
|
20
20
|
:total_price_including_tax => @total_price_including_tax,
|
21
21
|
:discount_rate => @discount_rate,
|
22
22
|
:tax_rate => @tax_rate
|
23
|
-
}
|
23
|
+
})
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/lib/klarna/checkout/gui.rb
CHANGED
@@ -5,14 +5,14 @@ module Klarna
|
|
5
5
|
:push_uri, :validation_uri
|
6
6
|
|
7
7
|
def as_json
|
8
|
-
{
|
8
|
+
json_sanitize({
|
9
9
|
:id => @id,
|
10
10
|
:terms_uri => @terms_uri,
|
11
11
|
:checkout_uri => @checkout_uri,
|
12
12
|
:confirmation_uri => @confirmation_uri,
|
13
13
|
:push_uri => @push_uri,
|
14
14
|
:validation_uri => @validation_uri
|
15
|
-
}
|
15
|
+
})
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -17,16 +17,14 @@ module Klarna
|
|
17
17
|
has_one :gui, Klarna::Checkout::Gui
|
18
18
|
|
19
19
|
def as_json
|
20
|
-
{
|
20
|
+
json_sanitize({
|
21
21
|
:merchant_reference => @merchant_reference,
|
22
22
|
:purchase_country => @purchase_country,
|
23
23
|
:purchase_currency => @purchase_currency,
|
24
24
|
:locale => @locale,
|
25
25
|
:cart => @cart.as_json,
|
26
26
|
:merchant => @merchant.as_json
|
27
|
-
}
|
28
|
-
v.nil?
|
29
|
-
end
|
27
|
+
})
|
30
28
|
end
|
31
29
|
end
|
32
30
|
end
|
@@ -16,9 +16,13 @@ module Klarna
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def to_json
|
19
|
-
sanitized_json = self.as_json
|
19
|
+
sanitized_json = json_sanitize(self.as_json)
|
20
20
|
JSON.generate(sanitized_json)
|
21
21
|
end
|
22
|
+
|
23
|
+
def json_sanitize(hash)
|
24
|
+
hash.reject { |k, v| v.nil? }
|
25
|
+
end
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: klarna-checkout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theodor Tonum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|