bcash-ruby 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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f8e0061d8fdb251e5eb6505f3ad22a80e4a5db2
|
4
|
+
data.tar.gz: d70dedbd8cba1a5f304e9d9618a20c1810e148f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 987c5cd5ff478a707152f32ddf4c8b5eb75b3806c9404866032c2d36e22c30c763b54cefb64409c6e57c3e363ca1657e7cbda88a03fc5c7c8c2e8fd91e03e16b
|
7
|
+
data.tar.gz: 3f2ba02f67ca23998b0f4da87f65bc96b24ef05b7387218ed0e8104b826db95e13ea4c6cf9891df67722b5993b523c982df0a94fc26023f4d826b01d4625c20b
|
data/lib/bcash/api/accounts.rb
CHANGED
@@ -21,6 +21,11 @@ module Bcash::Api
|
|
21
21
|
legal_person.present? ? legal_person.valid? : true
|
22
22
|
end
|
23
23
|
|
24
|
+
def errors_full_messages
|
25
|
+
errors.full_messages + address.errors.full_messages + owner.errors.full_messages +
|
26
|
+
contact.errors.full_messages
|
27
|
+
end
|
28
|
+
|
24
29
|
def attributes
|
25
30
|
{ 'owner' => owner, 'legalPerson' => legal_person, 'address' => address, 'contact' => contact, 'url' => url, 'transactionMode' => transaction_mode }
|
26
31
|
end
|
data/lib/bcash/api.rb
CHANGED
@@ -2,6 +2,7 @@ module Bcash::Api
|
|
2
2
|
autoload :Accounts, 'bcash/api/accounts'
|
3
3
|
autoload :Response, 'bcash/api/response'
|
4
4
|
autoload :AccountResponse, 'bcash/api/account_response'
|
5
|
+
autoload :AccountNotValidResponse, 'bcash/api/account_not_valid_response'
|
5
6
|
|
6
7
|
autoload :BaseRequest, 'bcash/api/request/base_request'
|
7
8
|
autoload :AddressRequest, 'bcash/api/request/address_request'
|
data/lib/bcash/version.rb
CHANGED
@@ -101,14 +101,18 @@ describe Bcash::Api::Accounts do
|
|
101
101
|
|
102
102
|
context 'when all required fields are missing' do
|
103
103
|
it 'must raise error' do
|
104
|
-
|
104
|
+
response = client.create_account({})
|
105
|
+
expect(response).to_not be_success
|
106
|
+
expect(response.message).to eq(["Email can't be blank", "Gender can't be blank", "Name can't be blank", "Cpf can't be blank"])
|
105
107
|
end
|
106
108
|
end
|
107
109
|
|
108
110
|
context 'when cpf is missing' do
|
109
111
|
it 'must raise error' do
|
110
112
|
data[:owner].delete(:cpf)
|
111
|
-
|
113
|
+
response = client.create_account(data)
|
114
|
+
expect(response).to_not be_success
|
115
|
+
expect(response.message).to eq(["Cpf can't be blank"])
|
112
116
|
end
|
113
117
|
end
|
114
118
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bcash-ruby
|
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
|
- Raphael Costa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- bcash-ruby.gemspec
|
185
185
|
- lib/bcash.rb
|
186
186
|
- lib/bcash/api.rb
|
187
|
+
- lib/bcash/api/account_not_valid_response.rb
|
187
188
|
- lib/bcash/api/account_response.rb
|
188
189
|
- lib/bcash/api/accounts.rb
|
189
190
|
- lib/bcash/api/request/account_creation_request.rb
|