Class: Io::Flow::V0::Models::OnlinePaymentAuthorizationForm

Inherits:
AuthorizationForm show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from AuthorizationForm

#discriminator

Instance Method Summary collapse

Methods inherited from AuthorizationForm

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ OnlinePaymentAuthorizationForm

Returns a new instance of OnlinePaymentAuthorizationForm.



40156
40157
40158
40159
40160
40161
40162
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40156

def initialize(incoming={})
  super(:discriminator => AuthorizationForm::Types::ONLINE_PAYMENT_AUTHORIZATION_FORM)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:payment_id], 'OnlinePaymentAuthorizationForm')
  @payment_id = HttpClient::Preconditions.assert_class('payment_id', opts.delete(:payment_id), String)
  @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String))
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



40154
40155
40156
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40154

def key
  @key
end

#payment_idObject (readonly)

Returns the value of attribute payment_id.



40154
40155
40156
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40154

def payment_id
  @payment_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



40168
40169
40170
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40168

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

#subtype_to_hashObject



40172
40173
40174
40175
40176
40177
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40172

def subtype_to_hash
  {
    :payment_id => payment_id,
    :key => key
  }
end

#to_jsonObject



40164
40165
40166
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40164

def to_json
  JSON.dump(to_hash)
end