class Io::Flow::V0::Models::CardPaymentSourceAuthorizationForm
Creates an authorization for a transaction from a card payment source.
Attributes
amount[R]
browser_info[R]
card_payment_source_id[R]
currency[R]
inline_action_configuration[R]
key[R]
order_number[R]
Public Class Methods
new(incoming={})
click to toggle source
Calls superclass method
Io::Flow::V0::Models::AuthorizationForm::new
# File lib/flow_commerce/flow_api_v0_client.rb, line 33538 def initialize(incoming={}) super(:discriminator => AuthorizationForm::Types::CARD_PAYMENT_SOURCE_AUTHORIZATION_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:card_payment_source_id, :order_number, :amount, :currency], 'CardPaymentSourceAuthorizationForm') @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) @card_payment_source_id = HttpClient::Preconditions.assert_class('card_payment_source_id', opts.delete(:card_payment_source_id), String) @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String) @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @browser_info = (x = opts.delete(:browser_info); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::BrowserInfo) ? x : ::Io::Flow::V0::Models::BrowserInfo.new(x))) @inline_action_configuration = (x = opts.delete(:inline_action_configuration); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::InlineActionConfiguration) ? x : ::Io::Flow::V0::Models::InlineActionConfiguration.from_json(x))) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 33555 def copy(incoming={}) CardPaymentSourceAuthorizationForm.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 33559 def subtype_to_hash { :key => key, :card_payment_source_id => card_payment_source_id, :order_number => order_number, :amount => amount.to_f.to_s, :currency => currency, :browser_info => browser_info.nil? ? nil : browser_info.to_hash, :inline_action_configuration => inline_action_configuration.nil? ? nil : inline_action_configuration.to_hash } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 33551 def to_json JSON.dump(to_hash) end