class ProcessOut::PaymentDataThreeDSRequest

Attributes

acs_url[R]
md[R]
pareq[R]
term_url[R]

Public Class Methods

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

Initializes the PaymentDataThreeDSRequest object Params:

client

ProcessOut client instance

data

data that can be used to fill the object

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

  self.acs_url = data.fetch(:acs_url, nil)
  self.pareq = data.fetch(:pareq, nil)
  self.md = data.fetch(:md, nil)
  self.term_url = data.fetch(:term_url, nil)
  
end

Public Instance Methods

acs_url=(val) click to toggle source
# File lib/processout/payment_data_three_ds_request.rb, line 17
def acs_url=(val)
  @acs_url = 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/payment_data_three_ds_request.rb, line 66
def fill_with_data(data)
  if data.nil?
    return self
  end
  if data.include? "acs_url"
    self.acs_url = data["acs_url"]
  end
  if data.include? "pareq"
    self.pareq = data["pareq"]
  end
  if data.include? "md"
    self.md = data["md"]
  end
  if data.include? "term_url"
    self.term_url = data["term_url"]
  end
  
  self
end
md=(val) click to toggle source
# File lib/processout/payment_data_three_ds_request.rb, line 25
def md=(val)
  @md = val
end
new(data = {}) click to toggle source

Create a new PaymentDataThreeDSRequest using the current client

# File lib/processout/payment_data_three_ds_request.rb, line 49
def new(data = {})
  PaymentDataThreeDSRequest.new(@client, data)
end
pareq=(val) click to toggle source
# File lib/processout/payment_data_three_ds_request.rb, line 21
def pareq=(val)
  @pareq = val
end
prefill(data) click to toggle source

Prefills the object with the data passed as parameters Params:

data

Hash of data

# File lib/processout/payment_data_three_ds_request.rb, line 89
def prefill(data)
  if data.nil?
    return self
  end
  self.acs_url = data.fetch(:acs_url, self.acs_url)
  self.pareq = data.fetch(:pareq, self.pareq)
  self.md = data.fetch(:md, self.md)
  self.term_url = data.fetch(:term_url, self.term_url)
  
  self
end
term_url=(val) click to toggle source
# File lib/processout/payment_data_three_ds_request.rb, line 29
def term_url=(val)
  @term_url = val
end
to_json(options) click to toggle source

Overrides the JSON marshaller to only send the fields we want

# File lib/processout/payment_data_three_ds_request.rb, line 54
def to_json(options)
  {
      "acs_url": self.acs_url,
      "pareq": self.pareq,
      "md": self.md,
      "term_url": self.term_url,
  }.to_json
end