Class: Io::Flow::V0::Models::CardPaymentSourceAuthorizationForm
- Inherits:
-
AuthorizationForm
- Object
- AuthorizationForm
- Io::Flow::V0::Models::CardPaymentSourceAuthorizationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Creates an authorization for a transaction from a card payment source.
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#browser_info ⇒ Object
readonly
Returns the value of attribute browser_info.
-
#card_payment_source_id ⇒ Object
readonly
Returns the value of attribute card_payment_source_id.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#inline_action_configuration ⇒ Object
readonly
Returns the value of attribute inline_action_configuration.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
Attributes inherited from AuthorizationForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CardPaymentSourceAuthorizationForm
constructor
A new instance of CardPaymentSourceAuthorizationForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from AuthorizationForm
Constructor Details
#initialize(incoming = {}) ⇒ CardPaymentSourceAuthorizationForm
Returns a new instance of CardPaymentSourceAuthorizationForm.
29264 29265 29266 29267 29268 29269 29270 29271 29272 29273 29274 29275 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29264 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 |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
29262 29263 29264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29262 def amount @amount end |
#browser_info ⇒ Object (readonly)
Returns the value of attribute browser_info.
29262 29263 29264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29262 def browser_info @browser_info end |
#card_payment_source_id ⇒ Object (readonly)
Returns the value of attribute card_payment_source_id.
29262 29263 29264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29262 def card_payment_source_id @card_payment_source_id end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
29262 29263 29264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29262 def currency @currency end |
#inline_action_configuration ⇒ Object (readonly)
Returns the value of attribute inline_action_configuration.
29262 29263 29264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29262 def inline_action_configuration @inline_action_configuration end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
29262 29263 29264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29262 def key @key end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
29262 29263 29264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29262 def order_number @order_number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
29281 29282 29283 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29281 def copy(incoming={}) CardPaymentSourceAuthorizationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
29285 29286 29287 29288 29289 29290 29291 29292 29293 29294 29295 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29285 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 ⇒ Object
29277 29278 29279 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29277 def to_json JSON.dump(to_hash) end |