Class: Io::Flow::V0::Models::PaymentMethodDataAuthorizeCard

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

Instance Attribute Summary collapse

Attributes inherited from PaymentMethodData

#type

Instance Method Summary collapse

Methods inherited from PaymentMethodData

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ PaymentMethodDataAuthorizeCard

Returns a new instance of PaymentMethodDataAuthorizeCard.



50772
50773
50774
50775
50776
50777
50778
50779
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50772

def initialize(incoming={})
  super(:type => PaymentMethodData::Types::PAYMENT_METHOD_DATA_AUTHORIZE_CARD)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:card_data, :device_fingerprint_details], 'PaymentMethodDataAuthorizeCard')
  @card_data = (x = opts.delete(:card_data); x.is_a?(::Io::Flow::V0::Models::PaymentMethodCard) ? x : ::Io::Flow::V0::Models::PaymentMethodCard.from_json(x))
  @device_fingerprint_details = (x = opts.delete(:device_fingerprint_details); x.is_a?(::Io::Flow::V0::Models::DeviceFingerprintDetails) ? x : ::Io::Flow::V0::Models::DeviceFingerprintDetails.from_json(x))
  @cvv = (x = opts.delete(:cvv); x.nil? ? nil : HttpClient::Preconditions.assert_class('cvv', x, String))
end

Instance Attribute Details

#card_dataObject (readonly)

Returns the value of attribute card_data.



50770
50771
50772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50770

def card_data
  @card_data
end

#cvvObject (readonly)

Returns the value of attribute cvv.



50770
50771
50772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50770

def cvv
  @cvv
end

#device_fingerprint_detailsObject (readonly)

Returns the value of attribute device_fingerprint_details.



50770
50771
50772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50770

def device_fingerprint_details
  @device_fingerprint_details
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50785
50786
50787
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50785

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

#subtype_to_hashObject



50789
50790
50791
50792
50793
50794
50795
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50789

def subtype_to_hash
  {
    :card_data => card_data.to_hash,
    :device_fingerprint_details => device_fingerprint_details.to_hash,
    :cvv => cvv
  }
end

#to_jsonObject



50781
50782
50783
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50781

def to_json
  JSON.dump(to_hash)
end