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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f56716b5c6660c31d9315ff9c3a3e2228d8d6c07
4
- data.tar.gz: 83348e50b1cefd7cd6fcc9f5e7b9c67b4601aa0a
3
+ metadata.gz: c289fe5e228aaffc293c9c8ee06b376795c45529
4
+ data.tar.gz: 72287bf80cdaac015a1184d3d993d7c7f14e310f
5
5
  SHA512:
6
- metadata.gz: 6248a67d9c264b00be2e7b5dfdd17134b73ff6d5eaa31aff397913c3ae7aaf68151d23fcbc17f308f8de312c8ba9eb82543fef9ffb5476998ba8140ae88a3452
7
- data.tar.gz: fc41e9d4327324f28526e154db4eb7f0720a215a6dc1fa046c20ee3a2173ff81308e09c067df85931dde3d901d6c99f474ef8c28035ce0011678ac1b68cdef90
6
+ metadata.gz: 6e194d5f02ac1b03f56957905abb3ef674c91546138e7f3f41a6d1f74dd25eaf3a0ebe1f2f8c1350476266de0e8429bf7cdd68c939f470d80ee72fbc37c3c232
7
+ data.tar.gz: 2ff5b231413c378e9232cda5fbb54d39008727e68e83f0d19b297010b746e8f606589e0ccf0e0b5e995a00c35e35a825ca019f71b3a1b2b1a931763cdabe2dc1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jemquarie (0.0.1)
4
+ jemquarie (0.0.3)
5
5
  activesupport (>= 3.0)
6
6
  savon (~> 2.0)
7
7
 
@@ -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"].each do |transaction|
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
@@ -1,3 +1,3 @@
1
1
  module Jemquarie
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -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">&lt;?xml version=&quot;1.0&quot; ?&gt;
2
+ &lt;XMLExtract&gt;
3
+ &lt;RequestDetails&gt;
4
+ &lt;RequestStatus&gt;Success&lt;/RequestStatus&gt;
5
+ &lt;RequestErrorNumber&gt;&lt;/RequestErrorNumber&gt;
6
+ &lt;RequestErrorDetails&gt;&lt;/RequestErrorDetails&gt;
7
+ &lt;RequestTime&gt;2014-05-20 10:02:44.45&lt;/RequestTime&gt;
8
+ &lt;/RequestDetails&gt;
9
+ &lt;XMLEntityDetails&gt;
10
+ &lt;XMLEntityName&gt;your.clients Transactions&lt;/XMLEntityName&gt;
11
+ &lt;XMLEntityVersion&gt;V1.4&lt;/XMLEntityVersion&gt;
12
+ &lt;/XMLEntityDetails&gt;
13
+ &lt;yourclientsTransactions&gt;
14
+ &lt;yourclientsTransaction&gt;
15
+ &lt;AccountNumber&gt;121741987&lt;/AccountNumber&gt;
16
+ &lt;TransactionDate&gt;2008-12-19 00:00:00.0&lt;/TransactionDate&gt;
17
+ &lt;ReversalFlag&gt;N&lt;/ReversalFlag&gt;
18
+ &lt;DebitCredit&gt;D&lt;/DebitCredit&gt;
19
+ &lt;TransactionType&gt;BP&lt;/TransactionType&gt;
20
+ &lt;TransactionId&gt;0132058314&lt;/TransactionId&gt;
21
+ &lt;Amount&gt;2.4100&lt;/Amount&gt;
22
+ &lt;Narrative&gt;BPAY TO MACQUARIE CMT&lt;/Narrative&gt;
23
+ &lt;DateModified&gt;2008-12-19 04:14:26.683&lt;/DateModified&gt;
24
+ &lt;TransactionCategory&gt;WTHD&lt;/TransactionCategory&gt;
25
+ &lt;/yourclientsTransaction&gt;
26
+ &lt;/yourclientsTransactions&gt;
27
+ &lt;/XMLExtract&gt;
28
+ </result></ns1:GenerateXMLExtractResponse></soapenv:Body></soapenv:Envelope>
@@ -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.2
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-21 00:00:00.000000000 Z
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