paycertify 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paycertify/three_ds/client.rb +11 -10
- data/lib/paycertify/three_ds/form.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0013a84a4889ef892ab21688c80ff65e7fb117f1
|
4
|
+
data.tar.gz: 026095ceb9a0424a57e8dfd2c4a49d29c1cae807
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e48a37540acc571a98d8adfa595628a556561dee046eb4e6b5d081aa73656919318e42af09f03c1946cd7e54c97023a86a4c9d9600267cb789aa23bf00fee410
|
7
|
+
data.tar.gz: 496c7c3a0f94ecf839b7465f31d71b2e06cb3c7e731480d9f68985a754548b9b0767b183bfe6d672aa76801c83b090133c035077ce162bdb7f432656f10a52c2
|
@@ -6,9 +6,7 @@ module PayCertify
|
|
6
6
|
|
7
7
|
BASE_URL = 'https://mpi.3dsintegrator.com'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
attr_accessor :api_key, :api_secret
|
9
|
+
attr_accessor :api_key, :api_secret, :response
|
12
10
|
|
13
11
|
def initialize(api_key:, api_secret:)
|
14
12
|
self.api_key = api_key
|
@@ -29,6 +27,14 @@ module PayCertify
|
|
29
27
|
respond_with response
|
30
28
|
end
|
31
29
|
|
30
|
+
def success?
|
31
|
+
response.status < 400
|
32
|
+
end
|
33
|
+
|
34
|
+
def error?
|
35
|
+
!success
|
36
|
+
end
|
37
|
+
|
32
38
|
private
|
33
39
|
def connection
|
34
40
|
@connection ||= Faraday.new(url: BASE_URL, ssl: {verify: false}) do |faraday|
|
@@ -47,13 +53,8 @@ module PayCertify
|
|
47
53
|
puts 'Response -----'
|
48
54
|
p response.body
|
49
55
|
10.times{puts}
|
50
|
-
|
51
|
-
|
52
|
-
JSON.parse(response.body)
|
53
|
-
else
|
54
|
-
error = JSON.parse(response.body)['error']
|
55
|
-
raise InvalidRequestError, "API responded with #{response.status} and error: #{error}"
|
56
|
-
end
|
56
|
+
self.response = response
|
57
|
+
JSON.parse(response.body)
|
57
58
|
end
|
58
59
|
end
|
59
60
|
end
|
@@ -49,11 +49,11 @@ module PayCertify
|
|
49
49
|
|
50
50
|
def frictionless
|
51
51
|
<<-HTML.squish
|
52
|
-
|
52
|
+
<style> #frame { display: none; } </style>
|
53
53
|
<iframe id="frame" src="about:blank"></iframe>
|
54
54
|
|
55
55
|
<form id="verification-form" action="#{term_url}" method="post">
|
56
|
-
<input type="hidden" id="pares" name="
|
56
|
+
<input type="hidden" id="pares" name="pares"/>
|
57
57
|
<input type="hidden" name="___verify_pares" value="1"/>
|
58
58
|
</form>
|
59
59
|
|