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.



57259
57260
57261
57262
57263
57264
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57259

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.



57257
57258
57259
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57257

def result
  @result
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57270
57271
57272
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57270

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

#subtype_to_hashObject



57274
57275
57276
57277
57278
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57274

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

#to_jsonObject



57266
57267
57268
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57266

def to_json
  JSON.dump(to_hash)
end