portmone 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/portmone/responses/finish_3ds.rb +34 -1
- data/lib/portmone/responses/mobile_pay.rb +4 -0
- data/lib/portmone/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: 980c91387f0773f49b389434c6f23f1b6bc55d6ae06add5eca674a63f1f8c5dc
|
4
|
+
data.tar.gz: fc5894354208ecc4cd0c0f69958bcfbd61098b1c05efd0611d18c8e35889feb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccbbdf16e717828a105bdcbc40b1a46eeff82aaf00427b508e45f468e72d3f14839af92e4cfac3584f95d394d58a34471099b678fdc8d5892b14ba782c21adf0
|
7
|
+
data.tar.gz: b0834fa442c79c4fa22df054432e6cb18c99f1ab44636660c21daace7310f6dbae545ba75e52c717ea2ad1067a5e507298b96737d9b5401820250f10eeac94d4
|
@@ -1,10 +1,13 @@
|
|
1
1
|
class Portmone::Responses::Finish3DS
|
2
|
+
SUCCESS_STATUS = 'PAYED'.freeze
|
3
|
+
|
2
4
|
attr_reader :response
|
3
5
|
|
4
6
|
def initialize(faraday_response, currency:, timezone:)
|
5
7
|
@response = faraday_response
|
6
8
|
@currency = currency
|
7
9
|
@timezone = timezone
|
10
|
+
@response_body = @response.body.present? ? JSON.parse(@response.body) : { 'result' => {} }
|
8
11
|
end
|
9
12
|
|
10
13
|
def http_status
|
@@ -12,6 +15,36 @@ class Portmone::Responses::Finish3DS
|
|
12
15
|
end
|
13
16
|
|
14
17
|
def success?
|
15
|
-
|
18
|
+
result['status'] == SUCCESS_STATUS && !required_3ds?
|
19
|
+
end
|
20
|
+
|
21
|
+
def error_code
|
22
|
+
result['errorCode']
|
23
|
+
end
|
24
|
+
|
25
|
+
def error_description
|
26
|
+
result['error']
|
27
|
+
end
|
28
|
+
|
29
|
+
def required_3ds?
|
30
|
+
result['isNeed3DS'] == 'Y'
|
31
|
+
end
|
32
|
+
|
33
|
+
def acs_url
|
34
|
+
result['actionMPI']
|
35
|
+
end
|
36
|
+
|
37
|
+
def md
|
38
|
+
result['md']
|
39
|
+
end
|
40
|
+
|
41
|
+
def pa_req
|
42
|
+
result['pareq']
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def result
|
48
|
+
@result ||= @response_body['result']
|
16
49
|
end
|
17
50
|
end
|
data/lib/portmone/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: portmone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Sviridov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|