Class: ProcessOut::PaymentDataNetworkAuthentication
- Inherits:
-
Object
- Object
- ProcessOut::PaymentDataNetworkAuthentication
- Defined in:
- lib/processout/payment_data_network_authentication.rb
Instance Attribute Summary collapse
-
#cavv ⇒ Object
Returns the value of attribute cavv.
Instance Method Summary collapse
-
#fill_with_data(data) ⇒ Object
- Fills the object with data coming from the API Params:
data
-
Hash
of data coming from the API.
- Fills the object with data coming from the API Params:
-
#initialize(client, data = {}) ⇒ PaymentDataNetworkAuthentication
constructor
- Initializes the PaymentDataNetworkAuthentication object Params:
client
ProcessOut
client instancedata
-
data that can be used to fill the object.
- Initializes the PaymentDataNetworkAuthentication object Params:
-
#new(data = {}) ⇒ Object
Create a new PaymentDataNetworkAuthentication using the current client.
-
#prefill(data) ⇒ Object
- Prefills the object with the data passed as parameters Params:
data
-
Hash
of 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 = {}) ⇒ PaymentDataNetworkAuthentication
Initializes the PaymentDataNetworkAuthentication object Params:
client
-
ProcessOut
client instance data
-
data that can be used to fill the object
23 24 25 26 27 28 |
# File 'lib/processout/payment_data_network_authentication.rb', line 23 def initialize(client, data = {}) @client = client self.cavv = data.fetch(:cavv, nil) end |
Instance Attribute Details
#cavv ⇒ Object
Returns the value of attribute cavv.
11 12 13 |
# File 'lib/processout/payment_data_network_authentication.rb', line 11 def cavv @cavv 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
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/processout/payment_data_network_authentication.rb', line 45 def fill_with_data(data) if data.nil? return self end if data.include? "cavv" self.cavv = data["cavv"] end self end |
#new(data = {}) ⇒ Object
Create a new PaymentDataNetworkAuthentication using the current client
31 32 33 |
# File 'lib/processout/payment_data_network_authentication.rb', line 31 def new(data = {}) PaymentDataNetworkAuthentication.new(@client, data) end |
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
data
-
Hash
of data
59 60 61 62 63 64 65 66 |
# File 'lib/processout/payment_data_network_authentication.rb', line 59 def prefill(data) if data.nil? return self end self.cavv = data.fetch(:cavv, self.cavv) self end |
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want
36 37 38 39 40 |
# File 'lib/processout/payment_data_network_authentication.rb', line 36 def to_json() { "cavv": self.cavv, }.to_json end |