jemquarie 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +8 -3
- data/lib/jemquarie/account_details.rb +36 -0
- data/lib/jemquarie/balance.rb +36 -0
- data/lib/jemquarie/base.rb +28 -0
- data/lib/jemquarie/expiry.rb +29 -0
- data/lib/jemquarie/importer.rb +6 -23
- data/lib/jemquarie/parser/account_details.rb +46 -0
- data/lib/jemquarie/parser/balance.rb +34 -0
- data/lib/jemquarie/parser/cash_transactions.rb +2 -5
- data/lib/jemquarie/parser/expiry.rb +14 -0
- data/lib/jemquarie/parser/generic.rb +16 -0
- data/lib/jemquarie/version.rb +1 -1
- data/lib/jemquarie.rb +10 -3
- data/spec/files/account_details/details.xml +3261 -0
- data/spec/files/balance/balances.xml +662 -0
- data/spec/files/balance/error_e0009.xml +19 -0
- data/spec/files/expiry/expiry.xml +20 -0
- data/spec/lib/accont_details_spec.rb +42 -0
- data/spec/lib/balance_spec.rb +44 -0
- data/spec/lib/expiry_spec.rb +25 -0
- data/spec/lib/importer_spec.rb +6 -6
- metadata +36 -14
- /data/spec/files/{no_data.xml → transactions/no_data.xml} +0 -0
- /data/spec/files/{non_authenticated.xml → transactions/non_authenticated.xml} +0 -0
- /data/spec/files/{single_transaction.xml → transactions/single_transaction.xml} +0 -0
- /data/spec/files/{transactions.xml → transactions/transactions.xml} +0 -0
- /data/spec/files/{wrong_account_number.xml → transactions/wrong_account_number.xml} +0 -0
- /data/spec/files/{wrong_authentication.xml → transactions/wrong_authentication.xml} +0 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
2
|
+
<soapenv:Body>
|
3
|
+
<ns1:GenerateXMLExtractResponse xmlns:ns1="wrapwebservices" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
4
|
+
<result xsi:type="xsd:string"><?xml version="1.0" ?>
|
5
|
+
<XMLExtract>
|
6
|
+
<RequestDetails>
|
7
|
+
<RequestStatus>Failure</RequestStatus>
|
8
|
+
<RequestErrorNumber>E0009</RequestErrorNumber>
|
9
|
+
<RequestErrorDetails>Unable to process this request at this time</RequestErrorDetails>
|
10
|
+
</RequestDetails>
|
11
|
+
<XMLEntityDetails>
|
12
|
+
<XMLEntityName>your.clients Balances</XMLEntityName>
|
13
|
+
<XMLEntityVersion>V1.3</XMLEntityVersion>
|
14
|
+
</XMLEntityDetails>
|
15
|
+
</XMLExtract>
|
16
|
+
</result>
|
17
|
+
</ns1:GenerateXMLExtractResponse>
|
18
|
+
</soapenv:Body>
|
19
|
+
</soapenv:Envelope>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
2
|
+
<soapenv:Body>
|
3
|
+
<ns1:GenerateXMLExtractResponse xmlns:ns1="wrapwebservices" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
4
|
+
<result xsi:type="xsd:string"><?xml version="1.0" ?>
|
5
|
+
<XMLExtract>
|
6
|
+
<RequestDetails>
|
7
|
+
<RequestStatus>Success</RequestStatus>
|
8
|
+
<RequestErrorNumber></RequestErrorNumber>
|
9
|
+
<RequestErrorDetails></RequestErrorDetails>
|
10
|
+
</RequestDetails>
|
11
|
+
<XMLEntityDetails>
|
12
|
+
<XMLEntityName>Authentication Expiry</XMLEntityName>
|
13
|
+
<XMLEntityVersion>V1.0</XMLEntityVersion>
|
14
|
+
</XMLEntityDetails>
|
15
|
+
<ExpiryDate>2015-01-14 10:22:12.03</ExpiryDate>
|
16
|
+
</XMLExtract>
|
17
|
+
</result>
|
18
|
+
</ns1:GenerateXMLExtractResponse>
|
19
|
+
</soapenv:Body>
|
20
|
+
</soapenv:Envelope>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Jemquarie::AccountDetails do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
Jemquarie::Jemquarie.api_credentials("testkey", "testapp")
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "success" do
|
10
|
+
let(:importer) do
|
11
|
+
Jemquarie::AccountDetails.new('valid_code', 'valid_password')
|
12
|
+
end
|
13
|
+
before(:each) do
|
14
|
+
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
15
|
+
body: File.read('spec/files/account_details/details.xml'),
|
16
|
+
content_type: 'text/xml'
|
17
|
+
)
|
18
|
+
@result = importer.details(Date.parse("01/01/2000"), Date.today)
|
19
|
+
end
|
20
|
+
it "should work" do
|
21
|
+
expect(@result).to have(182).items
|
22
|
+
first_res = @result.first
|
23
|
+
expect(first_res[:account_number]).to eq("118115765")
|
24
|
+
expect(first_res[:account_name]).to eq("JAMES ANDREW LOCKETT")
|
25
|
+
expect(first_res[:account_short_name]).to eq("LOCKETT J A")
|
26
|
+
expect(first_res[:product]).to eq("CMH")
|
27
|
+
expect(first_res[:product_name]).to eq("CASH MANAGEMENT ACCOUNT")
|
28
|
+
expect(first_res[:address_line_1]).to eq("PO BOX 3174")
|
29
|
+
expect(first_res[:address_line_4]).to eq("MARRICKVILLE METRO")
|
30
|
+
expect(first_res[:address_line_5]).to eq("NSW")
|
31
|
+
expect(first_res[:address_line_6]).to eq("2204")
|
32
|
+
expect(first_res[:dealer_code]).to eq("0000")
|
33
|
+
expect(first_res[:adviser_code]).to eq("CASH")
|
34
|
+
expect(first_res[:account_status]).to eq("Open")
|
35
|
+
expect(first_res[:date_modified]).to eq(Time.parse("2014-05-01 01:14:27.546 UTC"))
|
36
|
+
expect(first_res[:bsb]).to eq("182222")
|
37
|
+
expect(first_res[:primary_broker_name]).to eq("MACQUARIE INVESTMENT MANAGEMENT LTD")
|
38
|
+
expect(first_res[:primary_adviser_name]).to eq("FORREST PETER MR")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Jemquarie::Balance do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
Jemquarie::Jemquarie.api_credentials("testkey", "testapp")
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "success" do
|
10
|
+
let(:importer) do
|
11
|
+
Jemquarie::Balance.new('valid_code', 'valid_password')
|
12
|
+
end
|
13
|
+
describe "xml with balances" do
|
14
|
+
before(:each) do
|
15
|
+
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
16
|
+
body: File.read('spec/files/balance/balances.xml'),
|
17
|
+
content_type: 'text/xml'
|
18
|
+
)
|
19
|
+
@result = importer.balance
|
20
|
+
end
|
21
|
+
it "should work" do
|
22
|
+
expect(@result).to have(106).items
|
23
|
+
first_result = @result.first
|
24
|
+
expect(first_result[:account_number]).to eq("118498062")
|
25
|
+
expect(first_result[:ledger_balance]).to eq("0.0000")
|
26
|
+
expect(first_result[:available_balance]).to eq("0.0000")
|
27
|
+
expect(first_result[:as_at_date]).to eq(Time.parse("2014-05-27 09:49:52.15 UTC"))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
describe "error e0009" do
|
31
|
+
before(:each) do
|
32
|
+
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
33
|
+
body: File.read('spec/files/balance/error_e0009.xml'),
|
34
|
+
content_type: 'text/xml'
|
35
|
+
)
|
36
|
+
@result = importer.balance
|
37
|
+
end
|
38
|
+
it "should work" do
|
39
|
+
expect(@result).to eq({:error => "Unable to process this request at this time"})
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Jemquarie::Expiry do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
Jemquarie::Jemquarie.api_credentials("testkey", "testapp")
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "success" do
|
10
|
+
let(:importer) do
|
11
|
+
Jemquarie::Expiry.new('valid_code', 'valid_password')
|
12
|
+
end
|
13
|
+
before(:each) do
|
14
|
+
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
15
|
+
body: File.read('spec/files/expiry/expiry.xml'),
|
16
|
+
content_type: 'text/xml'
|
17
|
+
)
|
18
|
+
@result = importer.credentials_expiry
|
19
|
+
end
|
20
|
+
it "should work" do
|
21
|
+
expect(@result).to eq(Time.parse("2015-01-14 10:22:12.03 UTC"))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/spec/lib/importer_spec.rb
CHANGED
@@ -12,7 +12,7 @@ describe Jemquarie::Importer do
|
|
12
12
|
end
|
13
13
|
before(:each) do
|
14
14
|
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
15
|
-
body: File.read('spec/files/transactions.xml'),
|
15
|
+
body: File.read('spec/files/transactions/transactions.xml'),
|
16
16
|
content_type: 'text/xml'
|
17
17
|
)
|
18
18
|
@result = importer.cash_transactions(Date.parse("01/01/2000"), Date.today, '12345')
|
@@ -45,7 +45,7 @@ describe Jemquarie::Importer do
|
|
45
45
|
end
|
46
46
|
before(:each) do
|
47
47
|
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
48
|
-
body: File.read('spec/files/single_transaction.xml'),
|
48
|
+
body: File.read('spec/files/transactions/single_transaction.xml'),
|
49
49
|
content_type: 'text/xml'
|
50
50
|
)
|
51
51
|
@result = importer.cash_transactions(Date.parse("01/01/2000"), Date.today, '12345')
|
@@ -62,7 +62,7 @@ describe Jemquarie::Importer do
|
|
62
62
|
end
|
63
63
|
before(:each) do
|
64
64
|
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
65
|
-
body: File.read('spec/files/no_data.xml'),
|
65
|
+
body: File.read('spec/files/transactions/no_data.xml'),
|
66
66
|
content_type: 'text/xml'
|
67
67
|
)
|
68
68
|
@result = importer.cash_transactions(Date.parse("01/01/2000"), Date.today, '12345')
|
@@ -91,7 +91,7 @@ describe Jemquarie::Importer do
|
|
91
91
|
end
|
92
92
|
before(:each) do
|
93
93
|
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
94
|
-
body: File.read('spec/files/non_authenticated.xml'),
|
94
|
+
body: File.read('spec/files/transactions/non_authenticated.xml'),
|
95
95
|
content_type: 'text/xml'
|
96
96
|
)
|
97
97
|
@result = importer.cash_transactions(Date.parse("01/01/2000"), Date.today, '12345')
|
@@ -108,7 +108,7 @@ describe Jemquarie::Importer do
|
|
108
108
|
end
|
109
109
|
before(:each) do
|
110
110
|
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
111
|
-
body: File.read('spec/files/wrong_authentication.xml'),
|
111
|
+
body: File.read('spec/files/transactions/wrong_authentication.xml'),
|
112
112
|
content_type: 'text/xml'
|
113
113
|
)
|
114
114
|
@result = importer.cash_transactions(Date.parse("01/01/2000"), Date.today, '12345')
|
@@ -125,7 +125,7 @@ describe Jemquarie::Importer do
|
|
125
125
|
end
|
126
126
|
before(:each) do
|
127
127
|
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
128
|
-
body: File.read('spec/files/wrong_account_number.xml'),
|
128
|
+
body: File.read('spec/files/transactions/wrong_account_number.xml'),
|
129
129
|
content_type: 'text/xml'
|
130
130
|
)
|
131
131
|
@result = importer.cash_transactions(Date.parse("01/01/2000"), Date.today, 'invalid')
|
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: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Contin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -110,16 +110,31 @@ files:
|
|
110
110
|
- Rakefile
|
111
111
|
- jemquarie.gemspec
|
112
112
|
- lib/jemquarie.rb
|
113
|
+
- lib/jemquarie/account_details.rb
|
114
|
+
- lib/jemquarie/balance.rb
|
115
|
+
- lib/jemquarie/base.rb
|
116
|
+
- lib/jemquarie/expiry.rb
|
113
117
|
- lib/jemquarie/extract.wsdl
|
114
118
|
- lib/jemquarie/importer.rb
|
119
|
+
- lib/jemquarie/parser/account_details.rb
|
120
|
+
- lib/jemquarie/parser/balance.rb
|
115
121
|
- lib/jemquarie/parser/cash_transactions.rb
|
122
|
+
- lib/jemquarie/parser/expiry.rb
|
123
|
+
- lib/jemquarie/parser/generic.rb
|
116
124
|
- lib/jemquarie/version.rb
|
117
|
-
- spec/files/
|
118
|
-
- spec/files/
|
119
|
-
- spec/files/
|
120
|
-
- spec/files/
|
121
|
-
- spec/files/
|
122
|
-
- spec/files/
|
125
|
+
- spec/files/account_details/details.xml
|
126
|
+
- spec/files/balance/balances.xml
|
127
|
+
- spec/files/balance/error_e0009.xml
|
128
|
+
- spec/files/expiry/expiry.xml
|
129
|
+
- spec/files/transactions/no_data.xml
|
130
|
+
- spec/files/transactions/non_authenticated.xml
|
131
|
+
- spec/files/transactions/single_transaction.xml
|
132
|
+
- spec/files/transactions/transactions.xml
|
133
|
+
- spec/files/transactions/wrong_account_number.xml
|
134
|
+
- spec/files/transactions/wrong_authentication.xml
|
135
|
+
- spec/lib/accont_details_spec.rb
|
136
|
+
- spec/lib/balance_spec.rb
|
137
|
+
- spec/lib/expiry_spec.rb
|
123
138
|
- spec/lib/importer_spec.rb
|
124
139
|
- spec/lib/jemquarie_spec.rb
|
125
140
|
- spec/spec_helper.rb
|
@@ -148,12 +163,19 @@ signing_key:
|
|
148
163
|
specification_version: 4
|
149
164
|
summary: Ruby Gem for extracting cash transactions from Macquarie ESI web service
|
150
165
|
test_files:
|
151
|
-
- spec/files/
|
152
|
-
- spec/files/
|
153
|
-
- spec/files/
|
154
|
-
- spec/files/
|
155
|
-
- spec/files/
|
156
|
-
- spec/files/
|
166
|
+
- spec/files/account_details/details.xml
|
167
|
+
- spec/files/balance/balances.xml
|
168
|
+
- spec/files/balance/error_e0009.xml
|
169
|
+
- spec/files/expiry/expiry.xml
|
170
|
+
- spec/files/transactions/no_data.xml
|
171
|
+
- spec/files/transactions/non_authenticated.xml
|
172
|
+
- spec/files/transactions/single_transaction.xml
|
173
|
+
- spec/files/transactions/transactions.xml
|
174
|
+
- spec/files/transactions/wrong_account_number.xml
|
175
|
+
- spec/files/transactions/wrong_authentication.xml
|
176
|
+
- spec/lib/accont_details_spec.rb
|
177
|
+
- spec/lib/balance_spec.rb
|
178
|
+
- spec/lib/expiry_spec.rb
|
157
179
|
- spec/lib/importer_spec.rb
|
158
180
|
- spec/lib/jemquarie_spec.rb
|
159
181
|
- spec/spec_helper.rb
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|