Class: ProcessOut::InvoicesProcessNativePaymentResponse
- Inherits:
-
Object
- Object
- ProcessOut::InvoicesProcessNativePaymentResponse
- Defined in:
- lib/processout/invoices_process_native_payment_response.rb
Instance Attribute Summary collapse
-
#native_apm ⇒ Object
Returns the value of attribute native_apm.
-
#transaction ⇒ Object
Returns the value of attribute transaction.
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.
- Fills the object with data coming from the API Params:
-
#initialize(client, data = {}) ⇒ InvoicesProcessNativePaymentResponse
constructor
- Initializes the InvoicesProcessNativePaymentResponse object Params:
client ProcessOutclient instancedata-
data that can be used to fill the object.
- Initializes the InvoicesProcessNativePaymentResponse object Params:
-
#new(data = {}) ⇒ Object
Create a new InvoicesProcessNativePaymentResponse using the current client.
-
#prefill(data) ⇒ Object
- Prefills the object with the data passed as parameters Params:
data -
Hashof data.
- Prefills the object with the data passed as parameters Params:
-
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want.
Constructor Details
#initialize(client, data = {}) ⇒ InvoicesProcessNativePaymentResponse
Initializes the InvoicesProcessNativePaymentResponse object Params:
client-
ProcessOutclient instance data-
data that can be used to fill the object
52 53 54 55 56 57 58 |
# File 'lib/processout/invoices_process_native_payment_response.rb', line 52 def initialize(client, data = {}) @client = client self.transaction = data.fetch(:transaction, nil) self.native_apm = data.fetch(:native_apm, nil) end |
Instance Attribute Details
#native_apm ⇒ Object
Returns the value of attribute native_apm.
12 13 14 |
# File 'lib/processout/invoices_process_native_payment_response.rb', line 12 def native_apm @native_apm end |
#transaction ⇒ Object
Returns the value of attribute transaction.
11 12 13 |
# File 'lib/processout/invoices_process_native_payment_response.rb', line 11 def transaction @transaction end |
Instance Method Details
#fill_with_data(data) ⇒ Object
Fills the object with data coming from the API Params:
data-
Hashof data coming from the API
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/processout/invoices_process_native_payment_response.rb', line 76 def fill_with_data(data) if data.nil? return self end if data.include? "transaction" self.transaction = data["transaction"] end if data.include? "native_apm" self.native_apm = data["native_apm"] end self end |
#new(data = {}) ⇒ Object
Create a new InvoicesProcessNativePaymentResponse using the current client
61 62 63 |
# File 'lib/processout/invoices_process_native_payment_response.rb', line 61 def new(data = {}) InvoicesProcessNativePaymentResponse.new(@client, data) end |
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
data-
Hashof data
93 94 95 96 97 98 99 100 101 |
# File 'lib/processout/invoices_process_native_payment_response.rb', line 93 def prefill(data) if data.nil? return self end self.transaction = data.fetch(:transaction, self.transaction) self.native_apm = data.fetch(:native_apm, self.native_apm) self end |
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want
66 67 68 69 70 71 |
# File 'lib/processout/invoices_process_native_payment_response.rb', line 66 def to_json() { "transaction": self.transaction, "native_apm": self.native_apm, }.to_json end |