Class: Io::Flow::V0::Models::PaymentMethodDataAuthorizeKlarna

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 = {}) ⇒ PaymentMethodDataAuthorizeKlarna

Returns a new instance of PaymentMethodDataAuthorizeKlarna.



52934
52935
52936
52937
52938
52939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52934

def initialize(incoming={})
  super(:type => PaymentMethodData::Types::PAYMENT_METHOD_DATA_AUTHORIZE_KLARNA)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:result], 'PaymentMethodDataAuthorizeKlarna')
  @result = (x = opts.delete(:result); x.is_a?(::Io::Flow::V0::Models::PaymentMethodDataAuthorizeKlarnaResult) ? x : ::Io::Flow::V0::Models::PaymentMethodDataAuthorizeKlarnaResult.from_json(x))
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



52932
52933
52934
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52932

def result
  @result
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



52945
52946
52947
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52945

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

#subtype_to_hashObject



52949
52950
52951
52952
52953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52949

def subtype_to_hash
  {
    :result => result.to_hash
  }
end

#to_jsonObject



52941
52942
52943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52941

def to_json
  JSON.dump(to_hash)
end