cloverrb 0.2.2 → 0.2.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
  SHA1:
3
- metadata.gz: 467c8096a54934388d85d563e7a81c4f327508a7
4
- data.tar.gz: bec10016d7238931f4d4f5637ad8437a3fbbc37e
3
+ metadata.gz: 9c889c66f8d40db2d68185cf560e8cc2b3b68ac1
4
+ data.tar.gz: 3382c170ac5f1d3da11f4491babfb14a31f00c84
5
5
  SHA512:
6
- metadata.gz: 3cc7d1fd0b7a070cc1b3843126044a0269de89e964ee9a36ef244d580172695213757fbd5682b9cb9e5f76c0538b69314e294ab727ba2e62c3231b880321d7ee
7
- data.tar.gz: 583632d2b7209e7b45a6a8d40a676da387e0f16e56b72f882f100fa544b32b3e3f7a77e3e0ba62de09184b21be8cda4cad91426931193869e8836b2a44a67a7b
6
+ metadata.gz: 69f8e243149891d700e2324597442635674d1d2490a9b04ce761d98bde0c8d165851d4b240fe6d9313e92ea315a62f320a70bfeedb7da3641c7134d45e6ef040
7
+ data.tar.gz: 733b8b291c0ef0bdecaf95ae4f018809ab2b0001919361e07731c1604dfa0bd59a4b958e0f71cdbe0c80976bb93b2b605e9638905510de7529c6939e9ea53887
@@ -1,15 +1,15 @@
1
1
  module Cloverrb
2
2
  class Client
3
- BASE_URL = "https://api.clover.com/v3"
3
+ @base_url = "https://api.clover.com/v3"
4
4
  AUTH_URL = "https://clover.com/oauth/token"
5
5
 
6
6
  def get(token, path)
7
- HTTParty.get(BASE_URL + path, headers: build_headers(token)).parsed_response
7
+ HTTParty.get(@base_url + path, headers: build_headers(token)).parsed_response
8
8
  end
9
9
 
10
10
  def post(token, path, body)
11
11
  HTTParty.post(
12
- BASE_URL + path,
12
+ @base_url + path,
13
13
  headers: build_headers(token),
14
14
  query: body
15
15
  ).parsed_response
@@ -17,7 +17,7 @@ module Cloverrb
17
17
 
18
18
  def put(token, path, body)
19
19
  HTTParty.put(
20
- BASE_URL + path,
20
+ @base_url + path,
21
21
  headers: build_headers(token),
22
22
  query: body
23
23
  ).parsed_response
@@ -1,9 +1,10 @@
1
1
  module Cloverrb
2
2
  class LineItem < Client
3
- def initialize(token, order, merchant)
3
+ def initialize(token, order, merchant, sandbox=false)
4
4
  @token = token
5
5
  @order = order
6
6
  @merchant = merchant
7
+ @base_url = "https://apisandbox.dev.clover.com/v3" if sandbox
7
8
  end
8
9
 
9
10
  def all
@@ -1,7 +1,8 @@
1
1
  module Cloverrb
2
2
  class Order < Client
3
- def initialize(token)
3
+ def initialize(token, sandbox=false)
4
4
  @token = token
5
+ @base_url = "https://apisandbox.dev.clover.com/v3" if sandbox
5
6
  end
6
7
 
7
8
  def all(merchant_id, options = {})
@@ -1,3 +1,3 @@
1
1
  module Cloverrb
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloverrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Jon Villalobos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-18 00:00:00.000000000 Z
11
+ date: 2017-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler