Class: FatZebra::Authenticate

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

Overview

FatZebra Authenticate

Manage 3DS2/SCA authentication for the API

  • session

  • authenticate

  • decode_session

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

.authenticate(params = {}, options = {}) ⇒ FatZebra::Authenticate

Authenticates a 3ds request

Parameters:

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

    for the request, and configurations (Optional)

Returns:



55
56
57
58
59
60
# File 'lib/fat_zebra/authenticate.rb', line 55

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

  response = request(:post, resource_path, params, options)
  initialize_from(response)
end

.decode_session(params = {}, options = {}) ⇒ FatZebra::Authenticate

Decodes a JWT token for the 3DS authentication process

Parameters:

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

    for the request, and configurations (Optional)

Returns:



41
42
43
44
45
46
# File 'lib/fat_zebra/authenticate.rb', line 41

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

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

.session(params = {}, options = {}) ⇒ FatZebra::Authenticate

Returns a JWT token for the 3DS authentication process

Parameters:

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

    for the request, and configurations (Optional)

Returns:



27
28
29
30
31
32
# File 'lib/fat_zebra/authenticate.rb', line 27

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

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