invoiced 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
  SHA1:
3
- metadata.gz: cc194f9f859feabac87cb4221ba885b044186904
4
- data.tar.gz: e97ae96cbecb71e659c1c225acd705032ca8e2cf
3
+ metadata.gz: 39b105b4b640babd40cde28a5f86ebe06fcd437c
4
+ data.tar.gz: 22171d541dec5d633d7c3c641b3fbc41709a43b1
5
5
  SHA512:
6
- metadata.gz: 2b3ffe7b5e73a88dc759458614f13aad31b9d322b8bc11d20f88dda22f43df6b70114197572e78356a419bbf0a0be8d7ddc8f8fd928c4bd2e2b11330c3aa5e03
7
- data.tar.gz: 98f497695139a6c389ff31d221eb12911989522ff63fa44ea4c61eef1180bd61124c67e9f6e5fc2842f97aaaceb4f7c0a1b20361107248ec35338b2e6bf49c90
6
+ metadata.gz: c84fb6ea8cb08d14dcc24f43ba274da7cac2e62a9e31ceba5221c2c63e2d05b014107ab7002945f0462ce1b1039e4561c381e23167615533c741ea13dc1a4ce8
7
+ data.tar.gz: 294e2408c6bc316d5dd7848fe9ca2d2fba35bc576971555f144348f3c847ce5f1e43a04f6c7cce10ebdb145a5c58f21f89a31db44579ec1eeabd732551b605b7
data/README.md CHANGED
@@ -36,8 +36,10 @@ invoiced = Invoiced::Client.new("{API_KEY}")
36
36
 
37
37
  Then, API calls can be made like this:
38
38
  ```ruby
39
+ # retrieve invoice
39
40
  invoice = invoiced.Invoice.retrieve("{INVOICE_ID}")
40
41
 
42
+ # mark as paid
41
43
  transaction = invoiced.Transaction.create(
42
44
  :invoice => invoice.id,
43
45
  :amount => invoice.balance,
@@ -1,3 +1,3 @@
1
1
  module Invoiced
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
data/lib/invoiced.rb CHANGED
@@ -53,11 +53,13 @@ module Invoiced
53
53
  end
54
54
 
55
55
  def request(method, endpoint, params={})
56
- url = ApiBase + endpoint
56
+ url = ApiBase + endpoint + "?envelope=0"
57
57
 
58
58
  case method.to_s.downcase.to_sym
59
59
  # These methods don't have a request body
60
60
  when :get, :head, :delete
61
+ # Make params into GET parameters
62
+ url += "#{URI.parse(url).query ? '&' : '?'}#{Util.uri_encode(params)}" if params && params.any?
61
63
  payload = nil
62
64
  # Otherwise, encode request body to JSON
63
65
  else
@@ -74,7 +76,7 @@ module Invoiced
74
76
  :user_agent => "Invoiced Ruby/#{Invoiced::VERSION}",
75
77
  # pass in query parameters here due
76
78
  # to an eccentricity in the rest-client gem
77
- :params => params.merge({:envelope => '0'})
79
+ # :params => params.merge({:envelope => '0'})
78
80
  },
79
81
  payload: payload
80
82
  )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: invoiced
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
  - Jared King
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-27 00:00:00.000000000 Z
11
+ date: 2015-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client