bitpagos 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bitpagos.rb +1 -0
- data/lib/bitpagos/client.rb +12 -2
- data/lib/bitpagos/errors/unauthorized.rb +6 -0
- data/lib/bitpagos/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28b6e63d61b1c9c5a7ee4ae0af71787cc04c5233
|
4
|
+
data.tar.gz: 65a45c1268f73237ef29bcc3c87e517aa754a26c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adbb05cff2ec909756785fb9c64751c15d8d6b9e830d23ac4504fe75db31fcb465e8cb3bf50045dcdd3d244e4e991af8dcd0af12e59dc2ed2f55a3701d7c7171
|
7
|
+
data.tar.gz: 44e277d6710cef072251ce4836cc94c073967a83b07fa6aa5aa272edfbdb2c3552aaa63f31c458db76570a37d7f7b7542ee2f40f03152a7224bc26d4b19059b3
|
data/lib/bitpagos.rb
CHANGED
data/lib/bitpagos/client.rb
CHANGED
@@ -51,10 +51,20 @@ module Bitpagos
|
|
51
51
|
|
52
52
|
private
|
53
53
|
|
54
|
+
# Hits the Bitpagos transaction API, returns a hash with results
|
55
|
+
#
|
56
|
+
# @param [String] State (Pending, Waiting, Completed, Partially Paid)
|
57
|
+
# @param [String] Transaction ID
|
58
|
+
# @return [Hash]
|
54
59
|
def retrieve_transactions(query = nil, transaction_id = nil)
|
60
|
+
headers.merge!(params: { status: query }) if query
|
55
61
|
url = "#{API_BASE}/transaction/#{transaction_id}"
|
56
|
-
|
57
|
-
|
62
|
+
begin
|
63
|
+
response = RestClient.get(url, headers)
|
64
|
+
JSON.parse(response)
|
65
|
+
rescue RestClient::Unauthorized => error
|
66
|
+
raise Bitpagos::Errors::Unauthorized.new(error.message)
|
67
|
+
end
|
58
68
|
end
|
59
69
|
end
|
60
70
|
end
|
data/lib/bitpagos/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitpagos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mauro Otonelli
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-12-
|
12
|
+
date: 2015-12-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/bitpagos/client.rb
|
106
106
|
- lib/bitpagos/errors/generic_error.rb
|
107
107
|
- lib/bitpagos/errors/invalid_api_key.rb
|
108
|
+
- lib/bitpagos/errors/unauthorized.rb
|
108
109
|
- lib/bitpagos/version.rb
|
109
110
|
homepage: http://github.com/ombulabs/bitpagos
|
110
111
|
licenses:
|