Class: Io::Flow::V0::Models::InlineAuthorizationForm
- Inherits:
-
AuthorizationForm
- Object
- AuthorizationForm
- Io::Flow::V0::Models::InlineAuthorizationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Executes a widget-based payment based on the provided payment method.
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#billing_address ⇒ Object
readonly
Returns the value of attribute billing_address.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#issuer ⇒ Object
readonly
Returns the value of attribute issuer.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Attributes inherited from AuthorizationForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ InlineAuthorizationForm
constructor
A new instance of InlineAuthorizationForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from AuthorizationForm
Constructor Details
#initialize(incoming = {}) ⇒ InlineAuthorizationForm
Returns a new instance of InlineAuthorizationForm.
31002 31003 31004 31005 31006 31007 31008 31009 31010 31011 31012 31013 31014 31015 31016 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31002 def initialize(incoming={}) super(:discriminator => AuthorizationForm::Types::INLINE_AUTHORIZATION_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:method, :order_number, :amount, :currency], 'InlineAuthorizationForm') @method = HttpClient::Preconditions.assert_class('method', opts.delete(:method), String) @issuer = (x = opts.delete(:issuer); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::IssuerReference) ? x : ::Io::Flow::V0::Models::IssuerReference.new(x))) @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) @billing_address = (x = opts.delete(:billing_address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::BillingAddress) ? x : ::Io::Flow::V0::Models::BillingAddress.new(x))) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)) @payload = (x = opts.delete(:payload); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::AuthorizationPayload) ? x : ::Io::Flow::V0::Models::AuthorizationPayload.new(x))) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
31000 31001 31002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31000 def amount @amount end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
31000 31001 31002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31000 def attributes @attributes end |
#billing_address ⇒ Object (readonly)
Returns the value of attribute billing_address.
31000 31001 31002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31000 def billing_address @billing_address end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
31000 31001 31002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31000 def currency @currency end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
31000 31001 31002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31000 def ip @ip end |
#issuer ⇒ Object (readonly)
Returns the value of attribute issuer.
31000 31001 31002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31000 def issuer @issuer end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
31000 31001 31002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31000 def key @key end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
31000 31001 31002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31000 def method @method end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
31000 31001 31002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31000 def order_number @order_number end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
31000 31001 31002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31000 def payload @payload end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
31022 31023 31024 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31022 def copy(incoming={}) InlineAuthorizationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
31026 31027 31028 31029 31030 31031 31032 31033 31034 31035 31036 31037 31038 31039 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31026 def subtype_to_hash { :method => method, :issuer => issuer.nil? ? nil : issuer.to_hash, :order_number => order_number, :amount => amount.to_f.to_s, :currency => currency, :billing_address => billing_address.nil? ? nil : billing_address.to_hash, :key => key, :attributes => attributes.nil? ? nil : attributes, :ip => ip, :payload => payload.nil? ? nil : payload.to_hash } end |
#to_json ⇒ Object
31018 31019 31020 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31018 def to_json JSON.dump(to_hash) end |