jemquarie 0.0.2 → 0.0.3
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/lib/jemquarie/parser/cash_transactions.rb +6 -1
- data/lib/jemquarie/version.rb +1 -1
- data/spec/files/single_transaction.xml +28 -0
- data/spec/lib/importer_spec.rb +17 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c289fe5e228aaffc293c9c8ee06b376795c45529
|
4
|
+
data.tar.gz: 72287bf80cdaac015a1184d3d993d7c7f14e310f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e194d5f02ac1b03f56957905abb3ef674c91546138e7f3f41a6d1f74dd25eaf3a0ebe1f2f8c1350476266de0e8429bf7cdd68c939f470d80ee72fbc37c3c232
|
7
|
+
data.tar.gz: 2ff5b231413c378e9232cda5fbb54d39008727e68e83f0d19b297010b746e8f606589e0ccf0e0b5e995a00c35e35a825ca019f71b3a1b2b1a931763cdabe2dc1
|
data/Gemfile.lock
CHANGED
@@ -8,7 +8,12 @@ module Jemquarie
|
|
8
8
|
result = Hash.from_xml(Nokogiri::XML.fragment(body[:generate_xml_extract_response][:result]).to_s)
|
9
9
|
transactions = []
|
10
10
|
return transactions unless result["XMLExtract"] && result["XMLExtract"]["yourclientsTransactions"] && result["XMLExtract"]["yourclientsTransactions"]["yourclientsTransaction"]
|
11
|
-
result["XMLExtract"]["yourclientsTransactions"]["yourclientsTransaction"].
|
11
|
+
xml_transactions = if result["XMLExtract"]["yourclientsTransactions"]["yourclientsTransaction"].is_a?(Hash)
|
12
|
+
[result["XMLExtract"]["yourclientsTransactions"]["yourclientsTransaction"]]
|
13
|
+
else
|
14
|
+
result["XMLExtract"]["yourclientsTransactions"]["yourclientsTransaction"]
|
15
|
+
end
|
16
|
+
xml_transactions.each do |transaction|
|
12
17
|
transactions << parse_single_transaction(transaction)
|
13
18
|
end
|
14
19
|
transactions
|
data/lib/jemquarie/version.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><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"><soapenv:Body><ns1:GenerateXMLExtractResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="wrapwebservices"><result xsi:type="xsd:string"><?xml version="1.0" ?>
|
2
|
+
<XMLExtract>
|
3
|
+
<RequestDetails>
|
4
|
+
<RequestStatus>Success</RequestStatus>
|
5
|
+
<RequestErrorNumber></RequestErrorNumber>
|
6
|
+
<RequestErrorDetails></RequestErrorDetails>
|
7
|
+
<RequestTime>2014-05-20 10:02:44.45</RequestTime>
|
8
|
+
</RequestDetails>
|
9
|
+
<XMLEntityDetails>
|
10
|
+
<XMLEntityName>your.clients Transactions</XMLEntityName>
|
11
|
+
<XMLEntityVersion>V1.4</XMLEntityVersion>
|
12
|
+
</XMLEntityDetails>
|
13
|
+
<yourclientsTransactions>
|
14
|
+
<yourclientsTransaction>
|
15
|
+
<AccountNumber>121741987</AccountNumber>
|
16
|
+
<TransactionDate>2008-12-19 00:00:00.0</TransactionDate>
|
17
|
+
<ReversalFlag>N</ReversalFlag>
|
18
|
+
<DebitCredit>D</DebitCredit>
|
19
|
+
<TransactionType>BP</TransactionType>
|
20
|
+
<TransactionId>0132058314</TransactionId>
|
21
|
+
<Amount>2.4100</Amount>
|
22
|
+
<Narrative>BPAY TO MACQUARIE CMT</Narrative>
|
23
|
+
<DateModified>2008-12-19 04:14:26.683</DateModified>
|
24
|
+
<TransactionCategory>WTHD</TransactionCategory>
|
25
|
+
</yourclientsTransaction>
|
26
|
+
</yourclientsTransactions>
|
27
|
+
</XMLExtract>
|
28
|
+
</result></ns1:GenerateXMLExtractResponse></soapenv:Body></soapenv:Envelope>
|
data/spec/lib/importer_spec.rb
CHANGED
@@ -39,6 +39,23 @@ describe Jemquarie::Importer do
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
describe "single transaction success" do
|
43
|
+
let(:importer) do
|
44
|
+
Jemquarie::Importer.new('valid_code', 'valid_password')
|
45
|
+
end
|
46
|
+
before(:each) do
|
47
|
+
FakeWeb.register_uri(:post, Jemquarie::Jemquarie::BASE_URI,
|
48
|
+
body: File.read('spec/files/single_transaction.xml'),
|
49
|
+
content_type: 'text/xml'
|
50
|
+
)
|
51
|
+
@result = importer.cash_transactions(Date.parse("01/01/2000"), Date.today, '12345')
|
52
|
+
end
|
53
|
+
it "should work" do
|
54
|
+
expect(@result).to be_kind_of Array
|
55
|
+
expect(@result).to have(1).items
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
42
59
|
describe "do not allow more than 2 days without an account number" do
|
43
60
|
let(:importer) do
|
44
61
|
Jemquarie::Importer.new('valid_code', 'valid_password')
|
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.3
|
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-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- lib/jemquarie/version.rb
|
117
117
|
- spec/files/no_data.xml
|
118
118
|
- spec/files/non_authenticated.xml
|
119
|
+
- spec/files/single_transaction.xml
|
119
120
|
- spec/files/transactions.xml
|
120
121
|
- spec/lib/importer_spec.rb
|
121
122
|
- spec/lib/jemquarie_spec.rb
|
@@ -147,6 +148,7 @@ summary: Ruby Gem for extracting cash transactions from Macquarie ESI web servic
|
|
147
148
|
test_files:
|
148
149
|
- spec/files/no_data.xml
|
149
150
|
- spec/files/non_authenticated.xml
|
151
|
+
- spec/files/single_transaction.xml
|
150
152
|
- spec/files/transactions.xml
|
151
153
|
- spec/lib/importer_spec.rb
|
152
154
|
- spec/lib/jemquarie_spec.rb
|