payu_api 0.1.5 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 76a58280746739f8fde20c12bc5baa4967714074
4
- data.tar.gz: 78e1448b997ea30a5aafcf06fe256bfd47512bf0
2
+ SHA256:
3
+ metadata.gz: 66f66f44922000c33fba74d44a3750bab538ed47afdcc11aa5f494d13e7bdb6b
4
+ data.tar.gz: 51a3e776182bf45c7d863dfca66510c2886a6b88a5aa97069a4bd0042d09d6f6
5
5
  SHA512:
6
- metadata.gz: 2f70f51bb3f4f69f4191f4e76ffdad131b1aa58a2ffc538aca9ec72237af1fa5d40339bee66e4e4f69f13e581739c132817f084a7c5f7f75a6cbb329768ead7f
7
- data.tar.gz: ac7b9111c41c08ba1bdaaf4d6a34d10be87a8e4659c080e26b8073ff6bad803157bd197182b840bb2f7b94110f63faee31a5cbcb6f4338c54e8be104e808eb37
6
+ metadata.gz: 34a8cba705a4c44006f6ca953451c3f395abf8400bb3d700e524773e15c59bfe732e0e1e741c19f3c8da14a28739968f941bcf4ea62c570f58123e026ecdd3c0
7
+ data.tar.gz: b4e6d0dc16f1fbd74f241019cc804c75052e10ae5294838e59b40a2df5f8695f4a969bbbc292a19c1b5716f2e20eca75e141614cee1eb6289ef5479b84189abe
@@ -9,6 +9,10 @@ module PayuAPI
9
9
 
10
10
  private
11
11
 
12
+ def logger
13
+ client.logger
14
+ end
15
+
12
16
  def sandbox?
13
17
  client.sandbox
14
18
  end
@@ -5,6 +5,7 @@ module PayuAPI
5
5
  option :pos_id
6
6
  option :auth_token
7
7
  option :sandbox, default: proc { false }
8
+ option :logger, default: proc { nil }
8
9
 
9
10
  def create_order(order_params)
10
11
  Order.create(client: self, params: order_params)
@@ -5,7 +5,11 @@ module PayuAPI
5
5
 
6
6
  # rubocop:disable Metrics/AbcSize
7
7
  def call
8
- connection = Faraday::Connection.new(api_url)
8
+ connection = Faraday.new(url: api_url) do |builder|
9
+ builder.response(:detailed_logger, logger) if logger
10
+ builder.adapter Faraday.default_adapter
11
+ end
12
+
9
13
  connection.public_send(method.to_s.downcase) do |request|
10
14
  request.url url
11
15
  request.body = body if body
@@ -42,5 +46,9 @@ module PayuAPI
42
46
  def body
43
47
  nil
44
48
  end
49
+
50
+ def logger
51
+ nil
52
+ end
45
53
  end
46
54
  end
@@ -1,6 +1,6 @@
1
1
  module PayuAPI
2
2
  class CreateResponse < Response
3
- SUCCESS_HTTP_STATUSES = [200, 302].freeze
3
+ SUCCESS_HTTP_STATUSES = [200, 201, 302].freeze
4
4
  SUCCESS_STATUSES = [
5
5
  'SUCCESS',
6
6
  'WARNING_CONTINUE_3DS',
@@ -1,3 +1,3 @@
1
1
  module PayuAPI
2
- VERSION = '0.1.5'.freeze
2
+ VERSION = '0.1.7'.freeze
3
3
  end
@@ -29,4 +29,5 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency 'simplecov', '~> 0.12'
30
30
  spec.add_development_dependency 'rubocop', '~> 0.42'
31
31
  spec.add_development_dependency 'byebug'
32
+ spec.add_development_dependency 'faraday-detailed_logger'
32
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payu_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Khrebtov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-10 00:00:00.000000000 Z
11
+ date: 2019-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-initializer
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: faraday-detailed_logger
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: Ruby wrapper for PayU REST API
140
154
  email:
141
155
  - roman@alltmb.ru
@@ -188,8 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
202
  - !ruby/object:Gem::Version
189
203
  version: '0'
190
204
  requirements: []
191
- rubyforge_project:
192
- rubygems_version: 2.4.5.1
205
+ rubygems_version: 3.0.3
193
206
  signing_key:
194
207
  specification_version: 4
195
208
  summary: Ruby wrapper for PayU REST API