Class: ProcessOut::PaymentDataThreeDSRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/processout/payment_data_three_ds_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, data = {}) ⇒ PaymentDataThreeDSRequest

Initializes the PaymentDataThreeDSRequest object Params:

client

ProcessOut client instance

data

data that can be used to fill the object



37
38
39
40
41
42
43
44
45
# File 'lib/processout/payment_data_three_ds_request.rb', line 37

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

Instance Attribute Details

#acs_urlObject

Returns the value of attribute acs_url.



10
11
12
# File 'lib/processout/payment_data_three_ds_request.rb', line 10

def acs_url
  @acs_url
end

#mdObject

Returns the value of attribute md.



12
13
14
# File 'lib/processout/payment_data_three_ds_request.rb', line 12

def md
  @md
end

#pareqObject

Returns the value of attribute pareq.



11
12
13
# File 'lib/processout/payment_data_three_ds_request.rb', line 11

def pareq
  @pareq
end

#term_urlObject

Returns the value of attribute term_url.



13
14
15
# File 'lib/processout/payment_data_three_ds_request.rb', line 13

def term_url
  @term_url
end

Instance Method Details

#fill_with_data(data) ⇒ Object

Fills the object with data coming from the API Params:

data

Hash of data coming from the API



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/processout/payment_data_three_ds_request.rb', line 55

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

#new(data = {}) ⇒ Object

Create a new PaymentDataThreeDSRequest using the current client



48
49
50
# File 'lib/processout/payment_data_three_ds_request.rb', line 48

def new(data = {})
  PaymentDataThreeDSRequest.new(@client, data)
end

#prefill(data) ⇒ Object

Prefills the object with the data passed as parameters Params:

data

Hash of data



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/processout/payment_data_three_ds_request.rb', line 78

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