Class: ProcessOut::APMPaymentProcessingConfiguration
- Inherits:
-
Object
- Object
- ProcessOut::APMPaymentProcessingConfiguration
- Defined in:
- lib/processout/apm_payment_processing_configuration.rb
Instance Attribute Summary collapse
-
#preferred_finalization_mode ⇒ Object
Returns the value of attribute preferred_finalization_mode.
-
#return_redirect_type ⇒ Object
Returns the value of attribute return_redirect_type.
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 = {}) ⇒ APMPaymentProcessingConfiguration
constructor
Initializes the APMPaymentProcessingConfiguration object Params:
client::ProcessOutclient instancedata:: data that can be used to fill the object. -
#new(data = {}) ⇒ Object
Create a new APMPaymentProcessingConfiguration 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 = {}) ⇒ APMPaymentProcessingConfiguration
Initializes the APMPaymentProcessingConfiguration object Params:
clientProcessOutclient instancedatadata that can be used to fill the object
28 29 30 31 32 33 34 |
# File 'lib/processout/apm_payment_processing_configuration.rb', line 28 def initialize(client, data = {}) @client = client self.return_redirect_type = data.fetch(:return_redirect_type, nil) self.preferred_finalization_mode = data.fetch(:preferred_finalization_mode, nil) end |
Instance Attribute Details
#preferred_finalization_mode ⇒ Object
Returns the value of attribute preferred_finalization_mode.
12 13 14 |
# File 'lib/processout/apm_payment_processing_configuration.rb', line 12 def preferred_finalization_mode @preferred_finalization_mode end |
#return_redirect_type ⇒ Object
Returns the value of attribute return_redirect_type.
11 12 13 |
# File 'lib/processout/apm_payment_processing_configuration.rb', line 11 def return_redirect_type @return_redirect_type 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
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/processout/apm_payment_processing_configuration.rb', line 52 def fill_with_data(data) if data.nil? return self end if data.include? "return_redirect_type" self.return_redirect_type = data["return_redirect_type"] end if data.include? "preferred_finalization_mode" self.preferred_finalization_mode = data["preferred_finalization_mode"] end self end |
#new(data = {}) ⇒ Object
Create a new APMPaymentProcessingConfiguration using the current client
37 38 39 |
# File 'lib/processout/apm_payment_processing_configuration.rb', line 37 def new(data = {}) APMPaymentProcessingConfiguration.new(@client, data) end |
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
dataHashof data
69 70 71 72 73 74 75 76 77 |
# File 'lib/processout/apm_payment_processing_configuration.rb', line 69 def prefill(data) if data.nil? return self end self.return_redirect_type = data.fetch(:return_redirect_type, self.return_redirect_type) self.preferred_finalization_mode = data.fetch(:preferred_finalization_mode, self.preferred_finalization_mode) 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/apm_payment_processing_configuration.rb', line 42 def to_json() { "return_redirect_type": self.return_redirect_type, "preferred_finalization_mode": self.preferred_finalization_mode, }.to_json end |