bitpay-client 0.1.2 → 0.1.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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +2 -2
- data/README.md +3 -3
- data/Rakefile +1 -0
- data/bitpay-client.gemspec +2 -2
- data/lib/bitpay.rb +3 -4
- data/lib/bitpay/cacert.pem +3866 -0
- data/lib/bitpay/client.rb +8 -2
- data/lib/bitpay/version.rb +1 -1
- metadata +22 -23
- data/lib/bitpay/data/cert.pem +0 -15
data/lib/bitpay/client.rb
CHANGED
@@ -22,8 +22,12 @@ module BitPay
|
|
22
22
|
@uri = URI.parse opts[:api_uri] || API_URI
|
23
23
|
@https = Net::HTTP.new @uri.host, @uri.port
|
24
24
|
@https.use_ssl = true
|
25
|
-
@https.
|
26
|
-
|
25
|
+
@https.ca_file = CA_FILE
|
26
|
+
|
27
|
+
|
28
|
+
# Option to disable certificate validation in extraordinary circumstance. NOT recommended for production use
|
29
|
+
@https.verify_mode = opts[:insecure] == true ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER
|
30
|
+
|
27
31
|
end
|
28
32
|
|
29
33
|
# Makes a GET call to the BitPay API.
|
@@ -46,10 +50,12 @@ module BitPay
|
|
46
50
|
# # Create an invoice:
|
47
51
|
# created_invoice = client.post 'invoice', {:price => 1.45, :currency => 'BTC'}
|
48
52
|
def post(path, params={})
|
53
|
+
|
49
54
|
request = Net::HTTP::Post.new @uri.path+'/'+path
|
50
55
|
request.basic_auth @api_key, ''
|
51
56
|
request['User-Agent'] = USER_AGENT
|
52
57
|
request['Content-Type'] = 'application/json'
|
58
|
+
request['X-BitPay-Plugin-Info'] = 'Rubylib' + VERSION
|
53
59
|
request.body = params.to_json
|
54
60
|
response = @https.request request
|
55
61
|
JSON.parse response.body
|
data/lib/bitpay/version.rb
CHANGED
metadata
CHANGED
@@ -1,117 +1,116 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitpay-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Bitpay, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: yard
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: Powerful, flexible, lightweight, thread-safe interface to the BitPay
|
98
98
|
developers API
|
99
|
-
email:
|
100
|
-
- kyle@bitpay.com
|
99
|
+
email: info@bitpay.com
|
101
100
|
executables: []
|
102
101
|
extensions: []
|
103
102
|
extra_rdoc_files: []
|
104
103
|
files:
|
105
|
-
- .gitignore
|
106
|
-
- .travis.yml
|
104
|
+
- ".gitignore"
|
105
|
+
- ".travis.yml"
|
107
106
|
- Gemfile
|
108
107
|
- LICENSE.md
|
109
108
|
- README.md
|
110
109
|
- Rakefile
|
111
110
|
- bitpay-client.gemspec
|
112
111
|
- lib/bitpay.rb
|
112
|
+
- lib/bitpay/cacert.pem
|
113
113
|
- lib/bitpay/client.rb
|
114
|
-
- lib/bitpay/data/cert.pem
|
115
114
|
- lib/bitpay/version.rb
|
116
115
|
- test/bitpay/client_test.rb
|
117
116
|
- test/env.rb
|
@@ -124,17 +123,17 @@ require_paths:
|
|
124
123
|
- lib
|
125
124
|
required_ruby_version: !ruby/object:Gem::Requirement
|
126
125
|
requirements:
|
127
|
-
- -
|
126
|
+
- - ">="
|
128
127
|
- !ruby/object:Gem::Version
|
129
128
|
version: '0'
|
130
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
130
|
requirements:
|
132
|
-
- -
|
131
|
+
- - ">="
|
133
132
|
- !ruby/object:Gem::Version
|
134
133
|
version: 1.3.4
|
135
134
|
requirements: []
|
136
135
|
rubyforge_project: bitpay-client
|
137
|
-
rubygems_version: 2.0
|
136
|
+
rubygems_version: 2.3.0
|
138
137
|
signing_key:
|
139
138
|
specification_version: 4
|
140
139
|
summary: Official ruby client library for the BitPay API
|
data/lib/bitpay/data/cert.pem
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIICWDCCAcGgAwIBAgIJAP4dy3lMOd97MA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
|
3
|
-
BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
|
4
|
-
aWRnaXRzIFB0eSBMdGQwHhcNMTEwODE1MTUxMDU2WhcNMjEwODEyMTUxMDU2WjBF
|
5
|
-
MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50
|
6
|
-
ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
|
7
|
-
gQDZ92nLT7OmfKJPIWzpNDc4gbUmUhBzHKG5aLaXpDZtvyqaMH2lUzGjIxY8taKS
|
8
|
-
Q8gvzLnIDuZJ6+99e7OlX9w5In5x1B2tVrwCXZo9ZUIy7a34ULQYxRhI5ZzCKtsC
|
9
|
-
O84fakQfNgKfkjlqUBr6ksK7IusftPwc7UHEPWSJfaakCQIDAQABo1AwTjAdBgNV
|
10
|
-
HQ4EFgQUfubRYcwiDLT98VoHiVXcGlXXAMAwHwYDVR0jBBgwFoAUfubRYcwiDLT9
|
11
|
-
8VoHiVXcGlXXAMAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCruca0
|
12
|
-
pys5xJ3l4qts/gBxpAuW3Yx6Jkrr35ertgj108SIN+O5uBCu+/AZfTJArVSdh+Zn
|
13
|
-
ML6zF2T5E5ho7T/UHUXUW6hf5uCJVbRusx73pw4Hh1yE0x/+1Rwnf9uDD2gIeL2W
|
14
|
-
3u6e+8/ladZJtplIYvCK031MxAwO4s2LMznpTQ==
|
15
|
-
-----END CERTIFICATE-----
|