quickpay-ruby-client 2.0.3 → 3.0.0

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: 041757ab3e9e7688c4c0e0b4bb523c1b16baf875746c2fa8801d9c004f1a174e
4
- data.tar.gz: d2baacb035ee593e3c3245a011ddf163835b3c219b0b9126c513b82a4809439b
3
+ metadata.gz: 47a7b8b3bec59cf6276448d2e8eb29149288518b12d0df8e377fc10783bb6090
4
+ data.tar.gz: d80a3b9b3deda68bea662dd67a5937ea724a7aa58d44ec7fde61c74c588b9e43
5
5
  SHA512:
6
- metadata.gz: 63a8c25391f66f1be08c39af42fb0542692f9c29725f4d93318f7929aec4cd199e12868236e065c6425d262242838a20c82286d3635c4092333c2941eea3e260
7
- data.tar.gz: b3d8ac7466ea38f24bdc7a52f50538beced740eba4a5cc447486d1694a5b073c7d1d8834586ecf76e1c8720718427f95650d9e77669a5b69197db61cb9f89414
6
+ metadata.gz: cadad5ea2172320dd9133e6e8534d08cc1475d1b3d8d66839686eebaeba74000e0b162f8332b118cc21794299970a3c938b199f85ceff6a5b44c37405164ffaa
7
+ data.tar.gz: c46b7f639b9f9359c53206a02583c5c593535601541cd8a75861666b943db5a629edfb7df58d6b25615450758b8ffa461bcb668a002b7022e511f7f2acd85ede
data/.travis.yml CHANGED
@@ -1,10 +1,11 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3
4
- - 2.4
5
3
  - 2.5
6
4
  - 2.6
5
+ - 2.7
6
+ - 3.0
7
7
  cache: bundler
8
+ before_script: wget -O ~/.rubocop.yml https://quickpay.github.io/development/.rubocop.yml
8
9
  script: bundle exec rake
9
10
  notifications:
10
11
  slack:
data/CHANGELOG.md CHANGED
@@ -1,6 +1,59 @@
1
1
  # Changelog
2
2
 
