ravelin 0.1.26 → 0.1.31

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
  SHA256:
3
- metadata.gz: 1f41610ead5380b5bd446d0029bfaf0d4f1bc6f9781d792da6e78b324702eb83
4
- data.tar.gz: e9f5dd2ad5e40345818305013a948cae9908f46de33155812eecfb8e3c7e3210
3
+ metadata.gz: 524cf8ab5cfa665a3320db7de66f600c1f452abebb02ef08c719af72e15ee9bf
4
+ data.tar.gz: d6bb7d7ddb38ae1c37d31107c2479edb5f0df1c0adebfa669dfc9fa97fc8061e
5
5
  SHA512:
6
- metadata.gz: 9b033087792cdb6ddc94ab27fe3d9cc8b4307a823d6814d93a2706722c2b45d0f3774b8d79549365c352d9da65e2a2b42be8b94bff45a44a18094da1c92d1737
7
- data.tar.gz: ca9e32eaf19d7fffcf050f1e75130c2609c299e1b2d50d20c2c8a66023ca7f0f8815574e8f612db47db699bf7bdb99dcb56ee6402b5eda44dba0331e1b7f3e07
6
+ metadata.gz: 6497b2de2e120a59941d33b856937a01386507c5cd966636ace8803c489c7889d917c6faac2d8b511d6123124a82d33b63fc795e646c63dedb61408d2dca487d
7
+ data.tar.gz: 18c1e336f1bedfc0161e6e2e0ff8c8135fb9a10133702a2c5aeba7407c836a1a5afacec9a061c8e60885ba18a049770c184dc5d9fc2450b666228332c30d0641
@@ -16,6 +16,7 @@ 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'
@@ -0,0 +1,24 @@
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, :gateway
23
+ end
24
+ end
@@ -39,12 +39,23 @@ module Ravelin
39
39
  password: Password,
40
40
  payment_method: PaymentMethod,
41
41
  voucher_redemption: VoucherRedemption,
42
- transaction: name == :pretransaction ? PreTransaction : 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
@@ -73,9 +84,6 @@ module Ravelin
73
84
  :payment_method_id, :payment_method
74
85
  )
75
86
  validate_payload_inclusion_of :order_id
76
- when :checkout
77
- validate_payload_inclusion_of :customer, :order,
78
- :payment_method, :transaction
79
87
  when :login
80
88
  validate_payload_inclusion_of :username, :success, :authentication_mechanism
81
89
  when :ato_login
@@ -15,7 +15,7 @@ module Ravelin
15
15
  @password_hashed = passwd
16
16
  end
17
17
 
18
- FAILURE_REASONS = %w(BAD_PASSWORD UNKNOWN_USERNAME INTERNAL_ERROR RATE_LIMIT)
18
+ FAILURE_REASONS = %w(BAD_PASSWORD UNKNOWN_USERNAME AUTHENTICATION_FAILURE INTERNAL_ERROR RATE_LIMIT BANNED_USER)
19
19
 
20
20
  def validate
21
21
  super
@@ -12,7 +12,8 @@ module Ravelin
12
12
  :tag_names,
13
13
  :tags,
14
14
  :http_status,
15
- :http_body
15
+ :http_body,
16
+ :warnings
16
17
 
17
18
  def initialize(faraday_response)
18
19
  return if faraday_response.body.nil? || faraday_response.body.empty?
@@ -36,6 +37,7 @@ module Ravelin
36
37
  @source = data['source']
37
38
  @comment = data['comment']
38
39
  @customer_id = data['customerId']
40
+ @warnings = data['warnings']
39
41
  end
40
42
 
41
43
  def tag(response_body)
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = "0.1.26"
2
+ VERSION = '0.1.31'
3
3
  end
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.26
4
+ version: 0.1.31
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-05-06 00:00:00.000000000 Z
14
+ date: 2020-11-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -19,28 +19,28 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: '0.17'
22
+ version: '0.15'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '0.17'
29
+ version: '0.15'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: faraday_middleware
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - "~>"
35
35
  - !ruby/object:Gem::Version
36
- version: '0.14'
36
+ version: '0.10'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: '0.14'
43
+ version: '0.10'
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: bundler
46
46
  requirement: !ruby/object:Gem::Requirement
@@ -75,14 +75,14 @@ dependencies:
75
75
  requirements:
76
76
  - - "~>"
77
77
  - !ruby/object:Gem::Version
78
- version: '3.9'
78
+ version: '3.0'
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - "~>"
84
84
  - !ruby/object:Gem::Version
85
- version: '3.9'
85
+ version: '3.0'
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: webmock
88
88
  requirement: !ruby/object:Gem::Requirement
@@ -112,6 +112,7 @@ files:
112
112
  - lib/ravelin/ato_reclaim.rb
113
113
  - lib/ravelin/authentication_mechanism.rb
114
114
  - lib/ravelin/chargeback.rb
115
+ - lib/ravelin/checkout_transaction.rb
115
116
  - lib/ravelin/client.rb
116
117
  - lib/ravelin/customer.rb
117
118
  - lib/ravelin/device.rb