ravelin 0.1.30 → 0.1.35
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 +2 -0
- data/lib/ravelin/app.rb +27 -0
- data/lib/ravelin/checkout_transaction.rb +34 -0
- data/lib/ravelin/event.rb +12 -1
- data/lib/ravelin/order.rb +6 -1
- data/lib/ravelin/payment_method.rb +2 -1
- data/lib/ravelin/pre_transaction.rb +1 -1
- data/lib/ravelin/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9b21bba5464d226c8e64edc4c0c54df617cc8e5d8fa1ee912c785bb10c21740
|
4
|
+
data.tar.gz: 05e7d7553dca09e35627087d932202cac399b7396d80c1f184c4b7b14f6b95bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45d94fcba79c9bf5b87e221acee409ebed00380f75e6a1760b6686cbab34082caef5241488bc909cca905af8d82a11425264d7c483d1026fba80f012af2a2eb6
|
7
|
+
data.tar.gz: 4c457652bc35747102da1c3c249f57cf1c65aab5d1c7ed8e8fce1a13ccab2f8308e153f343aab5037f6fbd04724983b463ade0afac00ae443c607d4d15cc81b5
|
data/lib/ravelin.rb
CHANGED
@@ -16,12 +16,14 @@ require 'ravelin/authentication_mechanism'
|
|
16
16
|
require 'ravelin/ato_login'
|
17
17
|
require 'ravelin/ato_reclaim'
|
18
18
|
require 'ravelin/chargeback'
|
19
|
+
require 'ravelin/checkout_transaction'
|
19
20
|
require 'ravelin/customer'
|
20
21
|
require 'ravelin/device'
|
21
22
|
require 'ravelin/item'
|
22
23
|
require 'ravelin/location'
|
23
24
|
require 'ravelin/login'
|
24
25
|
require 'ravelin/order'
|
26
|
+
require 'ravelin/app'
|
25
27
|
require 'ravelin/payment_method'
|
26
28
|
require 'ravelin/password'
|
27
29
|
require 'ravelin/pre_transaction'
|
data/lib/ravelin/app.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
module Ravelin
|
2
|
+
class App < RavelinObject
|
3
|
+
attr_accessor :name, :platform, :domain
|
4
|
+
|
5
|
+
PLATFORM_IOS = 'ios'
|
6
|
+
PLATFORM_ANDROID = 'android'
|
7
|
+
PLATFORM_WEB = 'web'
|
8
|
+
PLATFORM_MOBILE_WEB = 'mobile-web'
|
9
|
+
PLATFORM_VALUES = [PLATFORM_IOS, PLATFORM_ANDROID, PLATFORM_WEB, PLATFORM_MOBILE_WEB]
|
10
|
+
|
11
|
+
def validate
|
12
|
+
super
|
13
|
+
|
14
|
+
raise ArgumentError, "Platform value be one of #{PLATFORM_VALUES.join(', ')}" unless App.valid_platform?(platform)
|
15
|
+
raise ArgumentError, 'Domain is not valid' unless App.valid_domain?(domain)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.valid_platform?(platform)
|
19
|
+
platform.nil? || PLATFORM_VALUES.include?(platform)
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.valid_domain?(domain)
|
23
|
+
domain.nil? || /^[a-z0-9\-\\.]+$/.match(domain)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Ravelin
|
2
|
+
# Represents a transaction as used in the checkout endpoint.
|
3
|
+
# As such it can have all the fields of a regular Transaction but only requires the fields of PreTransaction
|
4
|
+
class CheckoutTransaction < RavelinObject
|
5
|
+
attr_accessor :transaction_id,
|
6
|
+
:email,
|
7
|
+
:currency,
|
8
|
+
:debit,
|
9
|
+
:credit,
|
10
|
+
:gateway,
|
11
|
+
:custom,
|
12
|
+
:success,
|
13
|
+
:auth_code,
|
14
|
+
:decline_code,
|
15
|
+
:gateway_reference,
|
16
|
+
:avs_result_code,
|
17
|
+
:cvv_result_code,
|
18
|
+
:type,
|
19
|
+
:time,
|
20
|
+
:three_d_secure
|
21
|
+
|
22
|
+
attr_required :transaction_id, :currency, :debit, :credit
|
23
|
+
|
24
|
+
def initialize(params)
|
25
|
+
unless params['3ds'].nil?
|
26
|
+
self.three_d_secure = ThreeDSecure.new(params['3ds'])
|
27
|
+
params.delete('3ds')
|
28
|
+
end
|
29
|
+
|
30
|
+
super(params)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
data/lib/ravelin/event.rb
CHANGED
@@ -39,12 +39,23 @@ module Ravelin
|
|
39
39
|
password: Password,
|
40
40
|
payment_method: PaymentMethod,
|
41
41
|
voucher_redemption: VoucherRedemption,
|
42
|
-
transaction:
|
42
|
+
transaction: transaction,
|
43
43
|
label: Label,
|
44
44
|
voucher: Voucher,
|
45
45
|
}
|
46
46
|
end
|
47
47
|
|
48
|
+
def transaction
|
49
|
+
case name
|
50
|
+
when :pretransaction
|
51
|
+
PreTransaction
|
52
|
+
when :checkout
|
53
|
+
CheckoutTransaction
|
54
|
+
else
|
55
|
+
Transaction
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
48
59
|
def format_timestamp(timestamp)
|
49
60
|
case @internal_name
|
50
61
|
when :ato_login
|
data/lib/ravelin/order.rb
CHANGED
@@ -13,7 +13,8 @@ module Ravelin
|
|
13
13
|
:custom,
|
14
14
|
:creation_time,
|
15
15
|
:execution_time,
|
16
|
-
:status
|
16
|
+
:status,
|
17
|
+
:app
|
17
18
|
|
18
19
|
attr_required :order_id
|
19
20
|
|
@@ -30,5 +31,9 @@ module Ravelin
|
|
30
31
|
def to=(obj)
|
31
32
|
@to = Ravelin::Location.new(obj)
|
32
33
|
end
|
34
|
+
|
35
|
+
def app=(obj)
|
36
|
+
@app = Ravelin::App.new(obj)
|
37
|
+
end
|
33
38
|
end
|
34
39
|
end
|
data/lib/ravelin/version.rb
CHANGED
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
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.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Levy
|
8
8
|
- Tommy Palmer
|
9
9
|
- Gurkan Oluc
|
10
10
|
- Mathilda Thompson
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-02-17 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|
@@ -108,10 +108,12 @@ extensions: []
|
|
108
108
|
extra_rdoc_files: []
|
109
109
|
files:
|
110
110
|
- lib/ravelin.rb
|
111
|
+
- lib/ravelin/app.rb
|
111
112
|
- lib/ravelin/ato_login.rb
|
112
113
|
- lib/ravelin/ato_reclaim.rb
|
113
114
|
- lib/ravelin/authentication_mechanism.rb
|
114
115
|
- lib/ravelin/chargeback.rb
|
116
|
+
- lib/ravelin/checkout_transaction.rb
|
115
117
|
- lib/ravelin/client.rb
|
116
118
|
- lib/ravelin/customer.rb
|
117
119
|
- lib/ravelin/device.rb
|
@@ -142,7 +144,7 @@ homepage: https://developer.ravelin.com
|
|
142
144
|
licenses:
|
143
145
|
- MIT
|
144
146
|
metadata: {}
|
145
|
-
post_install_message:
|
147
|
+
post_install_message:
|
146
148
|
rdoc_options: []
|
147
149
|
require_paths:
|
148
150
|
- lib
|
@@ -157,9 +159,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
159
|
- !ruby/object:Gem::Version
|
158
160
|
version: '0'
|
159
161
|
requirements: []
|
160
|
-
|
161
|
-
|
162
|
-
signing_key:
|
162
|
+
rubygems_version: 3.0.9
|
163
|
+
signing_key:
|
163
164
|
specification_version: 4
|
164
165
|
summary: Ruby bindings for the Ravelin API
|
165
166
|
test_files: []
|