klarna-checkout-v3 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64373ea30c08b90f8c63f70161589e089ee52253045860f9646a44594f3340bf
4
- data.tar.gz: 224ac5fe3cfa4c52ad9abf0b3ba91e2b34e062ce6e5693e2c533e348019b1777
3
+ metadata.gz: '0183f6708023bac6ff4aeea23c736aece5975988d3b9a58f3fd93392abb9371d'
4
+ data.tar.gz: 49a037fb1cd242ba6fb6ab8bfd3d744ea63f9aec8efc3a9103b91b53dac4a9eb
5
5
  SHA512:
6
- metadata.gz: 21f8bec2afa7d82f9e70add4d6406918cb5b6f388c0734463ae713cb78edf6c2e24d04ce600d13b72cd5394d05ca8d6bba9749975e5ba45e763ddffd218d1768
7
- data.tar.gz: 5b8cbff609f96b55fca9f32f7512044f169a4310d0dd303d2ad4d4327036823824fb9c66942a17af86a44bf6ff9b9950d95dd117c31368c59d378b76c88f74b3
6
+ metadata.gz: 657c8ddaf3d94e64d1dd7676aa9e224b9dd1f85a4aaa1b1d401cc7919a5953b9edc2d0f62c2cef067cfe1e2109fe583940532006b5d2421259a3a31a3f970d56
7
+ data.tar.gz: a04dada24af5c3b889ef53886b6a92273c482ae8a50b1c1d867adff3255951e647ba84a0721945f6ca3888d8304cff5ca87c8c99340beed2e7cd65d7c3fd27c4
data/Gemfile CHANGED
@@ -5,14 +5,14 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in klarna.gemspec
6
6
  gemspec
7
7
 
8
- gem 'faraday', '< 2.0'
8
+ gem 'faraday', '< 3.0'
9
9
  gem 'rake', '< 14.0'
10
10
  gem 'rspec', '< 4.0'
11
11
  gem 'vcr', '< 7.0'
12
12
  gem 'webmock', '< 4.0'
13
13
 
14
14
  group :development, :test do
15
- gem 'pry', '< 1.0'
15
+ gem 'pry'
16
16
  gem 'pry-byebug'
17
17
  gem 'rubocop', require: false
18
18
  end
data/Gemfile.lock CHANGED
@@ -1,67 +1,72 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- klarna-checkout (0.1.1)
4
+ klarna-checkout-v3 (0.1.4)
5
5
  faraday
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.7.0)
11
- public_suffix (>= 2.0.2, < 5.0)
12
- ast (2.4.1)
10
+ addressable (2.8.4)
11
+ public_suffix (>= 2.0.2, < 6.0)
12
+ ast (2.4.2)
13
13
  byebug (11.1.3)
14
14
  coderay (1.1.3)
15
- crack (0.4.4)
16
- diff-lcs (1.4.4)
17
- faraday (1.0.1)
18
- multipart-post (>= 1.2, < 3)
15
+ crack (0.4.5)
16
+ rexml
17
+ diff-lcs (1.5.0)
18
+ faraday (2.7.5)
19
+ faraday-net_http (>= 2.0, < 3.1)
20
+ ruby2_keywords (>= 0.0.4)
21
+ faraday-net_http (3.0.2)
19
22
  hashdiff (1.0.1)
23
+ json (2.6.3)
20
24
  method_source (1.0.0)
21
- multipart-post (2.1.1)
22
- parallel (1.19.2)
23
- parser (2.7.1.5)
25
+ parallel (1.23.0)
26
+ parser (3.2.2.1)
24
27
  ast (~> 2.4.1)
25
- pry (0.13.1)
28
+ pry (0.14.2)
26
29
  coderay (~> 1.1)
27
30
  method_source (~> 1.0)
28
- pry-byebug (3.9.0)
31
+ pry-byebug (3.10.1)
29
32
  byebug (~> 11.0)
