Class: ProcessOut::PaymentProcessingConfiguration
- Inherits:
-
Object
- Object
- ProcessOut::PaymentProcessingConfiguration
- Defined in:
- lib/processout/payment_processing_configuration.rb
Instance Attribute Summary collapse
-
#apm_payment_config ⇒ Object
Returns the value of attribute apm_payment_config.
-
#bypass_unsupported_split_payments ⇒ Object
Returns the value of attribute bypass_unsupported_split_payments.
Instance Method Summary collapse
-
#fill_with_data(data) ⇒ Object
Fills the object with data coming from the API Params:
data::Hashof data coming from the API. -
#initialize(client, data = {}) ⇒ PaymentProcessingConfiguration
constructor
Initializes the PaymentProcessingConfiguration object Params:
client::ProcessOutclient instancedata:: data that can be used to fill the object. -
#new(data = {}) ⇒ Object
Create a new PaymentProcessingConfiguration using the current client.
-
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
data::Hashof data. -
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want.
Constructor Details
#initialize(client, data = {}) ⇒ PaymentProcessingConfiguration
Initializes the PaymentProcessingConfiguration object Params:
clientProcessOutclient instancedatadata that can be used to fill the object
40 41 42 43 44 45 46 |
# File 'lib/processout/payment_processing_configuration.rb', line 40 def initialize(client, data = {}) @client = client self.bypass_unsupported_split_payments = data.fetch(:bypass_unsupported_split_payments, nil) self.apm_payment_config = data.fetch(:apm_payment_config, nil) end |
Instance Attribute Details
#apm_payment_config ⇒ Object
Returns the value of attribute apm_payment_config.
12 13 14 |
# File 'lib/processout/payment_processing_configuration.rb', line 12 def apm_payment_config @apm_payment_config end |
#bypass_unsupported_split_payments ⇒ Object
Returns the value of attribute bypass_unsupported_split_payments.
11 12 13 |
# File 'lib/processout/payment_processing_configuration.rb', line 11 def bypass_unsupported_split_payments @bypass_unsupported_split_payments end |
Instance Method Details
#fill_with_data(data) ⇒ Object
Fills the object with data coming from the API Params:
dataHashof data coming from the API
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/processout/payment_processing_configuration.rb', line 64 def fill_with_data(data) if data.nil? return self end if data.include? "bypass_unsupported_split_payments" self.bypass_unsupported_split_payments = data["bypass_unsupported_split_payments"] end if data.include? "apm_payment_config" self.apm_payment_config = data["apm_payment_config"] end self end |
#new(data = {}) ⇒ Object
Create a new PaymentProcessingConfiguration using the current client
49 50 51 |
# File 'lib/processout/payment_processing_configuration.rb', line 49 def new(data = {}) PaymentProcessingConfiguration.new(@client, data) end |
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
dataHashof data
81 82 83 84 85 86 87 88 89 |
# File 'lib/processout/payment_processing_configuration.rb', line 81 def prefill(data) if data.nil? return self end self.bypass_unsupported_split_payments = data.fetch(:bypass_unsupported_split_payments, self.bypass_unsupported_split_payments) self.apm_payment_config = data.fetch(:apm_payment_config, self.apm_payment_config) self end |
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want
54 55 56 57 58 59 |
# File 'lib/processout/payment_processing_configuration.rb', line 54 def to_json() { "bypass_unsupported_split_payments": self.bypass_unsupported_split_payments, "apm_payment_config": self.apm_payment_config, }.to_json end |