fintecture 0.1.3 → 0.1.4

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: 75ca8a2420ebb966cc0587979770691f0c4576d6de33a19f9810eca8e0a3e89e
4
- data.tar.gz: 7866554d0e343b0323b7417ce4a928b282de1b43b2b0d0995e0c6a13f44c2c61
3
+ metadata.gz: 7d75b5b837dc220b711aa83c97b21ead897eeb8433048cece9eeca8f44f45814
4
+ data.tar.gz: 0d3e70664fde800f63c28cef09b970c30836c9e625c0c205a7fa2f063677462d
5
5
  SHA512:
6
- metadata.gz: 77e664f94d8fddbd15ce066458a26b761cc3300b02bb5f06deef35defa6a09491c8e73962b885bc5d2d5d9bc247f1bcc62a43201d1c5a2d68f0050363b9698e3
7
- data.tar.gz: 1e5e372019e0ca6a95bdb847e398194e53a67927a3d0e5e467657f57110a7cad0c304a731810dcf2e875905d9db841c23fc7b47c18928747571f61ab710dee5b
6
+ metadata.gz: 1486796594cf1743f3eec6836c220338bbab1d17222ea79161203f3c33fdf8accd8e76ffb9796c73d0fc7d70468c50ea0e199d17346cdbd4e78991c5cfb99470
7
+ data.tar.gz: 6a9dc3e4f58937edb693c61ef29a02675d5bcb99bb36272ae69f2fad2e4292df88cc811a8b63786e89eafe2371b7010e2bc93f31fa76f8e2726f265f74e76eb5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fintecture (0.1.2)
4
+ fintecture (0.1.3)
5
5
  faraday
6
6
 
7
7
  GEM
@@ -11,7 +11,7 @@ module Fintecture
11
11
  end
12
12
 
13
13
  def connect_url(payment_attrs: nil, type: 'pis')
14
- @payment_attrs = payment_attrs.as_json
14
+ @payment_attrs = as_json payment_attrs
15
15
  @type = type
16
16
 
17
17
  validate_payment_integrity
@@ -24,7 +24,7 @@ module Fintecture
24
24
  end
25
25
 
26
26
  def verify_url_parameters(parameters = nil)
27
- @post_payment_attrs = parameters.as_json
27
+ @post_payment_attrs = as_json parameters
28
28
 
29
29
  validate_post_payment_integrity
30
30
 
@@ -43,7 +43,7 @@ module Fintecture
43
43
  end
44
44
 
45
45
  def validate_payment_integrity
46
- raise_if_klass_mismatch @payment_attrs, Hash, 'payment_attrs'
46
+ # raise_if_klass_mismatch @payment_attrs, Hash, 'payment_attrs'
47
47
 
48
48
  error_msg = 'invalid payment payload parameter'
49
49
 
@@ -55,7 +55,7 @@ module Fintecture
55
55
  end
56
56
 
57
57
  def validate_post_payment_integrity
58
- raise_if_klass_mismatch @post_payment_attrs, Hash, 'post_payment_attrs'
58
+ # raise_if_klass_mismatch @post_payment_attrs, Hash, 'post_payment_attrs'
59
59
 
60
60
  %w[s state status session_id customer_id provider].each do |param|
61
61
  raise "invalid post payment parameter #{param}" if @post_payment_attrs[param].nil?
@@ -66,7 +66,7 @@ module Fintecture
66
66
  attributes = {
67
67
  amount: @payment_attrs['amount'],
68
68
  currency: @payment_attrs['currency'],
69
- communication: @payment_attrs['order_id'].to_s,
69
+ communication: @payment_attrs['communication'].to_s,
70
70
  end_to_end_id: @payment_attrs['end_to_end_id']
71
71
  }
72
72
 
@@ -103,6 +103,7 @@ module Fintecture
103
103
  redirect_uri: @payment_attrs['redirect_uri'] || '',
104
104
  origin_uri: @payment_attrs['origin_uri'] || '',
105
105
  order_id: @payment_attrs['order_id'],
106
+ state: @payment_attrs['state'],
106
107
  payload: payload,
107
108
  version: Fintecture::VERSION,
108
109
  }
@@ -125,6 +126,12 @@ module Fintecture
125
126
  def base_url
126
127
  Fintecture::Api::BaseUrl::FINTECTURE_CONNECT_URL[Fintecture.environment.to_sym]
127
128
  end
129
+
130
+ def as_json(element)
131
+ return element.to_json if element.is_a? Hash
132
+
133
+ return element.as_json
134
+ end
128
135
  end
129
136
  end
130
137
  end
@@ -1,3 +1,3 @@
1
1
  module Fintecture
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fintecture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fintecture
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-12 00:00:00.000000000 Z
11
+ date: 2020-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler