Class: Io::Flow::V0::Models::KlarnaSdkAuthorizationResultActionDetails

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

Overview

Provides details for Klarna authorizations (e.g. client secret to be used in the Klarna SDK).

Instance Attribute Summary collapse

Attributes inherited from AuthorizationResultActionDetails

#discriminator

Instance Method Summary collapse

Methods inherited from AuthorizationResultActionDetails

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ KlarnaSdkAuthorizationResultActionDetails

Returns a new instance of KlarnaSdkAuthorizationResultActionDetails.



47793
47794
47795
47796
47797
47798
47799
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47793

def initialize(incoming={})
  super(:discriminator => AuthorizationResultActionDetails::Types::KLARNA_SDK_AUTHORIZATION_RESULT_ACTION_DETAILS)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:client_token, :payment_method_categories], 'KlarnaSdkAuthorizationResultActionDetails')
  @client_token = HttpClient::Preconditions.assert_class('client_token', opts.delete(:client_token), String)
  @payment_method_categories = HttpClient::Preconditions.assert_class('payment_method_categories', opts.delete(:payment_method_categories), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::KlarnaPaymentMethodCategory) ? x : ::Io::Flow::V0::Models::KlarnaPaymentMethodCategory.new(x)) }
end

Instance Attribute Details

#client_tokenObject (readonly)

Returns the value of attribute client_token.



47791
47792
47793
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47791

def client_token
  @client_token
end

#payment_method_categoriesObject (readonly)

Returns the value of attribute payment_method_categories.



47791
47792
47793
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47791

def payment_method_categories
  @payment_method_categories
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



47805
47806
47807
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47805

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

#subtype_to_hashObject



47809
47810
47811
47812
47813
47814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47809

def subtype_to_hash
  {
    :client_token => client_token,
    :payment_method_categories => payment_method_categories.map { |o| o.to_hash }
  }
end

#to_jsonObject



47801
47802
47803
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47801

def to_json
  JSON.dump(to_hash)
end