bitpay-sdk 2.4.1 → 2.4.2

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: 6a0b02cec388fe32a5afd21b0a9ad92340818107
4
- data.tar.gz: d539b63ee8a0dca065562a5a5ebb6f539fb8d240
3
+ metadata.gz: 23d0eaf35772b8730fa1fa237052df27ac12c91c
4
+ data.tar.gz: 5d5c43a56d3302bf6e9b39826f6bd4c2eb28b57f
5
5
  SHA512:
6
- metadata.gz: 4fd3cb6688d3ba5387fccdf67c0cd9f044e7e5fd8978147d3d024831f2dc657ae751afd961418bc3cbfa35992438281bbc624e961bb88b5455cb72e8f55f9769
7
- data.tar.gz: ad97799266a00b43413ccb956296ce27121a55201e7d8d7fdff1a4d3bb5295c35898ca56a65145c143f329820df1a3e180f25ad414e3e821a421248feb74a753
6
+ metadata.gz: d98a7d9382a372c1724cf595297bc6212c46a5ad6d188c299cbf2e6831172a9a12d78a9ea4bcc8100910c8dc22b858c86590b6f7c0889a07ebceaa0812ea5091
7
+ data.tar.gz: 11d777f508beea52465341d1d4904d2c43a5d0cc8a39d8f5febf880d48c7fa7901d16b6a9f5f093b42f4356698d6910acffc1c7c829339097e4de3d36852ebbf
@@ -2,6 +2,10 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [2.4.2] - 2015-03-11
6
+ ### Fixed
7
+ - GitHub issue 39: handling post paths that include a ? and require a token. A workaround exists for this issue.
8
+
5
9
  ## [2.4.1] - 2015-03-11
6
10
  ### Fixed
7
11
  - GitHub issue 40: error for endpoints that did not return a 'data' field
@@ -18,7 +18,8 @@ module BitPay
18
18
 
19
19
  def get(path:, token: nil, public: false)
20
20
  urlpath = '/' + path
21
- urlpath = urlpath + '?token=' + token if token
21
+ token_prefix = if urlpath.include? '?' then '&token=' else '?token=' end
22
+ urlpath = urlpath + token_prefix + token if token
22
23
  request = Net::HTTP::Get.new urlpath
23
24
  unless public
24
25
  request['X-Signature'] = KeyUtils.sign(@uri.to_s + urlpath, @priv_key)
@@ -3,5 +3,5 @@
3
3
  # or https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
4
4
 
5
5
  module BitPay
6
- VERSION = '2.4.1'
6
+ VERSION = '2.4.2'
7
7
  end
@@ -61,6 +61,13 @@ describe BitPay::SDK::Client do
61
61
  bitpay_client.send_request("GET", "whatever", facade: "merchant")
62
62
  expect(WebMock).to have_requested(:get, "#{BitPay::TEST_API_URI}/whatever?token=MERCHANT_TOKEN")
63
63
  end
64
+
65
+ it 'should handle query parameters gracefully' do
66
+ stub_request(:get, /#{BitPay::TEST_API_URI}\/ledgers.*/).to_return(:body => '{"awesome": "json"}')
67
+ bitpay_client.send_request("GET", "ledgers/BTC?startDate=2015-01-01&endDate=2015-02-01", facade: "merchant")
68
+ expect(WebMock).to have_requested(:get, "#{BitPay::TEST_API_URI}/ledgers/BTC?startDate=2015-01-01&endDate=2015-02-01&token=MERCHANT_TOKEN")
69
+ end
70
+
64
71
  end
65
72
 
66
73
  context "POST" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitpay-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bitpay, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
11
+ date: 2015-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -221,7 +221,6 @@ files:
221
221
  - LICENSE.md
222
222
  - README.md
223
223
  - Rakefile
224
- - bitpay-sdk-2.4.0.gem
225
224
  - bitpay-sdk.gemspec
226
225
  - config/capybara.rb
227
226
  - config/constants.rb
Binary file