ravelin 0.1.28 → 0.1.33

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: 6311b8f4b624762ec856e92a43207d2bcffbdb284e1dde212af6edb284eca21b
4
- data.tar.gz: 7088ed05f2cc0df433a29dc7f35f2fe4e47cbe44c6429a6a47973026a74bad12
3
+ metadata.gz: 1e21817ff2cec66a582b1e4fbe3123cfa3f58e0d6645d05eb71b93c1d9079cad
4
+ data.tar.gz: be656f247d59729f0c82332ce6dc133ecaa680d609cac7d0c14c6e54e2403a97
5
5
  SHA512:
6
- metadata.gz: af47ac86f410ac8108b0ec8183b8c4b923bf59483d2e2f8326297961db10ee0ffbe4ebf926d495bc3d07ecc76e4a952864024d683110ad75cc6acef8f415d72a
7
- data.tar.gz: c6909ab3a1caf6f46c296b847af0e1c37ad7c0e5946ecb323ecc54c2d00941f3e7a5fcf10428aea8776da32b9bfd245979737a468caf66d0619256f75bf985e7
6
+ metadata.gz: 1c362ba755c944f70105ab188e407af5daf085b3292a21454438408aed3954e071f1d79d6ac8f3ddbda13c67b4547771813545ebdb51a5cb7d4e1b94aa1bf382
7
+ data.tar.gz: c751c7d82c51b62378d01f429a3af52be9067ba8e354384a186273522589813b2f6cb8b9e7cc14a519ad0a63972eef4d5bcc00a3e0428c5bc1ea45e7b37484ea
@@ -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,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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = "0.1.28"
2
+ VERSION = '0.1.33'
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.28
4
+ version: 0.1.33
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-19 00:00:00.000000000 Z
14
+ date: 2020-11-19 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