bank_api 0.7.5 → 0.7.6

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: bc70b8079987a6546b3c751d9a6ccea444df15db21692c8e2ec2d368b8980448
4
- data.tar.gz: 5485bf9ba86526a90c367e480b60f819addb6665184782383242a671879030f8
3
+ metadata.gz: 886af5ed1c68d928ae5d94d6e25ad64be7f5bd6b764e0077b1522dd9ba14776a
4
+ data.tar.gz: c9577fc968bac4ed8e6c5df548ac13ae44e3a4a9abc616a41c3b7e248989e1b2
5
5
  SHA512:
6
- metadata.gz: d392430f0b30cd4035059fd3eb7b85c9510e4eedb1fccc237cb8a4be27d955df8820b202c1f12ec98c54c84ece8bf3a1e4dc3d41b379c2e3c2a8dc7fbc733973
7
- data.tar.gz: 2a3440e68166aa74f3d859c1e66d1cf7ce5f18100ecdf84e2e7798da50a3ebc32ae6e24c7e3b8a3288c1e62258ef4ae05754b6125ca9e888bd49d7df09f12928
6
+ metadata.gz: 0f2beaff4e27168e47ba068470e0c181fcbdba91772c0ab690e780b2c2f7f2498a3790abc983c660ab5d98f538980d04397939aeffcb6fa8924ead05ccf2b523
7
+ data.tar.gz: 354ead4117bf1215be1f4fbf400e1c1f5db7602c527010df13245bc180799a02548721589ba8a52a2f5158d88d7e9c2b1865cb5eba3b1c651f9d6ad39c66b288
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bank_api (0.7.5)
4
+ bank_api (0.7.6)
5
5
  pincers
6
6
  rest-client
7
7
  timezone (~> 1.0)
@@ -147,7 +147,7 @@ module BankApi::Clients
147
147
  prepare_deposits
148
148
  response = RestClient::Request.execute(
149
149
  url: COMPANY_DEPOSITS_TXT_URL, method: :post, headers: session_headers,
150
- payload: deposits_txt_payload(deposit_range[:start], deposit_range[:end]), verify_ssl: false
150
+ payload: deposits_txt_payload(deposit_range[:start], deposit_range[:end]), verify_ssl: true
151
151
  )
152
152
  raise "Banchile is down" if response.body.include? "no podemos atenderle"
153
153
 
@@ -162,7 +162,7 @@ module BankApi::Clients
162
162
  RestClient::Request.execute(
163
163
  url: COMPANY_PREPARE_DEPOSITS_URL, method: :post, headers: session_headers,
164
164
  payload: prepare_deposits_payload(deposit_range[:start], deposit_range[:end]),
165
- verify_ssl: false
165
+ verify_ssl: true
166
166
  )
167
167
  end
168
168
 
@@ -33,7 +33,8 @@ module BankApi::Clients::BancoSecurity
33
33
  end
34
34
 
35
35
  def deposits_from_txt
36
- return [] unless any_deposits?
36
+ wait("") { any_deposits? }
37
+ raise BankApi::Deposit::FetchError, "Couldn't fetch deposits" unless any_deposits?
37
38
  download = browser.download(deposits_txt_url)
38
39
  transactions = download.content.split("\n").drop(1).map { |r| r.split("|") }
39
40
  format_transactions(transactions)
@@ -80,9 +81,7 @@ module BankApi::Clients::BancoSecurity
80
81
  end
81
82
 
82
83
  def extract_client_name(text)
83
- parts = text.to_s.split(" De ")
84
- parts = text.to_s.split(" DE ") if parts.count == 1
85
- return text if parts.count > 2
84
+ parts = text.to_s.split(/\ DE | De | de /, 2)
86
85
  parts.last.to_s.strip
87
86
  end
88
87
 
@@ -4,6 +4,7 @@ module BankApi
4
4
  class InvalidAccountNumber < StandardError; end
5
5
  end
6
6
  module Deposit
7
+ class FetchError < StandardError; end
7
8
  class QuantityError < StandardError; end
8
9
  class PaginationError < StandardError; end
9
10
  end
@@ -1,3 +1,3 @@
1
1
  module BankApi
2
- VERSION = "0.7.5"
2
+ VERSION = "0.7.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bank_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - oaestay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-07 00:00:00.000000000 Z
11
+ date: 2018-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pincers