erp_integration 0.53.1 → 0.54.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: 94641315e041baf5dfa5ade8f7d4802f53bf70cff09f3fadd61b2232f2b541ca
4
- data.tar.gz: b32375c29eed88ee070426ea42465d36cb8c8dd309512a41cf54649fc956940d
3
+ metadata.gz: 015dee8d29c0a8bcd763966f25c24b77efb9cd2e7ac4a1555aa104e9a708c2ec
4
+ data.tar.gz: 92f5a27785677904bd7b0cd60fc5a033195ed99d64d9c16941fbb4d942db8b31
5
5
  SHA512:
6
- metadata.gz: 4e87ddefd4bc53228dd37ba8f6e1651d9f160401898f44f9d16b740b3e78d5aab6f1e2cc415b6ab31066393e7ac8babf272c17107bc7b113005f67ec5c8395c2
7
- data.tar.gz: 9c0f725849676df52f149df431367079cb9652afcb07ad55b295433e96124f251a292e91f98df08d70f9fe986b1da25b1a8e497d6ccfddb2a04bd8529fd801b4
6
+ metadata.gz: 526e86fb610c85d0b5c69f36e2cf1b1c396ff36e6f74c2db6d9764eae9eb1f076d9ed7771b5347ac3060bbdbd047777c1901c427351a280bcb26bf49b6edb269
7
+ data.tar.gz: f876d9874077923090353f7e2c9d6766cae725fe1558345ba98f4d5cfc07495bb272f451205f04c6a957402fdf10bc756d69ad8792a55405c91a07ce856d5e4e
data/README.md CHANGED
@@ -26,7 +26,7 @@ To configure the gem, create an initializer and add the following lines:
26
26
  # config/initializers/erp_integration.rb
27
27
  ErpIntegration.configure do |config|
28
28
  config.fulfil_api_keys = '<your-api-key>'
29
- config.fulfil_merchant_id = '<your-merchant-id>'
29
+ config.fulfil_base_url = '<your-base-url>'
30
30
  end
31
31
  ```
32
32
 
@@ -35,7 +35,7 @@ You can configure multiple API keys, to enable rotation mechanism (see ["API key
35
35
  # config/initializers/erp_integration.rb
36
36
  ErpIntegration.configure do |config|
37
37
  config.fulfil_api_keys = ['<your-api-key1>', '<your-api-key2>']
38
- config.fulfil_merchant_id = '<your-merchant-id>'
38
+ config.fulfil_base_url = '<your-base-url>'
39
39
  end
40
40
  ```
41
41
 
@@ -14,13 +14,13 @@ module ErpIntegration
14
14
  class Configuration
15
15
  # The `fulfil_api_keys` sets a single or a list of API keys to use
16
16
  # in the `FulfilClient` to authorize the requests to the Fulfil API endpoints.
17
- # @return [Array<Atring>] The API keys for Fulfil.
17
+ # @return [Array<String>] The API keys for Fulfil.
18
18
  attr_accessor :fulfil_api_keys
19
19
 
20
- # The `fulfil_merchant_id` is used by the `FulfilClient` to connect to
20
+ # The `fulfil_base_url` is used by the `FulfilClient` to connect to
21
21
  # the right Fulfil API endpoints.
22
- # @return [String] The merchant ID for Fulfil.
23
- attr_accessor :fulfil_merchant_id
22
+ # @return [String] The base URL for Fulfil.
23
+ attr_accessor :fulfil_base_url
24
24
 
25
25
  # Allows configuring an adapter for the `BillOfMaterial` resource. When
26
26
  # none is configured, it will default to Fulfil.
@@ -28,7 +28,7 @@ module ErpIntegration
28
28
  def self.client
29
29
  Client.new(
30
30
  api_keys_pool: api_keys_pool,
31
- merchant_id: config.fulfil_merchant_id,
31
+ base_url: config.fulfil_base_url,
32
32
  logger: config.logger
33
33
  )
34
34
  end
@@ -3,21 +3,15 @@
3
3
  module ErpIntegration
4
4
  module Fulfil
5
5
  class Client
6
- attr_reader :api_keys_pool, :merchant_id
6
+ attr_reader :api_keys_pool, :base_url
7
7
  attr_writer :connection, :faraday_adapter, :rotate_statuses
8
8
 
9
- def initialize(api_keys_pool:, merchant_id:, logger: nil)
9
+ def initialize(api_keys_pool:, base_url:, logger: nil)
10
10
  @api_keys_pool = api_keys_pool
11
- @merchant_id = merchant_id
11
+ @base_url = base_url.strip
12
12
  @logger = logger
13
13
  end
14
14
 
15
- # Generates the url prefix for the Faraday connection client.
16
- # @return [String] The base url for the Fulfil HTTP client
17
- def base_url
18
- "https://#{merchant_id}.fulfil.io/"
19
- end
20
-
21
15
  # Sets the default adapter for the Faraday Connection.
22
16
  # @return [Symbol] The default Faraday adapter
23
17
  def faraday_adapter
@@ -50,8 +44,8 @@ module ErpIntegration
50
44
 
51
45
  %i[delete get patch put post].each do |action_name|
52
46
  define_method(action_name) do |path, options = {}|
53
- if api_key.nil? || merchant_id.nil?
54
- raise ErpIntegration::Error, 'The Fulfil API key and/or Merchant ID are missing.'
47
+ if api_key.nil? || base_url.nil?
48
+ raise ErpIntegration::Error, 'The Fulfil API key and/or base URL are missing.'
55
49
  end
56
50
 
57
51
  connection.public_send(action_name, "api/#{version}/#{path}", options).body
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErpIntegration
4
- VERSION = '0.53.1'
4
+ VERSION = '0.54.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.53.1
4
+ version: 0.54.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: 2024-10-30 00:00:00.000000000 Z
11
+ date: 2024-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -368,7 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
368
368
  - !ruby/object:Gem::Version
369
369
  version: '0'
370
370
  requirements: []
371
- rubygems_version: 3.2.22
371
+ rubygems_version: 3.5.11
372
372
  signing_key:
373
373
  specification_version: 4
374
374
  summary: Connects Mejuri with third-party ERP vendors