ravelin 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ravelin.rb +5 -3
- data/lib/ravelin/three_d_secure.rb +29 -0
- data/lib/ravelin/transaction.rb +2 -3
- data/lib/ravelin/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc46a8d84598d37d617b1849c308a07a3a9d6c80
|
4
|
+
data.tar.gz: 89720381c525d4f99fa568cba498d3e9fd686bb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43d94d6e7e32f017c18a5e38aaea8de8fc773fc1d57ca8199a4846ea388c91dbafd7058835de3646f648e009d6eb98f521cf37fafd0bc48fcde33205f849230a
|
7
|
+
data.tar.gz: 173c6e1c612e48f0518720248c308a41c29e8b0098f55a2de8ed86e7aeb0b339f20a3767ca7e465d98716ef0914dfe9de1afac2ddc957fabe728d560e4ad1303
|
data/lib/ravelin.rb
CHANGED
@@ -20,6 +20,7 @@ require 'ravelin/location'
|
|
20
20
|
require 'ravelin/order'
|
21
21
|
require 'ravelin/payment_method'
|
22
22
|
require 'ravelin/pre_transaction'
|
23
|
+
require 'ravelin/three_d_secure'
|
23
24
|
require 'ravelin/transaction'
|
24
25
|
require 'ravelin/voucher'
|
25
26
|
require 'ravelin/voucher_redemption'
|
@@ -36,9 +37,10 @@ module Ravelin
|
|
36
37
|
class << self
|
37
38
|
attr_accessor :faraday_adapter, :faraday_timeout
|
38
39
|
|
39
|
-
def camelize(
|
40
|
-
return '3ds' if
|
41
|
-
|
40
|
+
def camelize(key)
|
41
|
+
return '3ds' if key == :three_d_secure
|
42
|
+
|
43
|
+
key.to_s.gsub(/_(.)/) { Regexp.last_match(1).upcase }
|
42
44
|
end
|
43
45
|
|
44
46
|
def datetime_to_epoch(val)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Ravelin
|
2
|
+
class ThreeDSecure < RavelinObject
|
3
|
+
attr_accessor :attempted,
|
4
|
+
:success,
|
5
|
+
:start_time,
|
6
|
+
:end_time,
|
7
|
+
:timed_out
|
8
|
+
|
9
|
+
def serializable_hash
|
10
|
+
{
|
11
|
+
'attempted' => boolean(attempted),
|
12
|
+
'success' => boolean(success),
|
13
|
+
'startTime' => timestamp(start_time),
|
14
|
+
'endTime' => timestamp(end_time),
|
15
|
+
'timedOut' => boolean(timed_out)
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def boolean(bool)
|
22
|
+
bool || false
|
23
|
+
end
|
24
|
+
|
25
|
+
def timestamp(time)
|
26
|
+
time.to_i
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/ravelin/transaction.rb
CHANGED
@@ -26,9 +26,8 @@ module Ravelin
|
|
26
26
|
:success
|
27
27
|
|
28
28
|
def initialize(params)
|
29
|
-
|
30
|
-
|
31
|
-
self.three_d_secure = three_d_secure_data
|
29
|
+
unless params['3ds'].nil?
|
30
|
+
self.three_d_secure = ThreeDSecure.new(params['3ds'])
|
32
31
|
params.delete('3ds')
|
33
32
|
end
|
34
33
|
|
data/lib/ravelin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ravelin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Levy
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- lib/ravelin/pre_transaction.rb
|
127
127
|
- lib/ravelin/ravelin_object.rb
|
128
128
|
- lib/ravelin/response.rb
|
129
|
+
- lib/ravelin/three_d_secure.rb
|
129
130
|
- lib/ravelin/transaction.rb
|
130
131
|
- lib/ravelin/version.rb
|
131
132
|
- lib/ravelin/voucher.rb
|