anz_bank_client 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 789009701c348b1e64086bd88dae60afe4996cf28db004c961bed1315446eee9
4
- data.tar.gz: 4ce36e7f8226f3a6a27039876d4823fcadff870aea2b706a15fd05c76269b41e
3
+ metadata.gz: c6ad6ddb9b62c9c3b8fd03cf339667723b720b2628bf339c6d1cf6e1dc472378
4
+ data.tar.gz: b6165fc0046d613a03fba3f4d9de0f2be78186d0b9623d2a53cbbc6e9eda9343
5
5
  SHA512:
6
- metadata.gz: 66a318dddddd8d660bb0d61490c1a9283c43fcdb84f22c840f1bc12e825958b417f154ebf4defaca3f42e73e5613136edb5dc3ad23a9f5bec6e1e545837f073c
7
- data.tar.gz: 1a2400bad089bf8aedc3eea4c221b138ec115193d9f075f36f5504a36745381c364ceaf4d16eafa4740ec9c7e71913eaf13236f11fcba89bfe1a0711936fdec2
6
+ metadata.gz: 9ac1582b8b94b4450c4ffeeabb16397a6ef1f12737e21c5548b16962d530d0889457995c203248152141ab57b004fe5b83ee19884c76e4d2f8dd4520b1cb79f5
7
+ data.tar.gz: f04d9e4f0cc317d6148f218704ecd341f62e33889bc85a17960580dad102745adb5c940c7c0fc3e19ccb200c107b4ccc68280268e7d854c42dc69fbfe5f909ee
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- anz_bank_client (0.1.3)
4
+ anz_bank_client (0.1.5)
5
5
  faraday (~> 2.7)
6
6
  faraday-cookie_jar (~> 0.0.7)
7
7
  faraday-follow_redirects (~> 0.3.0)
data/exe/anzcli CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift(File.expand_path("../../lib", __FILE__))
2
3
  require "anz_bank_client"
3
4
  require "readline"
4
5
  require "optparse"
@@ -65,7 +66,7 @@ class AnzCli < Thor
65
66
  description1: t[:details][0],
66
67
  description2: t[:details][1],
67
68
  amount: "% 12.2f" % t[:amount],
68
- balance: "% 12.2f" % t[:balance],
69
+ balance: t[:balance] ? ("% 12.2f" % t[:balance]) : nil,
69
70
  }
70
71
  end
71
72
  tp txns
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnzBankClient
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.5"
5
5
  end
@@ -70,8 +70,8 @@ module AnzBankClient
70
70
  raise "Error getting login page: #{login_page.status} #{login_page.body}"
71
71
  end
72
72
 
73
- @encryption_key = login_page.body.match(/encryptionKey: "(.*)",/)[1]
74
- @encryption_key_id = login_page.body.match(/encryptionKeyId: "(.*)",/)[1]
73
+ @encryption_key = login_page.body.match(/encryptionKey: "(.*)"/)[1]
74
+ @encryption_key_id = login_page.body.match(/encryptionKeyId: "(.*)"/)[1]
75
75
 
76
76
  # Encrypt password using encryption key
77
77
  encrypted_password = encrypt_password(password).strip
@@ -160,7 +160,10 @@ module AnzBankClient
160
160
  raise "Error getting transactions: #{response.status}\n\n#{response.body}" unless response.status == 200
161
161
 
162
162
  response_json = JSON.parse(response.body)
163
- response_json["transactions"].map do |transaction|
163
+ transactions = response_json["transactions"]
164
+ # Ignore transactions without an amount - these can be informational messages like "Finance Charge Rate Changed Today"
165
+ transactions = transactions.filter{ |transaction| transaction["amount"] }
166
+ transactions.map do |transaction|
164
167
  {
165
168
  date: transaction["date"],
166
169
  postedDate: transaction["postedDate"],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anz_bank_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Dewar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-02 00:00:00.000000000 Z
11
+ date: 2024-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday