Class: FatZebra::ThreeDSecure

Inherits:
APIResource show all
Defined in:
lib/fat_zebra/three_d_secure.rb

Overview

FatZebra ThreeDSecure

Manage 3DS2 authentication for the Cybersource REST API

  • setup

  • enrollment

  • validation

Constant Summary collapse

CHECK_ENROLLMENT_REQUIRED_FIELDS =
i[
  merchant_username
  card_token
  amount
  currency
  reference
  verification
  device_channel
  reference_id
  return_url
  acs_window_size
  browser_accept_content
  browser_language
  browser_java_enabled
  browser_color_depth
  browser_screen_height
  browser_screen_width
  browser_time_difference
  browser_user_agent
].freeze
VALIDATE_AUTHENTICATION_REQUIRED_FIELDS =
i[
  merchant_username
  card_token
  amount
  currency
  authentication_transaction_id
].freeze

Instance Attribute Summary

Attributes inherited from FatZebraObject

#accepted

Attributes included from ObjectHelper

#data, #errors, #raw

Class Method Summary collapse

Methods inherited from APIResource

base_path, request

Methods included from APIHelper

included, #request, #resource_name, #resource_path

Methods inherited from FatZebraObject

initialize_from, #load_response_api, #update_from

Methods included from Validation

#errors, #valid!, #valid?, #validates

Methods included from ObjectHelper

#[], #[]=, #add_accessor, #add_accessors, #add_data, #initialize, #inspect, #keys, #method_missing, #remove_accessor, #to_hash, #to_json, #update_attributes

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class FatZebra::ObjectHelper

Class Method Details

.check_enrollment(params = {}, options = {}) ⇒ FatZebra::ThreeDSecure

Enrols card

Parameters:

  • params (Hash) (defaults to: {})
  • options (Hash) (defaults to: {})

    for the request, and configurations (Optional)

Returns:



84
85
86
87
88
89
# File 'lib/fat_zebra/three_d_secure.rb', line 84

def check_enrollment(params = {}, options = {})
  valid!(params, :check_enrollment) if respond_to?(:valid!)

  response = request(:post, "#{resource_path}/check_enrollment", params, options)
  initialize_from(response)
end

.resource_nameObject



55
56
57
# File 'lib/fat_zebra/three_d_secure.rb', line 55

def resource_name
  'three_d_secure'
end

.resource_pathObject



59
60
61
# File 'lib/fat_zebra/three_d_secure.rb', line 59

def resource_path
  "/sdk/#{resource_name}"
end

.setup(params = {}, options = {}) ⇒ FatZebra::ThreeDSecure

Sets up a 3ds request

Parameters:

  • params (Hash) (defaults to: {})
  • options (Hash) (defaults to: {})

    for the request, and configurations (Optional)

Returns:



70
71
72
73
74
75
# File 'lib/fat_zebra/three_d_secure.rb', line 70

def setup(params = {}, options = {})
  valid!(params, :setup) if respond_to?(:valid!)

  response = request(:post, "#{resource_path}/setup", params, options)
  initialize_from(response)
end

.validate_authentication(params = {}, options = {}) ⇒ FatZebra::ThreeDSecure

Validates card

Parameters:

  • params (Hash) (defaults to: {})
  • options (Hash) (defaults to: {})

    for the request, and configurations (Optional)

Returns:



98
99
100
101
102
103
# File 'lib/fat_zebra/three_d_secure.rb', line 98

def validate_authentication(params = {}, options = {})
  valid!(params, :validate_authentication) if respond_to?(:valid!)

  response = request(:post, "#{resource_path}/validate_authentication", params, options)
  initialize_from(response)
end