openpay 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/openpay/errors/openpay_exception_factory.rb +6 -2
- data/lib/openpay/utils/search_params.rb +1 -0
- data/lib/version.rb +1 -3
- data/test/spec/requesttimeout_spec.rb +5 -23
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23388a3e6c33cde8c41a8a69055a5eec2bb37ccb
|
4
|
+
data.tar.gz: e71536fe4278baec59d2e892e4ebfd37acd09ecc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ca520e2620859d865ad0280c78ed5b24684d2d3e6307b085b964bfe9261c7b7c3ee8e29de9487b08004e231939ab8205cd8278d6a3528848b067cd88422c734
|
7
|
+
data.tar.gz: a9f353af0a9f28b02f9e1cd9f48eadcf71fafdf67d57517a87fb2ce6ddcac37131463c85386244f223721dc06a2925b21de2d98bf1458d9417cdce92cb522d2f
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
##Description
|
8
8
|
|
9
|
-
ruby client for *Openpay api* services (version 1.0.
|
9
|
+
ruby client for *Openpay api* services (version 1.0.6)
|
10
10
|
|
11
11
|
This is a ruby client implementing the payment services for *Openpay* at openpay.mx
|
12
12
|
|
@@ -767,7 +767,7 @@ In the Openpay dashboard you are able to see every request and its corresponding
|
|
767
767
|
|
768
768
|
- bank accounts for merchant cannot be created using the api. It should be done through the dashboard.
|
769
769
|
- Is recommended to reset your account using the dashboard when running serious testing (assure clean state)
|
770
|
-
- check
|
770
|
+
- check openpay_api.rb for Logger configuration
|
771
771
|
- travis https://travis-ci.org/open-pay/openpay-ruby , if a test fails it will leave leave some records, it may affect posterior tests.
|
772
772
|
it is recommended to reset the console/account to assure a clean state after a failure occurs.
|
773
773
|
|
@@ -34,8 +34,12 @@ class OpenpayExceptionFactory
|
|
34
34
|
raise oe
|
35
35
|
|
36
36
|
when RestClient::Exception , RestClient::InternalServerError
|
37
|
-
|
38
|
-
|
37
|
+
LOG.warn exception
|
38
|
+
if exception.http_body
|
39
|
+
oe=OpenpayException.new exception.http_body
|
40
|
+
else
|
41
|
+
oe=OpenpayException.new(exception.message, false)
|
42
|
+
end
|
39
43
|
@errors=true
|
40
44
|
raise oe
|
41
45
|
else
|
data/lib/version.rb
CHANGED
@@ -1,38 +1,20 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe 'Request timeout exception' do
|
5
5
|
|
6
|
-
#bankaccounts for merchant cannot be created using the api
|
7
|
-
#the merchant bank account should be created using the Openpay dashboard
|
8
6
|
before(:all) do
|
9
7
|
|
10
8
|
@merchant_id='mywvupjjs9xdnryxtplq'
|
11
9
|
@private_key='sk_92b25d3baec149e6b428d81abfe37006'
|
12
10
|
|
13
|
-
@openpay=OpenpayApi.new(@merchant_id, @private_key, false,
|
14
|
-
@
|
15
|
-
@customers=@openpay.create(:customers)
|
11
|
+
@openpay=OpenpayApi.new(@merchant_id, @private_key, false, 0)
|
12
|
+
@charges=@openpay.create(:charges)
|
16
13
|
|
17
14
|
end
|
18
15
|
|
19
|
-
|
20
|
-
|
21
|
-
it 'get a given bank account for a given customer' do
|
22
|
-
|
23
|
-
customer_hash= FactoryGirl.build(:customer)
|
24
|
-
customer=@customers.create(customer_hash)
|
25
|
-
|
26
|
-
account_hash=FactoryGirl.build(:bank_account)
|
27
|
-
bank=@bank_accounts.create(account_hash, customer['id'])
|
28
|
-
|
29
|
-
bank_account=@bank_accounts.get(customer['id'], bank['id'])
|
30
|
-
expect(bank_account['alias']).to match 'Cuenta principal'
|
31
|
-
@bank_accounts.delete(customer['id'], bank['id'])
|
32
|
-
@customers.delete(customer['id'])
|
33
|
-
|
34
|
-
end
|
35
|
-
|
16
|
+
it 'raise a OpenpayException when the operation timeouts' do
|
17
|
+
expect{@charges.all}.to raise_error(OpenpayException)
|
36
18
|
end
|
37
19
|
|
38
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronnie_bermejo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
176
|
rubyforge_project:
|
177
|
-
rubygems_version: 2.0.
|
177
|
+
rubygems_version: 2.0.6
|
178
178
|
signing_key:
|
179
179
|
specification_version: 4
|
180
180
|
summary: ruby api for openpay resources
|