fat_zebra 3.3.0 → 3.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61d5be2aa615573ff96504dc32932b0d1915f96bde06606e7aa5e291ecf336e4
4
- data.tar.gz: cc1111774f4c66b3a7f9cc5411c3a2c357bbc1f40ecf9fce63666d7bc58ac771
3
+ metadata.gz: ed04c28bde94b5ce353373db2a99efc8a47383708106045bd4d0a20306cbd6e6
4
+ data.tar.gz: 12cd46f5e61fce90ec6132b2e3d3e99c4a6af8f8a3d933b62eaaf1246cfd415a
5
5
  SHA512:
6
- metadata.gz: fc88c6b404aa10191db0a1c3de5668d2646e3ddb8c3d6c617d247c598f19297195ac9ede54af651e364151b2d0b4c36b15e3739d2dd1bcb5b2e0171c7457d2d6
7
- data.tar.gz: 2c4ea1c3f6f3d95dd9edf695379730c660ef9c4fbf66d7ef211e126dfa4810e6ba2a830a05a113bd2f55180602fe4ce8479490313d97f51b92c146bff0e741f1
6
+ metadata.gz: 38dfa335fff0b1535c46c7165fe51ea889b5e1f7a4cef4183e747ec83767832b8c53c49417068978dbf5b61e2d3ce445462cf6dbf81378f4a5bb594e6c540485
7
+ data.tar.gz: cdde561c6d97ed9a84e08a427b13921450b8c08e0d4f2970f2e0a3cbc0f3f0600b34e03a9f1b97c334789a43a579876da9d6381e41a4fb96dcdb187be0734471
@@ -0,0 +1,106 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FatZebra
4
+ ##
5
+ # == FatZebra \ThreeDSecure
6
+ #
7
+ # Manage 3DS2 authentication for the Cybersource REST API
8
+ #
9
+ # * setup
10
+ # * enrollment
11
+ # * validation
12
+ #
13
+ class ThreeDSecure < APIResource
14
+ validates :card_token, required: true, on: :setup
15
+
16
+ CHECK_ENROLLMENT_REQUIRED_FIELDS = %i[
17
+ merchant_username
18
+ card_token
19
+ amount
20
+ currency
21
+ reference
22
+ verification
23
+ device_channel
24
+ reference_id
25
+ return_url
26
+ acs_window_size
27
+ browser_accept_content
28
+ browser_language
29
+ browser_java_enabled
30
+ browser_color_depth
31
+ browser_screen_height
32
+ browser_screen_width
33
+ browser_time_difference
34
+ browser_user_agent
35
+ ].freeze
36
+
37
+ CHECK_ENROLLMENT_REQUIRED_FIELDS.each do |field|
38
+ validates field, required: true, on: :check_enrollment
39
+ end
40
+
41
+ VALIDATE_AUTHENTICATION_REQUIRED_FIELDS = %i[
42
+ merchant_username
43
+ card_token
44
+ amount
45
+ currency
46
+ authentication_transaction_id
47
+ ].freeze
48
+
49
+ VALIDATE_AUTHENTICATION_REQUIRED_FIELDS.each do |field|
50
+ validates field, required: true, on: :validate_authentication
51
+ end
52
+
53
+ class << self
54
+
55
+ def resource_name
56
+ 'three_d_secure'
57
+ end
58
+
59
+ def resource_path
60
+ "/sdk/#{resource_name}"
61
+ end
62
+
63
+ ##
64
+ # Sets up a 3ds request
65
+ #
66
+ # @param [Hash] params
67
+ # @param [Hash] options for the request, and configurations (Optional)
68
+ #
69
+ # @return [FatZebra::ThreeDSecure]
70
+ def setup(params = {}, options = {})
71
+ valid!(params, :setup) if respond_to?(:valid!)
72
+
73
+ response = request(:post, "#{resource_path}/setup", params, options)
74
+ initialize_from(response)
75
+ end
76
+
77
+ ##
78
+ # Enrols card
79
+ #
80
+ # @param [Hash] params
81
+ # @param [Hash] options for the request, and configurations (Optional)
82
+ #
83
+ # @return [FatZebra::ThreeDSecure]
84
+ def check_enrollment(params = {}, options = {})
85
+ valid!(params, :check_enrollment) if respond_to?(:valid!)
86
+
87
+ response = request(:post, "#{resource_path}/check_enrollment", params, options)
88
+ initialize_from(response)
89
+ end
90
+
91
+ ##
92
+ # Validates card
93
+ #
94
+ # @param [Hash] params
95
+ # @param [Hash] options for the request, and configurations (Optional)
96
+ #
97
+ # @return [FatZebra::ThreeDSecure]
98
+ def validate_authentication(params = {}, options = {})
99
+ valid!(params, :validate_authentication) if respond_to?(:valid!)
100
+
101
+ response = request(:post, "#{resource_path}/validate_authentication", params, options)
102
+ initialize_from(response)
103
+ end
104
+ end
105
+ end
106
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FatZebra
4
- VERSION = '3.3.0'
4
+ VERSION = '3.3.2'
5
5
  end
data/lib/fat_zebra.rb CHANGED
@@ -32,6 +32,7 @@ require 'fat_zebra/purchase'
32
32
  require 'fat_zebra/information'
33
33
  require 'fat_zebra/card'
34
34
  require 'fat_zebra/authenticate'
35
+ require 'fat_zebra/three_d_secure'
35
36
  require 'fat_zebra/refund'
36
37
  require 'fat_zebra/payment_plan'
37
38
  require 'fat_zebra/customer'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_zebra
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fat Zebra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-12 00:00:00.000000000 Z
11
+ date: 2026-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -138,6 +138,7 @@ files:
138
138
  - lib/fat_zebra/request/multipart/param.rb
139
139
  - lib/fat_zebra/request/multipart/part.rb
140
140
  - lib/fat_zebra/request/multipart/stream.rb
141
+ - lib/fat_zebra/three_d_secure.rb
141
142
  - lib/fat_zebra/util.rb
142
143
  - lib/fat_zebra/utilities/apple_pay/domain.rb
143
144
  - lib/fat_zebra/utilities/mastercard/click_to_pay/registration.rb