finapps 0.7.4.pre → 0.8.0.pre

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: 6289e99f551330b9d9a5c16800cc8f658ee65a20
4
- data.tar.gz: f99ffd3038d6e97ceb6026d37f842b0b490e08bc
3
+ metadata.gz: 053deae1a0ea30fbfae18130b893c24dd356b494
4
+ data.tar.gz: 457afc8807199259674f16fad52505d8cee1dd0e
5
5
  SHA512:
6
- metadata.gz: fb797e8b884a5b0af8516de221eebbc7f50f8bb0b4a038f484159f1c6893330a1ad8f43d851737703a5a1865d92132f73f8dfee70700489ccbc639170ed59fa8
7
- data.tar.gz: 2f4bdadaedeef01a5b430b9ecbeb5439be6723e94888e2e6c469ffe53c0a2a9a0503468deb6c6ee851168bfa45a0fc9a35f1dfdae4edd7ddcacaa64d52d05384
6
+ metadata.gz: c710fb458bc1c0f6f72bbb0925123e20f7ea69bf870c01670fc66e8936e50899f612e6f469dc42bd6f71223e3f9520bac5d5c071355ee210986b4c7c578c3187
7
+ data.tar.gz: 178c0ab7ebb21e3b689433b23888f0234b065207424318d3b2d7b276b316ea9a67b525a5c82cae69b88f3ba5bc364fb6e154902293bc8e2813e7647e84b04e4a
@@ -37,6 +37,7 @@ module FinApps
37
37
  :user_institutions_status => 'institutions/user/:user_institution_id/status',
38
38
  :user_institutions_refresh => 'institutions/user/refresh',
39
39
 
40
+ :transactions_show => 'transaction/:transaction_id',
40
41
  :transactions_list => 'transactions/search',
41
42
  :transactions_edit => 'transactions/edit',
42
43
 
@@ -6,43 +6,21 @@ module FinApps
6
6
 
7
7
  # @transaction_id [String]
8
8
  # # @return [Hash, Array<String>]
9
- def search_by_id(transaction_id)
9
+ def show(transaction_id)
10
10
  logger.debug "##{__method__.to_s} => Started"
11
11
 
12
+ end_point = Defaults::END_POINTS[:transactions_show]
13
+ logger.debug "##{__method__.to_s} => end_point: #{end_point}"
12
14
 
13
- logger.debug "##{__method__.to_s} => searching transaction matching id: #{transaction_id}"
14
- transactions, error_messages = search_by_ids([transaction_id])
15
+ path = end_point.sub ':user_institution_id', ERB::Util.url_encode(transaction_id)
16
+ logger.debug "##{__method__.to_s} => path: #{path}"
15
17
 
16
- # get one
17
- transaction = transactions.present? ? transactions.first : nil
18
+ transaction, error_messages = @client.send(path, :post, params.compact)
18
19
 
19
20
  logger.debug "##{__method__.to_s} => Completed"
20
21
  return transaction, error_messages
21
22
  end
22
23
 
23
- # @transaction_ids [Array<String>]
24
- # # @return [Array<Hash>, Array<String>]
25
- def search_by_ids(transaction_ids)
26
- logger.debug "##{__method__.to_s} => Started"
27
-
28
- default_parameters = {
29
- :begin_date => DateTime.new(2000, 1, 1, 00, 00, 00),
30
- :end_date => Time.now,
31
- :records_per_page => 50,
32
- :page_number => 1,
33
- :sort_by => 'date',
34
- :sort_order => -1
35
- }
36
- transactions, error_messages = search default_parameters
37
-
38
- # filter by given ids
39
- logger.debug "##{__method__.to_s} => searching transaction matching ids: #{transaction_ids.inspect}"
40
- transactions = transactions[:transactions].present? ? transactions[:transactions].select { |t| transaction_ids.include?(t[:_id]) } : nil
41
-
42
- logger.debug "##{__method__.to_s} => Completed"
43
- return transactions, error_messages
44
- end
45
-
46
24
 
47
25
  # @param [Hash] params
48
26
  # @return [Array<Hash>, Array<String>]
@@ -1,3 +1,3 @@
1
1
  module FinApps
2
- VERSION = '0.7.4.pre'
2
+ VERSION = '0.8.0.pre'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4.pre
4
+ version: 0.8.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-16 00:00:00.000000000 Z
11
+ date: 2014-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor