flinks 0.4.2 → 0.5.0

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: c1f7a9b0d7dffd9587855c4180c6460f075e026aa77aad81e27a3e8a9fdff230
4
- data.tar.gz: c7694a914067bad7e8c87de6c075efe68b13aafb658c6b78a535383850045871
3
+ metadata.gz: 190e14203528b2f647874f9b2de0b65e79129e1a5e61a643069d216bc45b54fc
4
+ data.tar.gz: bc172cc34769f3c9ba9e9758489f3bd1f6129515fac5440a68746a8d78130cf4
5
5
  SHA512:
6
- metadata.gz: ad693d77d924727a384e14df77e150067011fc0eebf417ebcd8436234eabd1eec2d84c7b3816c519bc036421f7401fa88041d2deec9efb095415ec5e52559dbd
7
- data.tar.gz: 4ef300d40d8d154222b8a804bd18687bd8e29e515bb1fea168b85dbd6f730c16c73ecd1f83d45fa508646b98d9514cb3b985ff40d45eb4bdbf56e6a70e4d0d3c
6
+ metadata.gz: 9310956e4c65b4363d4906cfbf8451341b6556d7ecfac8a1474bdfa6a8c7ec0c6cea4dd82d116066397aff99235aabb1c15b79539a65a2685aa70ed36f94b50e
7
+ data.tar.gz: bab30618f7c360ec5ec9fedfc87cf2f3cfa1125dc8bf4ddc9002399f487b8ccb4e7969bb621aa1fbdae2436fded4f350c154ddab48c17552ffced9de65ebdb5f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.5.0
data/flinks.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: flinks 0.4.2 ruby lib
5
+ # stub: flinks 0.5.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "flinks".freeze
9
- s.version = "0.4.2"
9
+ s.version = "0.5.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Philippe Dionne".freeze]
14
- s.date = "2018-06-18"
14
+ s.date = "2018-07-03"
15
15
  s.description = "Flinks financial services API client".freeze
16
16
  s.email = "dionne.phil@gmail.com".freeze
17
17
  s.extra_rdoc_files = [
@@ -39,8 +39,8 @@ module Flinks
39
39
  end
40
40
 
41
41
  # @see https://sandbox-api.flinks.io/Readme/#get-accounts-summary
42
- # @param request_id [String]
43
- # @param options [Hash]
42
+ # @param [String] request_id
43
+ # @param [Hash] options
44
44
  # @return [Hash]
45
45
  def accounts_summary(request_id:, options: {})
46
46
  payload = options.merge(request_id: request_id)
@@ -50,8 +50,8 @@ module Flinks
50
50
  end
51
51
 
52
52
  # @see https://sandbox-api.flinks.io/Readme/#get-accounts-detail
53
- # @param request_id [String]
54
- # @param options [Hash]
53
+ # @param [String] request_id
54
+ # @param [Hash] options
55
55
  # @return [Hash]
56
56
  def accounts_detail(request_id:, options: {})
57
57
  payload = options.merge(request_id: request_id)
@@ -61,14 +61,14 @@ module Flinks
61
61
  end
62
62
 
63
63
  # @see https://sandbox-api.flinks.io/Readme/#get-accounts-summary
64
- # @param request_id [String]
64
+ # @param [String] request_id
65
65
  # @return [Hash]
66
66
  def accounts_summary_async(request_id:)
67
67
  get("#{customer_id}/BankingServices/GetAccountsSummaryAsync/#{request_id}")
68
68
  end
69
69
 
70
70
  # @see https://sandbox-api.flinks.io/Readme/#get-accounts-detail
71
- # @param request_id [String]
71
+ # @param [String] request_id
72
72
  # @return [Hash]
73
73
  def accounts_detail_async(request_id:)
74
74
  get("#{customer_id}/BankingServices/GetAccountsDetailAsync/#{request_id}")
@@ -42,8 +42,8 @@ module Flinks
42
42
  end
43
43
 
44
44
  # @see https://sandbox-api.flinks.io/Readme/#authorize
45
- # @param login_id [String]
46
- # @param options [Hash]
45
+ # @param [String] login_id
46
+ # @param [Hash] options
47
47
  # @return [Hash]
48
48
  def authorize(login_id:, options: {})
49
49
  payload = options.merge(login_id: login_id)
@@ -53,10 +53,10 @@ module Flinks
53
53
  end
54
54
 
55
55
  # @see https://sandbox-api.flinks.io/Readme/#authorize
56
- # @param username [String]
57
- # @param password [String]
58
- # @param institution [String]
59
- # @param options [Hash]
56
+ # @param [String] username
57
+ # @param [String] password
58
+ # @param [String] institution
59
+ # @param [Hash] options
60
60
  def authorize_with_credentials(username:, password:, institution:, options: {})
61
61
  payload = options.merge(username: username, password: password, institution: institution)
62
62
  validate_request!(AuthorizeWithCredentialsRequestSchema, payload)
@@ -65,8 +65,8 @@ module Flinks
65
65
  end
66
66
 
67
67
  # @see https://sandbox-api.flinks.io/Readme/#authorize-multiple
68
- # @param login_ids [Array]
69
- # @param options [Hash]
68
+ # @param [Array] login_ids
69
+ # @param [Hash] options
70
70
  # @return [Hash]
71
71
  def authorize_multiple(login_ids:, options: {})
72
72
  payload = options.merge(login_ids: login_ids)
@@ -5,10 +5,10 @@ module Flinks
5
5
  module Card
6
6
 
7
7
  # https://sandbox-api.flinks.io/Readme/#delete-card-information
8
- # @param card_id [String]
8
+ # @param [String] login_id
9
9
  # @return [Hash]
10
- def delete_card(card_id:)
11
- get("#{customer_id}/BankingServices/DeleteCard/#{card_id}")
10
+ def delete_card(login_id:)
11
+ get("#{customer_id}/BankingServices/DeleteCard/#{login_id}")
12
12
  end
13
13
  end
14
14
  end
@@ -5,8 +5,8 @@ module Flinks
5
5
  module Refresh
6
6
 
7
7
  # @see https://sandbox-api.flinks.io/Readme/#scheduling-background-refresh
8
- # @param activated [Boolean]
9
- # @param login_id [String]
8
+ # @param [Boolean] activated
9
+ # @param [String] login_id
10
10
  # @return [Hash]
11
11
  def set_scheduled_refresh(activated, login_id:)
12
12
  patch("#{customer_id}/BankingServices/SetScheduledRefresh", params: { login_id: login_id, is_activated: activated })
@@ -14,7 +14,7 @@ module Flinks
14
14
  end
15
15
 
16
16
  # @see https://sandbox-api.flinks.io/Readme/#get-pdf-statements
17
- # @param options [Hash]
17
+ # @param [Hash] options
18
18
  # @return [Hash]
19
19
  def statements(options: {})
20
20
  validate_request!(StatementRequestSchema, options)
@@ -22,7 +22,7 @@ module Flinks
22
22
  end
23
23
 
24
24
  # @see https://sandbox-api.flinks.io/Readme/#get-pdf-statements
25
- # @param request_id [String]
25
+ # @param [String] request_id
26
26
  # @return [Hash]
27
27
  def statements_async(request_id:)
28
28
  get("#{customer_id}/BankingServices/GetStatementsAsync/#{request_id}")
data/lib/flinks/client.rb CHANGED
@@ -34,7 +34,7 @@ module Flinks
34
34
 
35
35
  # Builds an error message from a validation object
36
36
  #
37
- # @param validation [Dry::Validation::Result]
37
+ # @param [Dry::Validation::Result] validation
38
38
  # @return [String]
39
39
  def error_message(validation)
40
40
  validation.messages(full: true).values.flatten.to_sentence
@@ -42,8 +42,8 @@ module Flinks
42
42
 
43
43
  # Validates a request payload against a schema object
44
44
  #
45
- # @param schema [Class]
46
- # @param options [Hash]
45
+ # @param [Class] schema
46
+ # @param [Hash] options
47
47
  # @raise [ArgumentError]
48
48
  def validate_request!(schema, options)
49
49
  payload = schema.call(options)
data/lib/flinks/error.rb CHANGED
@@ -4,7 +4,7 @@ module Flinks
4
4
  class Error < StandardError
5
5
  attr_reader :response, :code
6
6
 
7
- # @param response [HTTP::Response]
7
+ # @param [HTTP::Response] response
8
8
  # @return [Flinks::Error]
9
9
  def self.from_response(response)
10
10
  klass = case response.code
@@ -31,7 +31,7 @@ module Flinks
31
31
  klass.new(response)
32
32
  end
33
33
 
34
- # @param response [HTTP::Response]
34
+ # @param [HTTP::Response] response
35
35
  # @return [Flinks::Error]
36
36
  def self.error_for_202(response)
37
37
  if response.parse['FlinksCode'] == 'OPERATION_PENDING'
@@ -41,7 +41,7 @@ module Flinks
41
41
  end
42
42
  end
43
43
 
44
- # @param response [HTTP::Response]
44
+ # @param [HTTP::Response] response
45
45
  # @return [Flinks::Error]
46
46
  def self.error_for_400(response)
47
47
  if response.parse['FlinksCode'] == 'SESSION_NONEXISTENT'
@@ -51,7 +51,7 @@ module Flinks
51
51
  end
52
52
  end
53
53
 
54
- # @param response [HTTP::Response]
54
+ # @param [HTTP::Response] response
55
55
  # @return [Flinks::Error]
56
56
  def self.error_for_403(response)
57
57
  if response.parse['FlinksCode'] == 'TOO_MANY_REQUESTS'
@@ -61,7 +61,7 @@ module Flinks
61
61
  end
62
62
  end
63
63
 
64
- # @param response [HTTP::Response]
64
+ # @param [HTTP::Response] response
65
65
  # @return [Flinks::Error]
66
66
  def initialize(response)
67
67
  @response = response
@@ -10,26 +10,26 @@ module Flinks
10
10
 
11
11
  # Performs a HTTP Get request
12
12
  #
13
- # @param path [String]
14
- # @param params [Hash]
13
+ # @param [String] path
14
+ # @param [Hash] params
15
15
  def get(path, params: {})
16
16
  request(:get, path, params: params)
17
17
  end
18
18
 
19
19
  # Performs a HTTP Post request
20
20
  #
21
- # @param path [String]
22
- # @param params [Hash]
23
- # @param body [Hash]
21
+ # @param [String] path
22
+ # @param [Hash] params
23
+ # @param [Hash] body
24
24
  def post(path, params: {}, body: {})
25
25
  request(:post, path, params: params, body: body)
26
26
  end
27
27
 
28
28
  # Performs a HTTP Patch request
29
29
  #
30
- # @param path [String]
31
- # @param params [Hash]
32
- # @param body [Hash]
30
+ # @param [String] path
31
+ # @param [Hash] params
32
+ # @param [Hash] body
33
33
  def patch(path, params: {}, body: {})
34
34
  request(:patch, path, params: params, body: body)
35
35
  end
@@ -74,7 +74,9 @@ module Flinks
74
74
  data = response.parse
75
75
 
76
76
  # Transform data
77
- unless raw
77
+ if raw
78
+ data
79
+ else
78
80
  data.deep_transform_keys { |k| k.underscore }.with_indifferent_access
79
81
  end
80
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flinks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philippe Dionne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-18 00:00:00.000000000 Z
11
+ date: 2018-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http