gocoin 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -32
- data/VERSION +1 -1
- data/history.md +7 -0
- data/lib/gocoin/api/merchants/currency_conversions.rb +0 -10
- data/lib/gocoin/api/merchants/payouts.rb +0 -10
- data/lib/gocoin/version.rb +1 -1
- data/spec/gocoin/api/merchants/currency_conversions_spec.rb +0 -8
- data/spec/gocoin/api/merchants/payouts_spec.rb +0 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a152b7a8a1c7e064060559e7b8a6db907dc6d8b
|
4
|
+
data.tar.gz: a872f3d1ae7c5a4dc44f2cadd7ca014730cbaa5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 744d175663553ebdad11c42a35a1320c91442019ac32519fc1da00422132551df593bd177bb05a4066b3f530d36ca498416d1ab4403c2a48366299c42592ece9
|
7
|
+
data.tar.gz: 73201092c45f9ea43f747aa2f3d210ffced38df3b0493c6d3f61d04c90065a10b4912819eaa0b75db5267e5157ab9d40ffe304e00b69542ebba72d43af676188
|
data/README.md
CHANGED
@@ -2,9 +2,6 @@
|
|
2
2
|
|
3
3
|
A Ruby gem for the GoCoin API.
|
4
4
|
|
5
|
-
#### NOTICE:
|
6
|
-
This code is highly experimental. If you are interested in GoCoin, please contact kevin@gocoin.com
|
7
|
-
|
8
5
|
## Installation
|
9
6
|
|
10
7
|
``` ruby
|
@@ -39,18 +36,21 @@ gocoin_client.auth.construct_code_url(
|
|
39
36
|
)
|
40
37
|
```
|
41
38
|
|
39
|
+
You then need to either use an HTTP client to GET the URL returned by construct_code_url or paste it into your browser and manually copy the RETURNED_CODE in the redirect (see below).
|
40
|
+
|
42
41
|
The redirect will return the code as a parameter in the URL. For example:
|
43
42
|
https://myapp.com?code=RETURNED_CODE&state=state_token_you_provide
|
43
|
+
|
44
44
|
Call Client#authenticate with the code as a parameter to retrieve a persistent token with the requests grant permissions.
|
45
45
|
|
46
46
|
``` ruby
|
47
47
|
token = gocoin_client.authenticate( code: CODE )
|
48
48
|
gocoin_client.token = token[:access_token]
|
49
49
|
```
|
50
|
-
Note that token[:access_token] should be stored in your app if you wish to avoid the authentication procedure each time the app is used.
|
50
|
+
Note that token[:access_token] should be stored in your app if you wish to avoid the authentication procedure each time the app is used. Once you have a valid access token, you can make all of the following API calls.
|
51
51
|
|
52
52
|
|
53
|
-
#### Retrieve user data
|
53
|
+
#### Retrieve user data
|
54
54
|
|
55
55
|
``` ruby
|
56
56
|
# Gocoin::User#self()
|
@@ -61,7 +61,7 @@ user_self = gocoin_client.user.self
|
|
61
61
|
same_user = gocoin_client.user.get(user_self[:id])
|
62
62
|
```
|
63
63
|
|
64
|
-
#### Update user data
|
64
|
+
#### Update user data
|
65
65
|
|
66
66
|
``` ruby
|
67
67
|
# Gocoin::User#update(id, params = {})
|
@@ -149,7 +149,7 @@ created_invoice = gocoin_client.invoices.create( merchant_id,
|
|
149
149
|
)
|
150
150
|
```
|
151
151
|
|
152
|
-
#### Retrieve invoices
|
152
|
+
#### Retrieve invoices
|
153
153
|
|
154
154
|
``` ruby
|
155
155
|
# Gocoin::Invoices#get(id)
|
@@ -166,18 +166,7 @@ searched_invoices = gocoin_client.invoices.search(
|
|
166
166
|
)
|
167
167
|
```
|
168
168
|
|
169
|
-
####
|
170
|
-
|
171
|
-
``` ruby
|
172
|
-
# Gocoin::Merchant::Payouts#request(merchant_id, params)
|
173
|
-
# Requires merchant_read_write privilege
|
174
|
-
requested_payout = gocoin_client.merchant.payouts.request( merchant_id,
|
175
|
-
currency_code: "BTC",
|
176
|
-
amount: 10
|
177
|
-
)
|
178
|
-
```
|
179
|
-
|
180
|
-
#### Retrieve existing payout requests
|
169
|
+
#### Retrieve existing payout details
|
181
170
|
|
182
171
|
``` ruby
|
183
172
|
# Gocoin::Merchant::Payouts#get(merchant_id, payout_id)
|
@@ -191,19 +180,7 @@ existing_payout = gocoin_client.merchant.payouts.get( merchant_id, payout_id )
|
|
191
180
|
existing_payouts = gocoin_client.merchant.payouts.list( merchant_id )
|
192
181
|
```
|
193
182
|
|
194
|
-
####
|
195
|
-
|
196
|
-
``` ruby
|
197
|
-
# Gocoin::Merchant::CurrencyConversions#request(merchant_id, params)
|
198
|
-
# Requires merchant_read_write privilege
|
199
|
-
requested_currency_conversion = gocoin_client.merchant.currency_conversions.request( merchant_id,
|
200
|
-
base_currency: "BTC",
|
201
|
-
base_currency_amount: 10,
|
202
|
-
final_currency: "USD"
|
203
|
-
)
|
204
|
-
```
|
205
|
-
|
206
|
-
#### Retrieve existing currency conversion requests
|
183
|
+
#### Retrieve existing currency conversion details
|
207
184
|
|
208
185
|
``` ruby
|
209
186
|
# Gocoin::Merchant::CurrencyConversions#get(merchant_id, currency_conversion_id)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/history.md
CHANGED
@@ -19,3 +19,10 @@ Added methods:
|
|
19
19
|
* client.merchant.payouts.get
|
20
20
|
* client.merchant.payouts.list
|
21
21
|
* client.merchant.payouts.request
|
22
|
+
|
23
|
+
###### v0.1.3:
|
24
|
+
Enhanced README documentation. <br>
|
25
|
+
|
26
|
+
Removed methods:
|
27
|
+
* client.merchant.currency_conversions.request
|
28
|
+
* client.merchant.payouts.request
|
@@ -20,16 +20,6 @@ module Gocoin
|
|
20
20
|
@api.request route, options
|
21
21
|
end
|
22
22
|
|
23
|
-
def request(merchant_id, params)
|
24
|
-
@api.client.logger.debug 'Gocoin::Merchants::CurrencyConversion#request called.'
|
25
|
-
route = "/merchants/#{merchant_id}/currency_conversions"
|
26
|
-
options = {
|
27
|
-
method: 'POST',
|
28
|
-
payload: params
|
29
|
-
}
|
30
|
-
@api.request route, options
|
31
|
-
end
|
32
|
-
|
33
23
|
end
|
34
24
|
end
|
35
25
|
end
|
@@ -20,16 +20,6 @@ module Gocoin
|
|
20
20
|
@api.request route, options
|
21
21
|
end
|
22
22
|
|
23
|
-
def request(merchant_id, params)
|
24
|
-
@api.client.logger.debug 'Gocoin::Merchants::Payouts#request called.'
|
25
|
-
route = "/merchants/#{merchant_id}/payouts"
|
26
|
-
options = {
|
27
|
-
method: 'POST',
|
28
|
-
payload: params
|
29
|
-
}
|
30
|
-
@api.request route, options
|
31
|
-
end
|
32
|
-
|
33
23
|
end
|
34
24
|
end
|
35
25
|
end
|
data/lib/gocoin/version.rb
CHANGED
@@ -44,14 +44,6 @@ describe Gocoin::Merchants::CurrencyConversions do
|
|
44
44
|
|
45
45
|
end
|
46
46
|
|
47
|
-
describe "'request' method" do
|
48
|
-
|
49
|
-
it 'should return the correct result' do
|
50
|
-
@currency_conversions.request(@merchant_id, @request_params).should == @request_api_return_hash
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
47
|
describe "'list' method" do
|
56
48
|
|
57
49
|
it 'should return the correct result' do
|
@@ -44,14 +44,6 @@ describe Gocoin::Merchants::Payouts do
|
|
44
44
|
|
45
45
|
end
|
46
46
|
|
47
|
-
describe "'request' method" do
|
48
|
-
|
49
|
-
it 'should return the correct result' do
|
50
|
-
@payouts.request(@merchant_id, @request_params).should == @request_api_return_hash
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
47
|
describe "'list' method" do
|
56
48
|
|
57
49
|
it 'should return the correct result' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gocoin
|
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
|
- GoCoin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|