Class: Io::Flow::V0::Models::MerchantOfRecordAuthorizationForm
- Inherits:
-
AuthorizationForm
- Object
- AuthorizationForm
- Io::Flow::V0::Models::MerchantOfRecordAuthorizationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Creates an authorization for a transaction for which Flow is the merchant of record. In this case, you must provide your order number for a valid Flow order. An authorization is used to check and reserve funds w/ a given payment method. No funds are actually transferred; once you have you an authorization, you can capture up to the amount of the authorization
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#browser_info ⇒ Object
readonly
Returns the value of attribute browser_info.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#cvv ⇒ Object
readonly
Returns the value of attribute cvv.
-
#installment_program_id ⇒ Object
readonly
Returns the value of attribute installment_program_id.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#redirect_urls ⇒ Object
readonly
Returns the value of attribute redirect_urls.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Attributes inherited from AuthorizationForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ MerchantOfRecordAuthorizationForm
constructor
A new instance of MerchantOfRecordAuthorizationForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from AuthorizationForm
Constructor Details
#initialize(incoming = {}) ⇒ MerchantOfRecordAuthorizationForm
Returns a new instance of MerchantOfRecordAuthorizationForm.
36441 36442 36443 36444 36445 36446 36447 36448 36449 36450 36451 36452 36453 36454 36455 36456 36457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36441 def initialize(incoming={}) super(:discriminator => AuthorizationForm::Types::MERCHANT_OF_RECORD_AUTHORIZATION_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:token, :order_number], 'MerchantOfRecordAuthorizationForm') @token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String) @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String) @amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal)) @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) @cvv = (x = opts.delete(:cvv); x.nil? ? nil : HttpClient::Preconditions.assert_class('cvv', 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)) = (x = opts.delete(:options); x.nil? ? nil : HttpClient::Preconditions.assert_class('options', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AuthorizationOption) ? x : ::Io::Flow::V0::Models::AuthorizationOption.apply(x)) }) @redirect_urls = (x = opts.delete(:redirect_urls); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PostPaymentRedirectUrls) ? x : ::Io::Flow::V0::Models::PostPaymentRedirectUrls.new(x))) @installment_program_id = (x = opts.delete(:installment_program_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('installment_program_id', x, 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))) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def amount @amount end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def attributes @attributes end |
#browser_info ⇒ Object (readonly)
Returns the value of attribute browser_info.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def browser_info @browser_info end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def currency @currency end |
#cvv ⇒ Object (readonly)
Returns the value of attribute cvv.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def cvv @cvv end |
#installment_program_id ⇒ Object (readonly)
Returns the value of attribute installment_program_id.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def installment_program_id @installment_program_id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def ip @ip end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def key @key end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def order_number @order_number end |
#redirect_urls ⇒ Object (readonly)
Returns the value of attribute redirect_urls.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def redirect_urls @redirect_urls end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
36439 36440 36441 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36439 def token @token end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36463 36464 36465 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36463 def copy(incoming={}) MerchantOfRecordAuthorizationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
36467 36468 36469 36470 36471 36472 36473 36474 36475 36476 36477 36478 36479 36480 36481 36482 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36467 def subtype_to_hash { :token => token, :order_number => order_number, :amount => amount.to_f.to_s, :currency => currency, :key => key, :cvv => cvv, :attributes => attributes.nil? ? nil : attributes, :ip => ip, :options => .nil? ? nil : .map { |o| o.value }, :redirect_urls => redirect_urls.nil? ? nil : redirect_urls.to_hash, :installment_program_id => installment_program_id, :browser_info => browser_info.nil? ? nil : browser_info.to_hash } end |
#to_json ⇒ Object
36459 36460 36461 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36459 def to_json JSON.dump(to_hash) end |