ozon-logistics 0.0.2 → 0.0.3

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: 8f4ea93391ed9353bca0813697688ce7f4e1e40124be5da8db39408ba9eb3e2d
4
- data.tar.gz: 63acc74e32219a54c561054ee5d0a07885e2345607cb5c0a8c7dcd58b176e778
3
+ metadata.gz: 530a419bd4218b9ff284786ee3ac2d95d1914d0ed473d6351acdd3c55cd08858
4
+ data.tar.gz: 9fdac760b684ca0d999a98e08c8695e91534b458dd7c0a334060541c93da3f8f
5
5
  SHA512:
6
- metadata.gz: 23a5ec4d76dbc0fedd5e8206c2c12f13b2732c17963d926484972363d716e04f9355747a0f583cee378dc3403ebb9bee8a31e8cd6acfd08b50641208dd4ab14f
7
- data.tar.gz: a22b9a34526d59c6c3105c835caefcf4c61a6cae5e32c20d57ea6821d01adafebd5430784f7ee696d00de9eb44e30280ef2377c460628515350aa522d7d6c235
6
+ metadata.gz: f0da5fbff0ae9e168eb837c95fc0a221c04b1f5ad2f52e60080618f165aa9175ba555b8839f70381f2d392b362aa88dab3735a8baf65bf54ceeb804a9220db7d
7
+ data.tar.gz: 81e3e1b12e19fb15b5548ab9efafed4fc7050b5a373b2e0369f2a4ed224c62de9e1a77bd8e8a86aec219a3f0ba7d562428cc2b1efa63a4c1cc79625cc6807bbc
data/README.markdown CHANGED
@@ -16,7 +16,7 @@ API wrapper для Ozon.Logistics [API](https://api-stg.ozonru.me/principal-inte
16
16
 
17
17
  Затем:
18
18
 
19
- rails g ozon-logistics:install
19
+ rails g ozon_logistics:install
20
20
 
21
21
  ## Требования
22
22
 
@@ -304,4 +304,23 @@ params = {
304
304
  }
305
305
  response = OzonLogistics::Request.tracking.article.retrieve(params: params)
306
306
  article = response.body
307
+ ```
308
+
309
+ ### DropOff
310
+
311
+ #### Метод создания завки на отгрузк
312
+ ```ruby
313
+ body = {
314
+ "orderIds": [
315
+ 0
316
+ ]
317
+ }
318
+ response = OzonLogistics::Request.dropoff.create(body: body).body
319
+ drop_off_id = response[:id]
320
+ ```
321
+
322
+ #### Метод для для получения акта по ID заявки на отгрузку
323
+ ```ruby
324
+ response = OzonLogistics::Request.dropoff(drop_off_id).act
325
+ p response.body
307
326
  ```
@@ -4,14 +4,14 @@ OzonLogistics.setup do |config|
4
4
  if File.exist?('config/ozon_logistics.yml')
5
5
  processed = YAML.load_file('config/ozon_logistics.yml')[Rails.env]
6
6
 
7
+ processed.each do |k, v|
8
+ config::register k.underscore.to_sym, v
9
+ end
10
+
7
11
  config::Request.access_token = ENV['OZON_LOGISTICS_ACCESS_TOKEN'] || OzonLogistics.generate_access_token.try(:dig, "access_token")
8
12
  config::Request.timeout = 15
9
13
  config::Request.open_timeout = 15
10
14
  config::Request.symbolize_keys = true
11
15
  config::Request.debug = false
12
-
13
- processed.each do |k, v|
14
- config::register k.underscore.to_sym, v
15
- end
16
16
  end
17
17
  end
@@ -6,7 +6,6 @@ require 'ozon-logistics/response'
6
6
 
7
7
  module OzonLogistics
8
8
  class << self
9
-
10
9
  def generate_access_token(client_id=OzonLogistics.client_id, client_secret=OzonLogistics.client_secret, grant_type=OzonLogistics.grant_type)
11
10
  response = Faraday.post(OzonLogistics.url_token, "grant_type=#{grant_type}&client_id=#{client_id}&client_secret=#{client_secret}")
12
11
  JSON.parse(response.body)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ozon-logistics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Osetrov