jemquarie 1.2.6 → 1.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jemquarie/importer.rb +0 -9
- data/lib/jemquarie/version.rb +1 -1
- data/spec/lib/importer_spec.rb +0 -18
- 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: a7b19596dfb67404c7c46c93735edc8ee60109c5
|
4
|
+
data.tar.gz: 80d91c07b02234810d80dcc3ddebff308a5c89be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95e6b88584821f22b2e069586f84618d696388e08b3cb1900e3d32b9f492da5e754afd76791b8bcb72737924534ffde45ce2a0fb920f69df34f52c66ee675b6c
|
7
|
+
data.tar.gz: 392714c0d2b0422b330e3e8361bf349565370e5f9fbb9066ccee80fd63c39762e576fef4067cfe4c01e7f990c95cd914b3aca2159b8f8690848cdc0975084f19
|
data/lib/jemquarie/importer.rb
CHANGED
@@ -5,15 +5,6 @@ module Jemquarie
|
|
5
5
|
include Parser::CashTransactions
|
6
6
|
|
7
7
|
def cash_transactions(date_from = (Date.today - 1.day), date_to = Date.today, account_number = '', include_closed = 'Y')
|
8
|
-
if account_number.blank?
|
9
|
-
if (date_to && date_from)
|
10
|
-
if (date_to - date_from).days > 2.days # With no account_number you can only get 2 days
|
11
|
-
return {:error => "Cannot request more than 2 days of transactions if not account is specified"}
|
12
|
-
end
|
13
|
-
else # With no account_number you need dates
|
14
|
-
return {:error => "Missing from and to dates"}
|
15
|
-
end
|
16
|
-
end
|
17
8
|
response = @client.call(:generate_xml_extract, :message => create_message(date_from, date_to, account_number, include_closed))
|
18
9
|
return parse_cash_transactions_response(response) if response.success?
|
19
10
|
{:error => "An error has occured, please try again later"}
|
data/lib/jemquarie/version.rb
CHANGED
data/spec/lib/importer_spec.rb
CHANGED
@@ -89,18 +89,6 @@ describe Jemquarie::Importer do
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
describe "do not allow more than 2 days without an account number" do
|
93
|
-
let(:importer) do
|
94
|
-
Jemquarie::Importer.new('valid_code', 'valid_password')
|
95
|
-
end
|
96
|
-
before(:each) do
|
97
|
-
@result = importer.cash_transactions((Date.today - 3.days), Date.today)
|
98
|
-
end
|
99
|
-
it "should stop the request" do
|
100
|
-
expect(@result).to be_kind_of Hash
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
92
|
describe "non auth" do
|
105
93
|
let(:importer) do
|
106
94
|
Jemquarie::Importer.new('invalid_code', 'or_invalid_password')
|
@@ -162,12 +150,6 @@ describe Jemquarie::Importer do
|
|
162
150
|
content_type: 'text/xml'
|
163
151
|
)
|
164
152
|
end
|
165
|
-
it "should return error when trying to get transactions with no date and no account" do
|
166
|
-
@result = importer.cash_transactions(nil, nil, nil)
|
167
|
-
expect(@result).to be_kind_of Hash
|
168
|
-
expect(@result[:error]).to eq("Missing from and to dates")
|
169
|
-
end
|
170
|
-
|
171
153
|
it "should accept parameters with account number but no date parameters without error" do
|
172
154
|
@result = importer.cash_transactions(nil, nil, '12345')
|
173
155
|
expect(@result).to be_kind_of Array
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jemquarie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Contin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|