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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3bdbf97065fe7c5e0615eb17c0c9549506bb53d5
4
- data.tar.gz: 8463c174a23f0a2bfd861485e2183c987f2cdc21
3
+ metadata.gz: 0013a84a4889ef892ab21688c80ff65e7fb117f1
4
+ data.tar.gz: 026095ceb9a0424a57e8dfd2c4a49d29c1cae807
5
5
  SHA512:
6
- metadata.gz: b52d2be306929c6043fde3f766da1598d6e432e5ca003447ee7eae70eaa46af5238a8bc6c1513dc6f04ef6190dae7dd9ca32eec7690b40d20fc84fe9d9e5bab7
7
- data.tar.gz: 182a76aae54e4f2f1dec3d30d6bddfd567c604dbaad90b50191136b00381608c2daef7249d641a6a72ea014c2582df328cdc0d25bab3b2c75ac9d36dd024e6e9
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
- class InvalidRequestError < StandardError; end
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
- if response.status < 400
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="shared_pares"/>
56
+ <input type="hidden" id="pares" name="pares"/>
57
57
  <input type="hidden" name="___verify_pares" value="1"/>
58
58
  </form>
59
59
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paycertify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - PayCertify Engineering Team