bambora-client 0.1.2 → 0.1.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
  SHA256:
3
- metadata.gz: f9a1ebaa8ff8caf77c90408b8ed6b4688cd78b0f28210bc1aece1d6209a41dad
4
- data.tar.gz: f47ca550819ee31a4fd516d72a7a16fe2c9c5732b830edee73fa83b4672f1630
3
+ metadata.gz: 395e9139c238631535595895b2f59ace8bbdb7ec65c853b44aa4eca6f85466bc
4
+ data.tar.gz: 6ccfb72d9d62005daf0327540d97bd86293494b86fb9f6ba5420738efd149d55
5
5
  SHA512:
6
- metadata.gz: '08f5735b9efde79f4ccd9c28a5c63cde0aa0b3637c3d1a4944b9e64651a6e8a76cfa26c8a018cc57ba26f2028f8bc5235b8bfc3d4f82930591b6d07ee00c9fc6'
7
- data.tar.gz: 8009add71906682226f07a64e639d18810bf08ea4adf7bc95ddc01116a5dd01b3a37bded5962c88c8839c59e719b80fbcf80bec947d9d26847b79dfac0dc047a
6
+ metadata.gz: d07e4984c23a99253a872596138de6a654d671995fedcf041a1eafeddbd68631f027395a04c084ad5ff82805216467a4b8ff7ee3401f501b2c2902f004406732
7
+ data.tar.gz: 1b8d8fea61f5f2e12cd2b667492c787dcdf30e3d62157ffb823cdbf836fd2ea273c30f4f6427da3ce57b7c1a84b68e317bc6fa91779292bd2012b630f21c0835
@@ -1,3 +1,7 @@
1
+ ## 0.1.3 (2020-04-30)
2
+
3
+ - Ensure Batch Report returns empty array `:record` in response at the very least
4
+
1
5
  ## 0.1.2 (2020-04-14)
2
6
 
3
7
  - Fix nil record with Bank Batch Report returns
@@ -53,17 +53,24 @@ module Bambora
53
53
  #
54
54
  # @params profile_data [Hash] with values as noted in the example.
55
55
  def show(report_data)
56
- add_messages_to_response(
57
- client.post(path: sub_path, body: batch_report_body(report_data)),
58
- )
56
+ response = client.post(path: sub_path, body: batch_report_body(report_data))
57
+
58
+ response = ensure_record_key_exists(response)
59
+ response = add_messages_to_response(response)
60
+
61
+ response
59
62
  end
60
63
 
61
64
  private
62
65
 
63
- def add_messages_to_response(response)
64
- # bambora can return null or empty record results, don't decorate with messages
65
- return response if response.dig(:response, :record).nil?
66
+ def ensure_record_key_exists(response)
67
+ # bambora can return null or empty record results, fill it in for consistency
68
+ response.dig(:response)[:record] = [] if response.dig(:response, :record).nil?
66
69
 
70
+ response
71
+ end
72
+
73
+ def add_messages_to_response(response)
67
74
  response.dig(:response, :record).map! do |record|
68
75
  record.merge!(messages: record[:messageId].split(',').map { |id| MESSAGES[id] })
69
76
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bambora
4
4
  class Client
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bambora-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cassidy K
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-14 00:00:00.000000000 Z
11
+ date: 2020-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon