class ProcessOut::ThreeDS

Attributes

ares_trans_status[R]
challenged[R]
cres_trans_status[R]
ds_trans_id[R]
fingerprint_completion_indicator[R]
fingerprinted[R]
server_trans_id[R]
status[R]
version[R]

Public Class Methods

new(client, data = {}) click to toggle source

Initializes the ThreeDS object Params:

client

ProcessOut client instance

data

data that can be used to fill the object

# File lib/processout/three_ds.rb, line 63
def initialize(client, data = {})
  @client = client

  self.version = data.fetch(:version, nil)
  self.status = data.fetch(:status, nil)
  self.fingerprinted = data.fetch(:fingerprinted, nil)
  self.challenged = data.fetch(:challenged, nil)
  self.ares_trans_status = data.fetch(:ares_trans_status, nil)
  self.cres_trans_status = data.fetch(:cres_trans_status, nil)
  self.ds_trans_id = data.fetch(:ds_trans_id, nil)
  self.fingerprint_completion_indicator = data.fetch(:fingerprint_completion_indicator, nil)
  self.server_trans_id = data.fetch(:server_trans_id, nil)
  
end

Public Instance Methods

ares_trans_status=(val) click to toggle source
# File lib/processout/three_ds.rb, line 38
def ares_trans_status=(val)
  @ares_trans_status = val
end
challenged=(val) click to toggle source
# File lib/processout/three_ds.rb, line 34
def challenged=(val)
  @challenged = val
end
cres_trans_status=(val) click to toggle source
# File lib/processout/three_ds.rb, line 42
def cres_trans_status=(val)
  @cres_trans_status = val
end
ds_trans_id=(val) click to toggle source
# File lib/processout/three_ds.rb, line 46
def ds_trans_id=(val)
  @ds_trans_id = val
end
fill_with_data(data) click to toggle source

Fills the object with data coming from the API Params:

data

Hash of data coming from the API

# File lib/processout/three_ds.rb, line 101
def fill_with_data(data)
  if data.nil?
    return self
  end
  if data.include? "version"
    self.version = data["version"]
  end
  if data.include? "status"
    self.status = data["status"]
  end
  if data.include? "fingerprinted"
    self.fingerprinted = data["fingerprinted"]
  end
  if data.include? "challenged"
    self.challenged = data["challenged"]
  end
  if data.include? "ares_trans_status"
    self.ares_trans_status = data["ares_trans_status"]
  end
  if data.include? "cres_trans_status"
    self.cres_trans_status = data["cres_trans_status"]
  end
  if data.include? "ds_trans_id"
    self.ds_trans_id = data["ds_trans_id"]
  end
  if data.include? "fingerprint_completion_indicator"
    self.fingerprint_completion_indicator = data["fingerprint_completion_indicator"]
  end
  if data.include? "server_trans_id"
    self.server_trans_id = data["server_trans_id"]
  end
  
  self
end
fingerprint_completion_indicator=(val) click to toggle source
# File lib/processout/three_ds.rb, line 50
def fingerprint_completion_indicator=(val)
  @fingerprint_completion_indicator = val
end
fingerprinted=(val) click to toggle source
# File lib/processout/three_ds.rb, line 30
def fingerprinted=(val)
  @fingerprinted = val
end
new(data = {}) click to toggle source

Create a new ThreeDS using the current client

# File lib/processout/three_ds.rb, line 79
def new(data = {})
  ThreeDS.new(@client, data)
end
prefill(data) click to toggle source

Prefills the object with the data passed as parameters Params:

data

Hash of data

# File lib/processout/three_ds.rb, line 139
def prefill(data)
  if data.nil?
    return self
  end
  self.version = data.fetch(:version, self.version)
  self.status = data.fetch(:status, self.status)
  self.fingerprinted = data.fetch(:fingerprinted, self.fingerprinted)
  self.challenged = data.fetch(:challenged, self.challenged)
  self.ares_trans_status = data.fetch(:ares_trans_status, self.ares_trans_status)
  self.cres_trans_status = data.fetch(:cres_trans_status, self.cres_trans_status)
  self.ds_trans_id = data.fetch(:ds_trans_id, self.ds_trans_id)
  self.fingerprint_completion_indicator = data.fetch(:fingerprint_completion_indicator, self.fingerprint_completion_indicator)
  self.server_trans_id = data.fetch(:server_trans_id, self.server_trans_id)
  
  self
end
server_trans_id=(val) click to toggle source
# File lib/processout/three_ds.rb, line 54
def server_trans_id=(val)
  @server_trans_id = val
end
status=(val) click to toggle source
# File lib/processout/three_ds.rb, line 26
def status=(val)
  @status = val
end
to_json(options) click to toggle source

Overrides the JSON marshaller to only send the fields we want

# File lib/processout/three_ds.rb, line 84
def to_json(options)
  {
      "version": self.version,
      "status": self.status,
      "fingerprinted": self.fingerprinted,
      "challenged": self.challenged,
      "ares_trans_status": self.ares_trans_status,
      "cres_trans_status": self.cres_trans_status,
      "ds_trans_id": self.ds_trans_id,
      "fingerprint_completion_indicator": self.fingerprint_completion_indicator,
      "server_trans_id": self.server_trans_id,
  }.to_json
end
version=(val) click to toggle source
# File lib/processout/three_ds.rb, line 22
def version=(val)
  @version = val
end