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: 63f1a044cffb07a5ff168c7705f9f33de188d289
4
- data.tar.gz: 3aa1bdaf05ec4d8f7eb432578238568a1a922d0c
3
+ metadata.gz: 8bcc39fb4a83a34cdc2097a12f6362941fa7d87a
4
+ data.tar.gz: 26443a306676f60084181ba17c4b9e084a360b41
5
5
  SHA512:
6
- metadata.gz: 47a37a3e15cb82d98352a649de5e659b5cc271c3be52254bdf0c79634ed997f64c7f0c68d8c797b602a1d8a89ed2331869154415920acee3415c706e203fee9e
7
- data.tar.gz: b8798af20bd47a2e050f86a16da48acdb001c572fed1929e52f4186d59cb4e03d514136c89feed9e682014cd22a8c385fb02f369ea282c7abd1c145df6e85dfd
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
- return reply
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| DateTime.parse(e['pstdDate'])}
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']['Status'], j.first[1]['Header']['Error_Cde'], j.first[1]['Header']['Error_Desc'])
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
@@ -1,3 +1,3 @@
1
1
  module ApiBanking
2
- VERSION = "0.1.21"
2
+ VERSION = "0.1.22"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_banking
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.21
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - akil