ravelin 0.1.24 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ravelin/event.rb +9 -6
- data/lib/ravelin/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: 2ca30db8a09466a96d2042c91b177bfc4a1478c063cdc848cf80bee5762a9ac4
|
4
|
+
data.tar.gz: 6248744866c0924db62099bf3b2029b0ce8868a1acc4568b60e16c1bf5a27d5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06fe356e63f52fbae095cea6b997950e8990a847cd9c34a168f5a000bf21d981edc8e43834388a4e08def5a643253cac4494761539dd7ee73abbd405282e45db
|
7
|
+
data.tar.gz: 82dd34a7c4e9d9d7018bd2af3c0ce466112289faa1f9d2d6ba4c2986cf39f1b78d6abb31143fda0840e143a2b8687de65d53f80157b10b467d8e3b8d71947170
|
data/lib/ravelin/event.rb
CHANGED
@@ -3,6 +3,7 @@ module Ravelin
|
|
3
3
|
attr_accessor :name, :timestamp, :payload
|
4
4
|
|
5
5
|
def initialize(name:, payload:, timestamp: nil)
|
6
|
+
@internal_name = name
|
6
7
|
@name = convert_event_name(name)
|
7
8
|
@payload = convert_to_ravelin_objects(payload)
|
8
9
|
@timestamp = timestamp.nil? ? Time.now.to_i : convert_to_epoch(timestamp)
|
@@ -45,10 +46,10 @@ module Ravelin
|
|
45
46
|
end
|
46
47
|
|
47
48
|
def format_timestamp(timestamp)
|
48
|
-
case
|
49
|
-
when :
|
49
|
+
case @internal_name
|
50
|
+
when :ato_login
|
50
51
|
timestamp * 1000
|
51
|
-
when :
|
52
|
+
when :ato_reclaim
|
52
53
|
Time.at(timestamp).utc.to_datetime.to_s
|
53
54
|
else
|
54
55
|
timestamp
|
@@ -60,14 +61,14 @@ module Ravelin
|
|
60
61
|
def validate_top_level_payload_params
|
61
62
|
validate_customer_id_presence_on :order, :paymentmethod,
|
62
63
|
:pretransaction, :transaction, :label
|
63
|
-
case
|
64
|
+
case @internal_name
|
64
65
|
when :customer
|
65
66
|
validate_payload_inclusion_of :customer
|
66
67
|
when :voucher
|
67
68
|
validate_payload_inclusion_of :voucher
|
68
69
|
when :'paymentmethod/voucher'
|
69
70
|
validate_payload_inclusion_of :'voucher_redemption'
|
70
|
-
when :
|
71
|
+
when :pre_transaction, :transaction
|
71
72
|
validate_payload_must_include_one_of(
|
72
73
|
:payment_method_id, :payment_method
|
73
74
|
)
|
@@ -76,8 +77,10 @@ module Ravelin
|
|
76
77
|
validate_payload_inclusion_of :customer, :order,
|
77
78
|
:payment_method, :transaction
|
78
79
|
when :login
|
80
|
+
validate_payload_inclusion_of :username, :success, :authentication_mechanism
|
81
|
+
when :ato_login
|
79
82
|
validate_payload_inclusion_of :login
|
80
|
-
when :
|
83
|
+
when :ato_reclaim
|
81
84
|
validate_payload_inclusion_of :customers, :source
|
82
85
|
end
|
83
86
|
end
|
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.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Levy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2020-04-
|
14
|
+
date: 2020-04-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|