ravelin 0.1.27 → 0.1.32

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: a86c3a0a082ab501c0119bd3fae5edc0fd9f6d300130c327a4de472434e11150
4
- data.tar.gz: 82285fb4b3d4c973227d4563bb8bc9d8aa4b07fdec45003a632e91c696e09603
3
+ metadata.gz: 57a184f34aa13ef561c8cd0c18d830f8a735dd3da60f70be709063f75fbfe32a
4
+ data.tar.gz: f503c5530a4fbe00aa8664c6bd96278c4c7478eea1af0ebfc55d6bee60bed7d6
5
5
  SHA512:
6
- metadata.gz: a4ed8867be2cc847c3440537e76c2963fd0f1ec855ad1393397c8866782dad7e3b62d97a9b1ba75a642e76e2c233c734102dd2e1fd3c2d1d9f0c22a1a320297c
7
- data.tar.gz: 4557185802dbeccea04b84118d2d86410d8dd3690082567a3f866f8a66231a7a9daafe68da6f223ad5cb20cb845ab45988f28076315dfdf8041a2147ececb779
6
+ metadata.gz: d4f7d17b50ac3a972c322471da46fee99d79019809883ee02fab0543ae04bad6045a8e985fce80652781d146876be5ee25409f12fffd620713defb1baf49eb87
7
+ data.tar.gz: c4d6dca27fca949a8033a4c9daac33df7d333722a2e2e7015cc37910b61662737a2be65c87eac7428209f550d7a117e30fc67bf79ab8758df1eb46701a5e8524
@@ -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
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
@@ -10,6 +10,6 @@ module Ravelin
10
10
  :time,
11
11
  :custom
12
12
 
13
- attr_required :transaction_id, :currency, :debit, :credit, :gateway
13
+ attr_required :transaction_id, :currency, :debit, :credit
14
14
  end
15
15
  end
@@ -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.27"
2
+ VERSION = '0.1.32'
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.27
4
+ version: 0.1.32
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-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -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