30
- pry (~> 0.13.0)
31
- public_suffix (4.0.6)
32
- rainbow (3.0.0)
33
- rake (13.0.1)
34
- regexp_parser (1.8.1)
35
- rexml (3.2.4)
36
- rspec (3.9.0)
37
- rspec-core (~> 3.9.0)
38
- rspec-expectations (~> 3.9.0)
39
- rspec-mocks (~> 3.9.0)
40
- rspec-core (3.9.3)
41
- rspec-support (~> 3.9.3)
42
- rspec-expectations (3.9.2)
33
+ pry (>= 0.13, < 0.15)
34
+ public_suffix (5.0.1)
35
+ rainbow (3.1.1)
36
+ rake (13.0.6)
37
+ regexp_parser (2.8.0)
38
+ rexml (3.2.5)
39
+ rspec (3.12.0)
40
+ rspec-core (~> 3.12.0)
41
+ rspec-expectations (~> 3.12.0)
42
+ rspec-mocks (~> 3.12.0)
43
+ rspec-core (3.12.2)
44
+ rspec-support (~> 3.12.0)
45
+ rspec-expectations (3.12.3)
43
46
  diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.9.0)
45
- rspec-mocks (3.9.1)
47
+ rspec-support (~> 3.12.0)
48
+ rspec-mocks (3.12.5)
46
49
  diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.9.0)
48
- rspec-support (3.9.3)
49
- rubocop (0.92.0)
50
+ rspec-support (~> 3.12.0)
51
+ rspec-support (3.12.0)
52
+ rubocop (1.52.0)
53
+ json (~> 2.3)
50
54
  parallel (~> 1.10)
51
- parser (>= 2.7.1.5)
55
+ parser (>= 3.2.0.0)
52
56
  rainbow (>= 2.2.2, < 4.0)
53
- regexp_parser (>= 1.7)
54
- rexml
55
- rubocop-ast (>= 0.5.0)
57
+ regexp_parser (>= 1.8, < 3.0)
58
+ rexml (>= 3.2.5, < 4.0)
59
+ rubocop-ast (>= 1.28.0, < 2.0)
56
60
  ruby-progressbar (~> 1.7)
57
- unicode-display_width (>= 1.4.0, < 2.0)
58
- rubocop-ast (0.7.1)
59
- parser (>= 2.7.1.5)
60
- ruby-progressbar (1.10.1)
61
- unicode-display_width (1.7.0)
62
- vcr (6.0.0)
63
- webmock (3.9.1)
64
- addressable (>= 2.3.6)
61
+ unicode-display_width (>= 2.4.0, < 3.0)
62
+ rubocop-ast (1.29.0)
63
+ parser (>= 3.2.1.0)
64
+ ruby-progressbar (1.13.0)
65
+ ruby2_keywords (0.0.5)
66
+ unicode-display_width (2.4.2)
67
+ vcr (6.1.0)
68
+ webmock (3.18.1)
69
+ addressable (>= 2.8.0)
65
70
  crack (>= 0.3.2)
66
71
  hashdiff (>= 0.4.0, < 2.0.0)
67
72
 
@@ -69,9 +74,9 @@ PLATFORMS
69
74
  ruby
70
75
 
71
76
  DEPENDENCIES
72
- faraday (< 2.0)
73
- klarna-checkout!
74
- pry (< 1.0)
77
+ faraday (< 3.0)
78
+ klarna-checkout-v3!
79
+ pry
75
80
  pry-byebug
76
81
  rake (< 14.0)
77
82
  rspec (< 4.0)
@@ -17,8 +17,8 @@ Gem::Specification.new do |spec|
17
17
  # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
18
18
 
19
19
  spec.metadata['homepage_uri'] = spec.homepage
20
- spec.metadata['source_code_uri'] = 'https://gitlab.com/qyre-ab/klarna-checkout-v3'
21
- spec.metadata['changelog_uri'] = 'https://gitlab.com/qyre-ab/klarna-checkout-v3/CHANGELOG.md'
20
+ spec.metadata['source_code_uri'] = 'https://gitlab.com/allabrf/klarna-checkout-v3'
21
+ spec.metadata['changelog_uri'] = 'https://gitlab.com/allabrf/klarna-checkout-v3/CHANGELOG.md'
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -4,19 +4,17 @@ module Klarna
4
4
  module Checkout
5
5
  module Operations
6
6
  module CreateRecurring
