class Io::Flow::V0::Models::ActionUseSdkKlarnaV1

Use the Klarna SDK v1 and load the widgets for payment method categories. After the decision has been made, the payment request will be updated asynchronously. x.klarnacdn.net/kp/lib/v1/index.html

Attributes

client_token[R]
expires_at[R]
payment_method_categories[R]

Public Class Methods

new(incoming={}) click to toggle source
Calls superclass method Io::Flow::V0::Models::Action::new
# File lib/flow_commerce/flow_api_v0_client.rb, line 29344
def initialize(incoming={})
  super(:type => Action::Types::ACTION_USE_SDK_KLARNA_V1)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:client_token, :payment_method_categories], 'ActionUseSdkKlarnaV1')
  @expires_at = (x = opts.delete(:expires_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @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::KlarnaPaymentCategory) ? x : ::Io::Flow::V0::Models::KlarnaPaymentCategory.new(x)) }
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 29357
def copy(incoming={})
  ActionUseSdkKlarnaV1.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 29361
def subtype_to_hash
  {
    :expires_at => expires_at,
    :client_token => client_token,
    :payment_method_categories => payment_method_categories.map { |o| o.to_hash }
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 29353
def to_json
  JSON.dump(to_hash)
end