Class: ProcessOut::UnsupportedFeatureBypass

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Initializes the UnsupportedFeatureBypass object Params:

client

ProcessOut client instance

data

data that can be used to fill the object



28
29
30
31
32
33
34
# File 'lib/processout/unsupported_feature_bypass.rb', line 28

def initialize(client, data = {})
  @client = client

  self.incremental_authorization = data.fetch(:incremental_authorization, nil)
  self.split_payments = data.fetch(:split_payments, nil)
  
end

Instance Attribute Details

#incremental_authorizationObject

Returns the value of attribute incremental_authorization.



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

def incremental_authorization
  @incremental_authorization
end

#split_paymentsObject

Returns the value of attribute split_payments.



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

def split_payments
  @split_payments
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



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/processout/unsupported_feature_bypass.rb', line 52

def fill_with_data(data)
  if data.nil?
    return self
  end
  if data.include? "incremental_authorization"
    self.incremental_authorization = data["incremental_authorization"]
  end
  if data.include? "split_payments"
    self.split_payments = data["split_payments"]
  end
  
  self
end

#new(data = {}) ⇒ Object

Create a new UnsupportedFeatureBypass using the current client



37
38
39
# File 'lib/processout/unsupported_feature_bypass.rb', line 37

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

#prefill(data) ⇒ Object

Prefills the object with the data passed as parameters Params:

data

Hash of data



69
70
71
72
73
74
75
76
77
# File 'lib/processout/unsupported_feature_bypass.rb', line 69

def prefill(data)
  if data.nil?
    return self
  end
  self.incremental_authorization = data.fetch(:incremental_authorization, self.incremental_authorization)
  self.split_payments = data.fetch(:split_payments, self.split_payments)
  
  self
end

#to_json(options) ⇒ Object

Overrides the JSON marshaller to only send the fields we want



42
43
44
45
46
47
# File 'lib/processout/unsupported_feature_bypass.rb', line 42

def to_json(options)
  {
      "incremental_authorization": self.incremental_authorization,
      "split_payments": self.split_payments,
  }.to_json
end