buttercoin 0.0.1 → 0.0.2

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: 37d4b26bd20a48864072e98700ed55f99e47e0b2
4
- data.tar.gz: 375dd0952b314fab656284327519509f63642667
3
+ metadata.gz: 4ca69768dcaf030fefd5c5c8f72ac50343fa4fe2
4
+ data.tar.gz: f26484dffeb3b4a92c6aad1ddc82ae3d3bd40c42
5
5
  SHA512:
6
- metadata.gz: 7b38089791aa009e24142438011d7f48bd7ab3ca716fd173f5e0e05bd9348065eef5956cd9aea21068b5313dac68fcd83d3d9b91d84f2756476013ee0d080d5b
7
- data.tar.gz: 91bfdeb55d7806faf77ecb1efc8a52cd3b32ed2c2d2de1ef231f114414a0e1519a8c1c81f4abcc635b55e089dd03ee72f49455560248762338178b8f7a70f93f
6
+ metadata.gz: 2264bfe54422459eef45040dec2a5181d7a9275457df179d7aa9d9157460b42290a57067f6800b6a453304872ad79369f1c6fb292939e56f62e13a465d795cfb
7
+ data.tar.gz: b837014948655f9cfe0a2b0442860c31bc37299d964c8b8aeb8ce89d76dd2f545b18954d72f88edb18ceb5c0ac474b2601ee98f17fe715e8e685f385a0ecea6c
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ log
5
5
  *.gem
6
6
  coverage
7
7
  Gemfile.lock
8
+ *.swo
data/README.md CHANGED
@@ -28,7 +28,7 @@ In order to keep sensitive data out of your codebase, we recommend you use envir
28
28
 
29
29
  BUTTERCOIN_PUBLIC_KEY=5ti8pqwejqfcla4se1d7whydryoso5z8
30
30
  BUTTERCOIN_SECRET_KEY=JCfcasdfinmKtdHgIlwXi3SEMJoCf4Bg
31
- BUTTERCOIN_MODE=staging
31
+ BUTTERCOIN_MODE=sandbox
32
32
 
33
33
  You can also create a script to export the variables before you start your server.
34
34
 
@@ -42,13 +42,13 @@ Setting | Property Name | Description
42
42
  --- | --- | ---
43
43
  Public Key | `:public_key` | Your Buttercoin API Public Key
44
44
  Secret Key | `:secret_key` | Your Buttercoin API Secret Key
45
- Mode | `:mode` | Your development environment (default: `'production'`, set to `'staging'` to test with testnet bitcoins)
45
+ Mode | `:mode` | Your development environment (default: `'production'`, set to `'sandbox'` to test with testnet bitcoins)
46
46
 
47
47
  ###### Example
48
48
  ```ruby
49
49
  client = Buttercoin::Client.new(:public_key => '5ti8pqwejqfcla4se1d7whydryoso5z8',
50
50
  :secret_key => 'JCfcasdfinmKtdHgIlwXi3SEMJoCf4Bg',
51
- :mode => 'staging')
51
+ :mode => 'sandbox')
52
52
  ```
53
53
 
54
54
  #### Configuration can be updated to reuse the same Client:
@@ -299,4 +299,8 @@ The aim is to take your great ideas and make everyone's experience using Butterc
299
299
 
300
300
  - First release.
301
301
 
302
+ ### 0.0.2
303
+
304
+ - changed test environment to sandbox
305
+
302
306
  ## License
@@ -23,7 +23,7 @@ module Buttercoin
23
23
  }
24
24
 
25
25
  PRODUCTION_URI = 'https://api.buttercoin.com/v1'
26
- SANDBOX_URI = 'https://api.qa.dcxft.com/v1'
26
+ SANDBOX_URI = 'https://sandbox.buttercoin.com/v1'
27
27
 
28
28
  CA_CERT = 'cert/ca-cert.crt'
29
29
 
@@ -40,7 +40,7 @@ module Buttercoin
40
40
 
41
41
  self.public_key, self.secret_key = options.values_at(:public_key, :secret_key)
42
42
  self.mode = options[:mode] || CONFIG[:mode]
43
- self.class.base_uri (options[:mode] == 'production') ? PRODUCTION_URI : SANDBOX_URI
43
+ self.class.base_uri (self.mode == 'production') ? PRODUCTION_URI : SANDBOX_URI
44
44
  end
45
45
 
46
46
  # Wrappers for the main HTTP verbs
@@ -125,8 +125,6 @@ module Buttercoin
125
125
  begin
126
126
  mash = Hashie::Mash.new(JSON.parse(response_body))
127
127
  raise HttpError.new(mash.errors.first.message)
128
- rescue
129
- raise HttpError.new(response_body)
130
128
  end
131
129
  end
132
130
  end
@@ -1,3 +1,3 @@
1
1
  module Buttercoin
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -7,7 +7,7 @@ describe Buttercoin::Client do
7
7
  let(:public_key) { 'public key' }
8
8
  let(:secret_key) { 'secret key' }
9
9
  let(:mode) { 'sandbox' }
10
- let(:client) { Buttercoin::Client.new(:public_key => public_key, :secret_key => secret_key) }
10
+ let(:client) { Buttercoin::Client.new(:public_key => public_key, :secret_key => secret_key, :mode => mode) }
11
11
 
12
12
 
13
13
  before :all do
@@ -26,8 +26,8 @@ describe Buttercoin::Client do
26
26
  expect(client.mode).to eq('sandbox')
27
27
  end
28
28
 
29
- it "should set the base_uri to the sandbox" do
30
- expect(Buttercoin::Client.new.class.base_uri).to eq(Buttercoin::Client::SANDBOX_URI)
29
+ it "should default the base_uri to the production" do
30
+ expect(Buttercoin::Client.new.class.base_uri).to eq(Buttercoin::Client::PRODUCTION_URI)
31
31
  end
32
32
  end
33
33
 
@@ -38,15 +38,15 @@ describe Buttercoin::Client do
38
38
  let(:timestamp) { 1444444444444 }
39
39
  let(:path) { '/orders' }
40
40
  let(:options) do { :status => "opened" } end
41
- let(:message) { "1444444444444https://api.qa.dcxft.com/v1/orders?status=opened" }
42
- let(:signature) { "0OBOwbOX3npNPyI6TLq+PN2jpW1NhLn+St0FOpcKvMc=\n" }
41
+ let(:message) { "1444444444444https://sandbox.buttercoin.com/v1/orders?status=opened" }
42
+ let(:signature) { "SLkHo487FQg5k7hWC8GoK/Us8e51ddqKhsw7V1gMKq8=\n" }
43
43
 
44
44
  it "should build proper get request message for signing" do
45
- expect(build_message.call(:get, path, timestamp, options)).to eq("1444444444444https://api.qa.dcxft.com/v1/orders?status=opened")
45
+ expect(build_message.call(:get, path, timestamp, options)).to eq("1444444444444https://sandbox.buttercoin.com/v1/orders?status=opened")
46
46
  end
47
47
 
48
48
  it "should build proper get request message for signing" do
49
- expect(build_message.call(:post, path, timestamp, options)).to eq("1444444444444https://api.qa.dcxft.com/v1/orders{\"status\":\"opened\"}")
49
+ expect(build_message.call(:post, path, timestamp, options)).to eq("1444444444444https://sandbox.buttercoin.com/v1/orders{\"status\":\"opened\"}")
50
50
  end
51
51
 
52
52
  it "should properly sign a message with the given key" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buttercoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Adams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-10 00:00:00.000000000 Z
11
+ date: 2014-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov