erp_integration 0.10.0 → 0.11.0

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
2
  SHA256:
3
- metadata.gz: d2575164b921d6b45ac6cfb10141c6199faaf5b360095b5124a14b38f1e81d61
4
- data.tar.gz: 42c7dc28adefd40ff5cf91cb3f8631547c587cb37310dfa487ab9f5b5bebe707
3
+ metadata.gz: 10feefb3de410db28d960dcab694fd3ac8cbc08e9d2ea06627e8cd5f514b2a57
4
+ data.tar.gz: a7d6540c305bf8519789aa11073dc38141cdb60226a1296a99c5ea2e2d412838
5
5
  SHA512:
6
- metadata.gz: ebfc1904ac9116b1622be174c57cb166cf1cf15db401a561395bb00e499962f4dd59837e0657bcc7eb25668da9326791de13df4cd9fd97ece6d713dc422a6c14
7
- data.tar.gz: 3844f4f39acbab1b5d62bf771085c723cb98bca680daba8b40b10ec678962f74ed37f5131c7d5d50597a209b4cb0c3f975b0a8970f91d716f48c0e44e08d819a
6
+ metadata.gz: e64d55ee5b4ab827fb78ebd864ea278bfaaa50506de7e73737cfd88cc9e9f83485b34c7c96d840f3b3a5e26b3a8df730d69f8822d1c513f31b7f4d11bf8dd2e4
7
+ data.tar.gz: dacaceb6e96523354e470e70056f574933cd8dd4e9bf30757a5ab9742545d7b460c73b3b32ff9e41a6284a99c25cb62d4eed9f312b7e4c443242f0d18d3dc894
data/README.md CHANGED
@@ -104,7 +104,7 @@ It's important to note that you'll need the right privileges to publish the gem.
104
104
 
105
105
  2. Create Pull Request
106
106
 
107
- 3. Merge it to main
107
+ 3. Merge it to develop
108
108
 
109
109
  4. Run Release script
110
110
  ```shell
@@ -92,6 +92,10 @@ module ErpIntegration
92
92
  # @return [Symbol] The configured adapter for the stock move.
93
93
  attr_writer :stock_move_adapter
94
94
 
95
+ # Logger that will be used for HTTP operations on Client
96
+ # @return [Logger] The configured logger
97
+ attr_accessor :logger
98
+
95
99
  def initialize(**options)
96
100
  options.each_pair do |key, value|
97
101
  public_send("#{key}=", value) if respond_to?("#{key}=")
@@ -44,7 +44,8 @@ module ErpIntegration
44
44
  def self.client
45
45
  Client.new(
46
46
  api_key: config.fulfil_api_key,
47
- merchant_id: config.fulfil_merchant_id
47
+ merchant_id: config.fulfil_merchant_id,
48
+ logger: config.logger
48
49
  )
49
50
  end
50
51
 
@@ -6,9 +6,10 @@ module ErpIntegration
6
6
  attr_reader :api_key, :merchant_id
7
7
  attr_writer :connection, :faraday_adapter
8
8
 
9
- def initialize(api_key:, merchant_id:)
9
+ def initialize(api_key:, merchant_id:, logger: nil)
10
10
  @api_key = api_key
11
11
  @merchant_id = merchant_id
12
+ @logger = logger
12
13
  end
13
14
 
14
15
  # Generates the url prefix for the Faraday connection client.
@@ -35,6 +36,11 @@ module ErpIntegration
35
36
  faraday.response :follow_redirects
36
37
  faraday.response :json # Decode response bodies as JSON
37
38
 
39
+ # Notice that logging headers will expose sensitive information
40
+ # like api-key. To avoid use filters:
41
+ # https://lostisland.github.io/faraday/middleware/logger
42
+ faraday.response :logger, @logger, { headers: false, bodies: true }
43
+
38
44
  # Custom error handling for the error response
39
45
  faraday.use ErpIntegration::Middleware::ErrorHandling
40
46
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErpIntegration
4
- VERSION = '0.10.0'
4
+ VERSION = '0.11.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erp_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Vermaas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-26 00:00:00.000000000 Z
11
+ date: 2022-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -325,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
325
325
  - !ruby/object:Gem::Version
326
326
  version: '0'
327
327
  requirements: []
328
- rubygems_version: 3.0.3
328
+ rubygems_version: 3.1.4
329
329
  signing_key:
330
330
  specification_version: 4
331
331
  summary: Connects Mejuri with third-party ERP vendors