7
- # args contain the following:
8
- # [{order_lines}], order_amount, order_tax_amount, purchase_currency, locale, recurring_token
9
- def create_recurring_order(**args)
7
+ def create_recurring_order(locale:, order_lines:, order_amount:, order_tax_amount:, purchase_currency:, recurring_token:)
10
8
  payload = {
11
- 'locale': args[:locale],
12
- 'order_lines': args[:order_lines],
13
- 'order_amount': args[:order_amount],
14
- 'order_tax_amount': args[:order_tax_amount],
15
- 'purchase_currency': args[:purchase_currency],
16
- 'auto_capture': true
9
+ locale: locale,
10
+ order_lines: order_lines,
11
+ order_amount: order_amount,
12
+ order_tax_amount: order_tax_amount,
13
+ purchase_currency: purchase_currency,
14
+ auto_capture: true
17
15
  }
18
16
 
19
- JSON.parse(request(payload.to_json, args[:recurring_token]))
17
+ JSON.parse(request(payload.to_json, recurring_token))
20
18
  end
21
19
 
22
20
  private
@@ -26,12 +26,19 @@ module Klarna
26
26
  end
27
27
 
28
28
  # For creating an order, using a recurring_token
29
- def self.create_recurring(**args)
30
- if args[:recurring_token].nil?
29
+ def self.create_recurring(locale:, order_lines:, order_amount:, order_tax_amount:, purchase_currency:, recurring_token:)
30
+ if recurring_token.nil?
31
31
  raise Klarna::Checkout::Errors::OrderValidationError.new('Argument missing', 'missing_recurring_token')
32
32
  end
33
33
 
34
- create_recurring_order(args)
34
+ create_recurring_order(
35
+ locale: locale,
36
+ order_lines: order_lines,
37
+ order_amount: order_amount,
38
+ order_tax_amount: order_tax_amount,
39
+ purchase_currency: purchase_currency,
40
+ recurring_token: recurring_token
41
+ )
35
42
  end
36
43
 
37
44
  # Returns an instance of the order
@@ -44,14 +51,14 @@ module Klarna
44
51
  fetch_checkout_order(ref)
45
52
  end
46
53
 
47
- def initialize(header:, items:, recurring: false, **args)
48
- @header = header
49
- @items = items
50
- @recurring = recurring
51
- @customer = args[:customer].nil? ? {} : args[:customer]
52
- @options = args[:options]
53
- @checkout_url = args[:checkout_url].nil? ? Klarna::Checkout.configuration.checkout_uri : args[:checkout_url]
54
- @terms_url = args[:terms_url].nil? ? Klarna::Checkout.configuration.terms_uri : args[:terms_url]
54
+ def initialize(header:, items:, options: {}, recurring: false, customer: {}, checkout_url: nil, terms_url: nil)
55
+ @header = header
56
+ @items = items
57
+ @recurring = recurring
58
+ @customer = customer
59
+ @options = options
60
+ @checkout_url = checkout_url || Klarna::Checkout.configuration.checkout_uri
61
+ @terms_url = terms_url || Klarna::Checkout.configuration.terms_uri
55
62
  end
56
63
 
57
64
  # Creates an order
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Klarna
4
4
  module Checkout
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klarna-checkout-v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sverrir Steindorsson
8
8
  - Mike Eyrikh
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-05-26 00:00:00.000000000 Z
12
+ date: 2023-06-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -102,9 +102,9 @@ licenses:
102
102
  - MIT
103
103
  metadata:
104
104
  homepage_uri: https://www.rubygems.org/gems/klarna-checkout-v3
105
- source_code_uri: https://gitlab.com/qyre-ab/klarna-checkout-v3
106
- changelog_uri: https://gitlab.com/qyre-ab/klarna-checkout-v3/CHANGELOG.md
107
- post_install_message:
105
+ source_code_uri: https://gitlab.com/allabrf/klarna-checkout-v3
106
+ changelog_uri: https://gitlab.com/allabrf/klarna-checkout-v3/CHANGELOG.md
107
+ post_install_message:
108
108
  rdoc_options: []
109
109
  require_paths:
110
110
  - lib
@@ -119,8 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.0.3
123
- signing_key:
122
+ rubygems_version: 3.4.13
123
+ signing_key:
124
124
  specification_version: 4
125
125
  summary: A Ruby wrapper for the Klarna Checkout API.
126
126
  test_files: []