api_banking 0.1.21 → 0.1.22
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bcc39fb4a83a34cdc2097a12f6362941fa7d87a
|
4
|
+
data.tar.gz: 26443a306676f60084181ba17c4b9e084a360b41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49025961a3b947e5a781b39cbc760f90ee9d536702cb1668a67ced1ecd70a6316d591a3bd6abe33fe73c1570cb3b07cc763be4614ac5e4b4b74956c828decf67
|
7
|
+
data.tar.gz: c6a721412769773323b7ab75e1ff4fc0bf654964ac3857f228d30a13899ec5022619f1c2bc33c53bc3efed4dc69fb6e48472a7971d5146bf49b84319516da8ae
|
@@ -2,6 +2,7 @@ module ApiBanking
|
|
2
2
|
class AccountStatement < JsonClient
|
3
3
|
|
4
4
|
SERVICE_VERSION = 1
|
5
|
+
CODE_NO_TXN_FOUND = '8504'
|
5
6
|
|
6
7
|
attr_accessor :request, :result
|
7
8
|
|
@@ -61,12 +62,12 @@ module ApiBanking
|
|
61
62
|
|
62
63
|
def self.parse_reply(operationName, reply)
|
63
64
|
if reply.kind_of?Fault
|
64
|
-
|
65
|
+
reply.code == CODE_NO_TXN_FOUND ? AccountStatement::Result.new([]) : reply
|
65
66
|
else
|
66
67
|
case operationName
|
67
68
|
when :getStatement
|
68
69
|
sortedTxnArray = Array.new
|
69
|
-
txnArray = reply['Acc_Stmt_DtRng_Res']['Body']['transactionDetails'].sort_by { |e|
|
70
|
+
txnArray = reply['Acc_Stmt_DtRng_Res']['Body']['transactionDetails'].sort_by { |e| parsed_datetime(e['pstdDate'])}
|
70
71
|
txnArray.each do |txn|
|
71
72
|
txnAmt = parsed_money(
|
72
73
|
txn['transactionSummary']['txnAmt']['amountValue'],
|
@@ -60,7 +60,7 @@ module ApiBanking
|
|
60
60
|
if response.headers['Content-Type'] =~ /json/
|
61
61
|
j = JSON::parse(response.response_body)
|
62
62
|
if j.first[1]['Header']['Status'] == 'FAILED'
|
63
|
-
return Fault.new(j.first[1]['Header']['
|
63
|
+
return Fault.new(j.first[1]['Header']['Error_Cde'], nil, j.first[1]['Header']['Error_Desc'])
|
64
64
|
end
|
65
65
|
return j
|
66
66
|
end
|
data/lib/api_banking/version.rb
CHANGED