Class: Io::Flow::V0::Models::PaymentSourceConfirmationAction

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Represents confirmation details & any additional confirmation actions required to execute the payment.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PaymentSourceConfirmationAction

Returns a new instance of PaymentSourceConfirmationAction.



38757
38758
38759
38760
38761
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38757

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:type], 'PaymentSourceConfirmationAction')
  @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::PaymentSourceConfirmationActionType) ? x : ::Io::Flow::V0::Models::PaymentSourceConfirmationActionType.apply(x))
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



38755
38756
38757
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38755

def type
  @type
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



38767
38768
38769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38767

def copy(incoming={})
  PaymentSourceConfirmationAction.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



38771
38772
38773
38774
38775
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38771

def to_hash
  {
    :type => type.value
  }
end

#to_jsonObject



38763
38764
38765
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38763

def to_json
  JSON.dump(to_hash)
end