bsale_api 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 06fe73e2d341e9125d5139c5355e4f83a0e79d3f
4
- data.tar.gz: 90ef8a51c059e5bd415cb62a9e1fe8fd4921477a
3
+ metadata.gz: 873f2f00f8e5b57d1e5e1ae4cef5e28c20f77554
4
+ data.tar.gz: e46caba418b3f200e217ee9c87092eb6291d6dd2
5
5
  SHA512:
6
- metadata.gz: 2cbf8a1366ba4b360ba1c12bd92c63eb3e9973466cd79b254ebef0aa45c20533d6bff570b026820edceb02d90580d0f54051abca456cbdbb2ac8601127dd35a8
7
- data.tar.gz: 30ac22d783e6be89ccb92d7c8d9158706baf5e96656ae3b392e80ed679a20479d072d31612771d5028bff818394637c3fc729075d27236cd7c5f2542303b4d54
6
+ metadata.gz: bc43147fcd4ddab4275c5290e19be7f91786779380217278aaaeb1aeb87203752db9cd3fc2f23e5516e369330670b642360948e9b5ae75a1e5fc6f2a379071c1
7
+ data.tar.gz: e2ce9f3aa81972276b3daec31eeeaae9281c08ffd3813a611f11a6e56fe241806a05e758175fdeb1d0e6a58bf1c6cb115d552d615e235d762b8fa74ca9b4f8fb
@@ -14,9 +14,6 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/shipit-team/bsale_api"
15
15
  spec.license = "MIT"
16
16
 
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
-
20
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
18
  spec.bindir = "exe"
22
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -6,7 +6,7 @@ class BsaleApi
6
6
  include HTTParty
7
7
  base_uri 'https://api.bsale.cl'
8
8
 
9
- def initialize(version=1, extension='.json')
9
+ def initialize(version = 1, extension = '.json')
10
10
  @headers = {
11
11
  'Content-Type' => 'application/json',
12
12
  'access_token' => ENV['BSALE_TOKEN']
@@ -19,8 +19,10 @@ class BsaleApi
19
19
  self.class.get("/v#{@version}/clients#{@extension}", headers: @headers)
20
20
  end
21
21
 
22
- def document(data, parameters)
23
- self.class.send(parameters[:method].downcase, "/v#{@version}/documents#{@extension}", headers: @headers, body: data.to_json)
22
+ def document(parameters, data = {})
23
+ self.class.send(parameters[:method].downcase,
24
+ "/v#{@version}/documents#{parameters[:specific]}#{@extension}",
25
+ headers: @headers, body: data.to_json)
24
26
  end
25
27
 
26
28
  def documents
@@ -41,6 +43,10 @@ class BsaleApi
41
43
  self.class.get("/v#{@version}/offices#{@extension}", headers: @headers)
42
44
  end
43
45
 
46
+ def price_lists
47
+ self.class.get("/v#{@version}/price_lists#{@extension}", headers: @headers)
48
+ end
49
+
44
50
  def shipping(parameters, data = {})
45
51
  self.class.send(parameters[:method].downcase,
46
52
  "/v#{@version}/shippings#{parameters[:specific]}#{@extension}",
@@ -3,7 +3,7 @@ class Document
3
3
  @object = {
4
4
  documentTypeId: 22,
5
5
  officeId: 1,
6
- priceListId: 18,
6
+ priceListId: 1,
7
7
  emissionDate: 1407715200,
8
8
  expirationDate: 1407715200,
9
9
  declareSii: 1
@@ -7,7 +7,7 @@ class Shipping
7
7
  officeId: 1,
8
8
  expirationDate: 1_409_149_934,
9
9
  emissionDate: 1_409_149_934,
10
- shippingTypeId: 6,
10
+ shippingTypeId: 1,
11
11
  municipality: 'Puerto Varas',
12
12
  city: 'Puerto Varas',
13
13
  address: 'la quebrada 1005',
@@ -1,3 +1,3 @@
1
1
  class BsaleApi
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bsale_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nelson Pato Jimenez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-02-22 00:00:00.000000000 Z
12
+ date: 2017-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dotenv
@@ -103,7 +103,6 @@ executables: []
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
- - ".env"
107
106
  - ".gitignore"
108
107
  - ".rspec"
109
108
  - ".travis.yml"
data/.env DELETED
@@ -1 +0,0 @@
1
- BSALE_TOKEN=95f992cfa3cd049cc2c1fc29f496e488a67153b0