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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fintecture/connect.rb +12 -5
- data/lib/fintecture/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d75b5b837dc220b711aa83c97b21ead897eeb8433048cece9eeca8f44f45814
|
4
|
+
data.tar.gz: 0d3e70664fde800f63c28cef09b970c30836c9e625c0c205a7fa2f063677462d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1486796594cf1743f3eec6836c220338bbab1d17222ea79161203f3c33fdf8accd8e76ffb9796c73d0fc7d70468c50ea0e199d17346cdbd4e78991c5cfb99470
|
7
|
+
data.tar.gz: 6a9dc3e4f58937edb693c61ef29a02675d5bcb99bb36272ae69f2fad2e4292df88cc811a8b63786e89eafe2371b7010e2bc93f31fa76f8e2726f265f74e76eb5
|
data/Gemfile.lock
CHANGED
data/lib/fintecture/connect.rb
CHANGED
@@ -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
|
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
|
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['
|
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
|
data/lib/fintecture/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2020-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|