3
- ## master
3
+ ## 3.0.0
4
+
5
+ ### Breaking changes
6
+
7
+ The interface has been changed to (https://github.com/QuickPay/quickpay-ruby-client/pull/36):
8
+
9
+ - always return an array for all request types (incl. when adding the `raw: true` option)
10
+ - order the array as `[body, status, headers]` (was `[status, body, headers]`
11
+ - always parse JSON body unless the `raw: true` option is set
12
+
13
+ The reasoning is that we almost always want the `body`, but in some case we want `status`and/or `headers` as well. Before we had to set the `raw: true` option, but then a JSON body would not be parsed.
14
+
15
+ ```ruby
16
+ body, = client.get("/ping")
17
+ body, status, = client.get("/ping")
18
+ body, status, headers = client.get("/ping")
19
+ body, status, headers = client.get("/ping", raw: true)
20
+ ```
21
+
22
+ ### New features
23
+
24
+ #### Blocks
25
+
26
+ You can now pass a block to a request (https://github.com/QuickPay/quickpay-ruby-client/pull/32):
27
+
28
+ ```ruby
29
+ msg = client.get("/ping") do |body, status, headers, error|
30
+ case error
31
+ when nil
32
+ body["msg"]
33
+ when QuickPay::API::NotFound
34
+ nil
35
+ else
36
+ raise error
37
+ end
38
+ end
39
+ ```
40
+
41
+ #### Verbose errors
42
+
43
+ The `QuickPay::API::Error` now includes the request that yielded the error - for example:
44
+
45
+ ```
46
+ #<QuickPay::API::Error::NotFound:
47
+ status=404,
48
+ body="404 Not Found",
49
+ headers={"Server"=>"nginx", "Date"=>"Sun, 21 Mar 2021 09:10:12 GMT", "Connection"=>"keep-alive", "X-Cascade"=>"pass", "Vary"=>"Origin"}
50
+ request=#<struct QuickPay::API::Client::Request
51
+ method=:post,
52
+ path="/payments",
53
+ body="{\"currency\":\"DKK\",\"order_id\":\"1212\"}",
54
+ headers={"User-Agent"=>"quickpay-ruby-client, v2.0.3", "Accept-Version"=>"v10", "Content-Type"=>"application/json"},
55
+ query=nil>>
56
+ ```
4
57
 
5
58
  ## v2.0.3
6
59
 
data/README.md CHANGED
@@ -19,8 +19,8 @@ or install from Rubygems:
19
19
  ```
20
20
  $ gem install quickpay-ruby-client
21
21
  ```
22
-
23
- It is currently tested with Ruby ( >= 2.1.x)
22
+
23
+ It is currently tested with Ruby ( >= 2.5.x)
24
24
 
25
25
  * MRI
26
26
  * Rubinius (2.0)
@@ -31,7 +31,7 @@ Before doing anything you should register yourself with QuickPay and get access
31
31
 
32
32
  ### Create a new API client
33
33
 
34
- First you should create a client instance that is anonymous or authorized with your API key or login credentials provided by QuickPay.
34
+ First you should create a client instance that is anonymous or authorized with your API key or login credentials provided by QuickPay.
35
35
 
36
36
  To initialise an anonymous client:
37
37
 
@@ -57,26 +57,74 @@ client = QuickPay::API::Client.new(username: ENV["QUICKPAY_LOGIN"], password: EN
57
57
  You can also set some connection specific options (default values shown):
58
58
 
59
59
  ```ruby
60
- client = Quickpay::API::Client.new(
60
+ client = QuickPay::API::Client.new(
61
61
  options: {
62
62
  read_timeout: 60,
63
63
  write_timeout: 60,
64
64
  connect_timeout: 60,
65
- json_opts: { symbolize_names: true }
65
+ json_opts: { symbolize_names: false }
66
66
  }
67
- )
67
+ )
68
68
  ```
69
69
 
70
70
  ### Sending request
71
71
 
72
72
  You can afterwards call any method described in QuickPay API with corresponding http method and endpoint. These methods are supported currently: `get`, `post`, `put`, `patch`, `delete` and `head`.
73
73
 
74
+ Any request will return an array in the form `[body, status, headers]`:
75
+
76
+ ```ruby
77
+ # Shortest form when interested in the response body only
78
+ body, = client.get("/ping")
79
+ puts body.inspect
80
+
81
+ # Get all response information
82
+ body, status, headers = client.get("/ping")
83
+ puts body.inspect, status.inspect, headers.inspect
84
+
85
+ ```
86
+
87
+ You can also do requests in block form:
88
+
89
+ ```ruby
90
+ client.get("/ping") do |body, status, headers|
91
+ puts body.inspect
92
+ end
93
+ ```
94
+
95
+ It is even possible to pass the `QuickPay::API::Error` to the block as the 4th parameter to be able to handle the errors that _would_ have otherwise been raised. This parameter is nil when the response is a success.
96
+
74
97
  ```ruby
75
- client.get("/activity").each do |activity|
76
- puts activity["id"]
98
+ # the error is not raised but passed to the block as the fourth parameter
99
+ client.get("/ping") do |body, status, headers, error|
100
+ case error
101
+ when nil
102
+ body[:id]
103
+ when QuickPay::API::NotFound
104
+ nil
105
+ else
106
+ raise error
107
+ end
108
+ end
109
+
110
+ # will raise `QuickPay::API::Error::NotFound` since the fourth block param is not defined
111
+ client.get("/non-existing-path") do |body, status, headers| do
77
112
  end
78
113
  ```
79
114
 
115
+ If you want raw http response body, you can add `:raw => true` parameter:
116
+
117
+ ```ruby
118
+ body, status, headers = client.get("/ping", raw: true)
119
+
120
+ if status == 200
121
+ puts JSON.parse(body).inspect
122
+ else
123
+ # do something else
124
+ end
125
+
126
+ ```
127
+
80
128
  Beyond the endpoint, the client accepts the following options (default values shown):
81
129
 
82
130
  * `body: ""`
@@ -85,8 +133,10 @@ Beyond the endpoint, the client accepts the following options (default values sh
85
133
  * `raw: false`
86
134
  * `json_opts: nil`
87
135
 
136
+ Full example:
137
+
88
138
  ```ruby
89
- response = client.post(
139
+ response, = client.post(
90
140
  "/payments/1/capture",
91
141
  body: { amount: 100 }.to_json,
92
142
  headers: { "Content-Type" => "application/json" },
@@ -97,21 +147,6 @@ response = client.post(
97
147
 
98
148
  ```
99
149
 
100
- If you want raw http response, headers Please add `:raw => true` parameter:
101
-
102
- ```ruby
103
- status, body, headers = client.get("/activity", raw: true)
104
-
105
- if status == 200
106
- JSON.parse(body).each do |activity|
107
- puts activity["id"]
108
- end
109
- else
110
- # do something else
111
- end
112
-
113
- ```
114
-
115
150
  ### Handling API exceptions
116
151
 
117
152
  By default `(get|post|patch|put|delete)` will return JSON parsed body on success (i.e. `2xx` response code) otherwise it will raise appropriate error. Your code should handle the errors appropriately. Following error codes are supported currently:
@@ -120,7 +155,7 @@ By default `(get|post|patch|put|delete)` will return JSON parsed body on success
120
155
  Response status | Error |
121
156
  ----------------| ----------|
122
157
  `400` | `QuickPay::API::BadRequest`
123
- `401` | `QuickPay::API::Unauthorized`
158
+ `401` | `QuickPay::API::Unauthorized`
124
159
  `402` | `QuickPay::API::PaymentRequired`
125
160
  `403` | `QuickPay::API::Forbidden`
126
161
  `404` | `QuickPay::API::NotFound`
@@ -136,12 +171,27 @@ All exceptions inherits `QuickPay::API::Error`, so you can listen for any api er
136
171
 
137
172
  ```ruby
138
173
  begin
139
- client.post("/payments", body: { currency: "DKK", order_id: "1212" })
174
+ client.post("/payments", body: { currency: "DKK", order_id: "1212" }, headers: { "Content-Type" => "application/json" })
140
175
  rescue QuickPay::API::Error => e
141
- puts e.body
176
+ puts e.inspect
142
177
  end
143
178
  ```
144
179
 
180
+ Example error object:
181
+
182
+ ```
183
+ #<QuickPay::API::Error::NotFound:
184
+ status=404,
185
+ body="404 Not Found",
186
+ headers={"Server"=>"nginx", "Date"=>"Sun, 21 Mar 2021 09:10:12 GMT", "Connection"=>"keep-alive", "X-Cascade"=>"pass", "Vary"=>"Origin"}
187
+ request=#<struct QuickPay::API::Client::Request
188
+ method=:post,
189
+ path="/payments",
190
+ body="{\"currency\":\"DKK\",\"order_id\":\"1212\"}",
191
+ headers={"User-Agent"=>"quickpay-ruby-client, v2.0.3", "Accept-Version"=>"v10", "Content-Type"=>"application/json"},
192
+ query=nil>>
193
+ ```
194
+
145
195
  You can read more about QuickPay API responses at [https://learn.quickpay.net/tech-talk/api](https://learn.quickpay.net/tech-talk/api).
146
196
 
147
197
  ## Contributions
@@ -157,5 +207,5 @@ To contribute:
157
207
  ### Running the specs
158
208
 
159
209
  ```
160
- $ bundle exec ruby test/client.rb
210
+ $ bundle exec rake test
161
211
  ```
data/Rakefile CHANGED
@@ -2,22 +2,32 @@ require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
  require "rubocop/rake_task"
4
4
 
5
- RuboCop::RakeTask.new
5
+ task default: :test
6
6
 
7
- task :opts do
8
- ENV["TESTOPTS"] = "--verbose"
7
+ desc "Open an irb/pry session"
8
+ task :console do
9
+ exec "bin/console"
9
10
  end
10
11
 
11
- desc "Run tests with verbose output"
12
- task "test:verbose" => %i[opts test]
12
+ namespace :test do
13
+ RuboCop::RakeTask.new
13
14
 
14
- desc "Run tests"
15
- task :test do |t|
16
- Rake::TestTask.new(t.name) do |tt|
17
- tt.libs << "."
18
- tt.test_files = Dir.glob("test/*.rb")
19
- tt.warning = false
15
+ task :opts do
16
+ ENV["TESTOPTS"] = "--verbose"
20
17
  end
18
+
19
+ desc "Run tests"
20
+ task :specs do |t|
21
+ Rake::TestTask.new(t.name) do |tt|
22
+ tt.libs << "."
23
+ tt.test_files = Dir.glob("test/*.rb")
24
+ tt.warning = false
25
+ end
26
+ end
27
+
28
+ desc "Run tests with verbose output"
29
+ task verbose: %i[opts test]
21
30
  end
22
31
 
23
- task default: %i[test rubocop]
32
+ desc "Run test suite"
33
+ task test: ["test:specs", "test:rubocop"]
data/bin/console ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ ENV["APP_KIND"] = "console"
3
+ APP_ROOT = File.realdirpath(File.expand_path("..", __dir__))
4
+ $LOAD_PATH.unshift(APP_ROOT)
5
+
6
+ require "irb"
7
+ require "lib/quickpay/api/client"
8
+
9
+ CLIENT = QuickPay::API::Client.new
10
+
11
+ ARGV.clear
12
+ IRB.start
@@ -11,6 +11,8 @@ module QuickPay
11
11
  "Accept-Version" => "v10"
12
12
  }.freeze
13
13
 
14
+ Request = Struct.new(:method, :path, :body, :headers, :query) # rubocop:disable Lint/StructNewOverride
15
+
14
16
  def initialize(username: nil, password: nil, base_uri: "https://api.quickpay.net", options: {})
15
17
  opts = {
16
18
  read_timeout: options.fetch(:read_timeout, 60),
@@ -26,7 +28,7 @@ module QuickPay
26
28
  end
27
29
 
28
30
  %i[get post patch put delete head].each do |method|
29
- define_method(method) do |path, options = {}|
31
+ define_method(method) do |path, **options, &block|
30
32
  headers = DEFAULT_HEADERS.merge(options.fetch(:headers, {}))
31
33
  body = begin
32
34
  data = options.fetch(:body, "")
@@ -37,27 +39,45 @@ module QuickPay
37
39
  end
38
40
  end
39
41
 
40
- res = @connection.request(
41
- method: method,
42
- path: path,
43
- body: body,
44
- headers: headers,
45
- query: options.fetch(:query, {})
46
- )
42
+ req = Request.new(
43
+ method,
44
+ path,
45
+ scrub_body(body.dup, headers["Content-Type"]),
46
+ headers,
47
+ options.fetch(:query, {})
48
+ ).freeze
49
+
50
+ res = @connection.request(**req.to_h)
51
+ error = QuickPay::API::Error.by_status_code(res.status, res.body, res.headers, req)
52
+
53
+ if !options.fetch(:raw, false) && res.headers["Content-Type"] =~ %r{application/json}
54
+ res.body = JSON.parse(res.body, options[:json_opts] || @connection.data[:json_opts])
55
+ end
56
+
57
+ if block
58
+ # Raise error if not specified as fourth block parameter
59
+ raise error if error && block.parameters.size < 4
47
60
 
48
- if options.fetch(:raw, false)
49
- [res.status, res.body, res.headers]
61
+ block.call(res.body, res.status, res.headers, error)
50
62
  else
51
- raise QuickPay::API::Error.by_status_code(res.status, res.body, res.headers) if res.status >= 400
63
+ raise error if error
52
64
 
53
- if res.headers["Content-Type"] == "application/json"
54
- JSON.parse(res.body, options.dig(:json_opts) || @connection.data.dig(:json_opts))
55
- else
56
- res.body
57
- end
65
+ [res.body, res.status, res.headers]
58
66
  end
59
67
  end
60
68
  end
69
+
70
+ private
71
+
72
+ def scrub_body(body, content_type)
73
+ return "" if body.to_s.empty?
74
+
75
+ if ["application/json", "application/x-www-form-urlencoded"].include?(content_type)
76
+ body
77
+ else
78
+ "<scrubbed for Content-Type #{content_type}>"
79
+ end
80
+ end
61
81
  end
62
82
  end
63
83
  end
@@ -2,53 +2,66 @@ module QuickPay
2
2
  module API
3
3
  class Error < StandardError
4
4
  class BadRequest < Error; end
5
+
5
6
  class Unauthorized < Error; end
7
+
6
8
  class PaymentRequired < Error; end
9
+
7
10
  class Forbidden < Error; end
11
+
8
12
  class NotFound < Error; end
13
+
9
14
  class MethodNotAllowed < Error; end
15
+
10
16
  class NotAcceptable < Error; end
17
+
11
18
  class Conflict < Error; end
19
+
12
20
  class TooManyRequest < Error; end
21
+
13
22
  class InternalServerError < Error; end
23
+
14
24
  class BadGateway < Error; end
25
+
15
26
  class ServiceUnavailable < Error; end
27
+
16
28
  class GatewayTimeout < Error; end
17
29
 
18
30
  CLASS_MAP = {
19
- 400 => "BadRequest",
20
- 401 => "Unauthorized",
21
- 402 => "PaymentRequired",
22
- 403 => "Forbidden",
23
- 404 => "NotFound",
24
- 405 => "MethodNotAllowed",
25
- 406 => "NotAcceptable",
26
- 409 => "Conflict",
27
- 429 => "TooManyRequest",
28
- 500 => "InternalServerError",
29
- 502 => "BadGateway",
30
- 503 => "ServiceUnavailable",
31
- 504 => "GatewayTimeout"
31
+ 400 => BadRequest,
32
+ 401 => Unauthorized,
33
+ 402 => PaymentRequired,
34
+ 403 => Forbidden,
35
+ 404 => NotFound,
36
+ 405 => MethodNotAllowed,
37
+ 406 => NotAcceptable,
38
+ 409 => Conflict,
39
+ 429 => TooManyRequest,
40
+ 500 => InternalServerError,
41
+ 502 => BadGateway,
42
+ 503 => ServiceUnavailable,
43
+ 504 => GatewayTimeout
32
44
  }.freeze
33
45
 
34
- attr_reader :status, :body, :headers
46
+ attr_reader :status, :body, :headers, :request
35
47
 
36
- def initialize(status, body, headers)
48
+ def initialize(status, body, headers, request)
37
49
  @status = status
38
50
  @body = body
39
51
  @headers = headers
52
+ @request = request
40
53
  end
41
54
 
42
55
  def to_s
43
- "#<#{self.class}: status=#{status}, body=#{body.inspect}, headers=#{headers.inspect}>"
56
+ "#<#{self.class}: status=#{status}, body=#{body.inspect}, " \
57
+ "headers=#{headers.inspect} request=#{request.inspect}>"
44
58
  end
45
59
  alias_method :inspect, :to_s
46
60
 
47
- def self.by_status_code(status, body, headers)
48
- raise QuickPay::API::Error.new(status, body, headers) unless CLASS_MAP[status]
61
+ def self.by_status_code(status, body, headers, request)
62
+ return if (200..399).cover? status
49
63
 
50
- klass = QuickPay::API::Error.const_get(CLASS_MAP[status])
51
- raise klass.new(status, body, headers)
64
+ CLASS_MAP.fetch(status, QuickPay::API::Error).new(status, body, headers, request)
52
65
  end
53
66
  end
54
67
  end
@@ -1,5 +1,5 @@
1
1
  module QuickPay
2
2
  module API
3
- VERSION = "2.0.3".freeze
3
+ VERSION = "3.0.0".freeze
4
4
  end
5
5
  end
@@ -3,6 +3,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require "quickpay/api/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
+ spec.required_ruby_version = ">= 2.5.0" # rubocop:disable Gemspec/RequiredRubyVersion
7
+
6
8
  spec.name = "quickpay-ruby-client"
7
9
  spec.version = QuickPay::API::VERSION
8
10
  spec.authors = ["QuickPay Developers"]
@@ -18,11 +20,13 @@ Gem::Specification.new do |spec|
18
20
  spec.require_paths = ["lib"]
19
21
 
20
22
  spec.add_development_dependency "bundler"
21
- spec.add_development_dependency "minitest", "~> 5.11.3"
22
- spec.add_development_dependency "rake", "~> 12.3.2"
23
+ spec.add_development_dependency "minitest"
24
+ spec.add_development_dependency "pry"
25
+ spec.add_development_dependency "rake"
23
26
  spec.add_development_dependency "rubocop"
24
- spec.add_development_dependency "simplecov", "~> 0.16.1"
25
- spec.add_development_dependency "simplecov-console", "~> 0.4.2"
27
+ spec.add_development_dependency "simplecov"
28
+ spec.add_development_dependency "simplecov-console"
26
29
 
27
- spec.add_dependency "excon", "~> 0.71.0"
30
+ spec.add_dependency "excon", "~> 0.79.0"
31
+ spec.add_dependency "json", "~> 2.5.0"
28
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickpay-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - QuickPay Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-31 00:00:00.000000000 Z
11
+ date: 2021-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,30 +28,44 @@ dependencies:
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 5.11.3
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 5.11.3
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: 12.3.2
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: 12.3.2
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rubocop
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -70,44 +84,58 @@ dependencies:
70
84
  name: simplecov
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - "~>"
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
- version: 0.16.1
89
+ version: '0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - "~>"
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
- version: 0.16.1
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: simplecov-console
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - "~>"
101
+ - - ">="
88
102
  - !ruby/object:Gem::Version
89
- version: 0.4.2
103
+ version: '0'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - "~>"
108
+ - - ">="
95
109
  - !ruby/object:Gem::Version
96
- version: 0.4.2
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: excon
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: 0.71.0
117
+ version: 0.79.0
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
122
  - - "~>"
109
123
  - !ruby/object:Gem::Version
110
- version: 0.71.0
124
+ version: 0.79.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: json
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 2.5.0
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 2.5.0
111
139
  description: Embed QuickPay's secure payments directly into your Ruby applications.
112
140
  Learn more at https://tech.quickpay.net
113
141
  email:
@@ -117,13 +145,13 @@ extensions: []
117
145
  extra_rdoc_files: []
118
146
  files:
119
147
  - ".gitignore"
120
- - ".rubocop.yml"
121
148
  - ".travis.yml"
122
149
  - CHANGELOG.md
123
150
  - Gemfile
124
151
  - LICENSE.txt
125
152
  - README.md
126
153
  - Rakefile
154
+ - bin/console
127
155
  - lib/quickpay/api/client.rb
128
156
  - lib/quickpay/api/error.rb
129
157
  - lib/quickpay/api/version.rb
@@ -140,15 +168,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
168
  requirements:
141
169
  - - ">="
142
170
  - !ruby/object:Gem::Version
143
- version: '0'
171
+ version: 2.5.0
144
172
  required_rubygems_version: !ruby/object:Gem::Requirement
145
173
  requirements:
146
174
  - - ">="
147
175
  - !ruby/object:Gem::Version
148
176
  version: '0'
149
177
  requirements: []
150
- rubyforge_project:
151
- rubygems_version: 2.7.6
178
+ rubygems_version: 3.1.2
152
179
  signing_key:
153
180
  specification_version: 4
154
181
  summary: Ruby client for QuickPay API
data/.rubocop.yml DELETED
@@ -1,92 +0,0 @@
1
- ###########################
2
- # Configuration for rubocop
3
- # in .rubocop.yml
4
- # Most of these are disabling existing cops, primarily
5
- # due to a smattering of different styles and loose
6
- # guidlines for contributions.
7
- #
8
- # Any of these may be changed.
9
- AllCops:
10
- TargetRubyVersion: 2.5
11
-
12
- Style/StringLiterals:
13
- EnforcedStyle: double_quotes
14
-
15
- Style/StringLiteralsInInterpolation:
16
- EnforcedStyle: double_quotes
17
-
18
- Style/Alias:
19
- EnforcedStyle: prefer_alias_method
20
-
21
- Style/DoubleNegation:
22
- Enabled: false
23
-
24
- Style/NumericLiterals:
25
- Enabled: false
26
-
27
- Style/SingleLineBlockParams:
28
- Enabled: false
29
-
30
- Style/MethodMissingSuper:
31
- Enabled: false
32
-
33
- Style/MissingRespondToMissing:
34
- Enabled: false
35
-
36
- Style/EmptyMethod:
37
- EnforcedStyle: expanded
38
-
39
- Naming/VariableNumber:
40
- Enabled: false
41
-
42
- Naming/AccessorMethodName:
43
- Enabled: false
44
-
45
- Style/HashSyntax:
46
- EnforcedStyle: no_mixed_keys
47
-
48
- Style/FrozenStringLiteralComment:
49
- Enabled: false
50
-
51
- Style/NumericPredicate:
52
- Enabled: false
53
-
54
- LineLength:
55
- Max: 119 # github diff (ex. +-)
56
-
57
- Documentation:
58
- Enabled: false
59
-
60
- Metrics/ClassLength:
61
- CountComments: false
62
- Exclude:
63
- - "**/spec/**/*"
64
-
65
- Metrics/ModuleLength:
66
- CountComments: false
67
- Exclude:
68
- - "**/spec/**/*"
69
-
70
- Metrics/MethodLength:
71
- Enabled: false
72
-
73
- Metrics/BlockLength:
74
- Enabled: false
75
-
76
- Metrics/AbcSize:
77
- Enabled: false
78
-
79
- Metrics/CyclomaticComplexity:
80
- Enabled: false
81
-
82
- Metrics/PerceivedComplexity:
83
- Enabled: false
84
-
85
- Metrics/ParameterLists:
86
- Enabled: false
87
-
88
- FrozenStringLiteralComment:
89
- Enabled: false
90
-
91
- Style/RedundantCondition: # Double pipes(||) on multiline is not so clear.
92
- Enabled: false