Class: Io::Flow::V0::Models::ActionUseSdkStripeV3

Inherits:
Action
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Use the Stripe SDK v3 and handleCardAction. After the decision has been made, the payment request will be updated asynchronously. stripe.com/docs/js/payment_intents/handle_card_action

Instance Attribute Summary collapse

Attributes inherited from Action

#type

Instance Method Summary collapse

Methods inherited from Action

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ActionUseSdkStripeV3

Returns a new instance of ActionUseSdkStripeV3.



29412
29413
29414
29415
29416
29417
29418
29419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29412

def initialize(incoming={})
  super(:type => Action::Types::ACTION_USE_SDK_STRIPE_V3)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:client_secret, :publishable_key], 'ActionUseSdkStripeV3')
  @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_secret = HttpClient::Preconditions.assert_class('client_secret', opts.delete(:client_secret), String)
  @publishable_key = HttpClient::Preconditions.assert_class('publishable_key', opts.delete(:publishable_key), String)
end

Instance Attribute Details

#client_secretObject (readonly)

Returns the value of attribute client_secret.



29410
29411
29412
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29410

def client_secret
  @client_secret
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



29410
29411
29412
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29410

def expires_at
  @expires_at
end

#publishable_keyObject (readonly)

Returns the value of attribute publishable_key.



29410
29411
29412
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29410

def publishable_key
  @publishable_key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29425
29426
29427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29425

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

#subtype_to_hashObject



29429
29430
29431
29432
29433
29434
29435
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29429

def subtype_to_hash
  {
    :expires_at => expires_at,
    :client_secret => client_secret,
    :publishable_key => publishable_key
  }
end

#to_jsonObject



29421
29422
29423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29421

def to_json
  JSON.dump(to_hash)
end