Class: Io::Flow::V0::Models::PaypalAuthorizationDetails

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

Overview

Represents online payment

Instance Attribute Summary collapse

Attributes inherited from OnlineAuthorizationDetails

#discriminator

Instance Method Summary collapse

Methods inherited from OnlineAuthorizationDetails

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ PaypalAuthorizationDetails

Returns a new instance of PaypalAuthorizationDetails.



59355
59356
59357
59358
59359
59360
59361
59362
59363
59364
59365
59366
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59355

def initialize(incoming={})
  super(:discriminator => OnlineAuthorizationDetails::Types::PAYPAL_AUTHORIZATION_DETAILS)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:payment_id], 'PaypalAuthorizationDetails')
  @payment_id = HttpClient::Preconditions.assert_class('payment_id', opts.delete(:payment_id), String)
  @payment_method = (x = opts.delete(:payment_method); x.nil? ? nil : HttpClient::Preconditions.assert_class('payment_method', x, String))
  @payment_state = (x = opts.delete(:payment_state); x.nil? ? nil : HttpClient::Preconditions.assert_class('payment_state', x, String))
  @payer_id = (x = opts.delete(:payer_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('payer_id', x, String))
  @payer_email = (x = opts.delete(:payer_email); x.nil? ? nil : HttpClient::Preconditions.assert_class('payer_email', x, String))
  @payer_status = (x = opts.delete(:payer_status); x.nil? ? nil : HttpClient::Preconditions.assert_class('payer_status', x, String))
  @approval_url = (x = opts.delete(:approval_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('approval_url', x, String))
end

Instance Attribute Details

#approval_urlObject (readonly)

Returns the value of attribute approval_url.



59353
59354
59355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59353

def approval_url
  @approval_url
end

#payer_emailObject (readonly)

Returns the value of attribute payer_email.



59353
59354
59355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59353

def payer_email
  @payer_email
end

#payer_idObject (readonly)

Returns the value of attribute payer_id.



59353
59354
59355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59353

def payer_id
  @payer_id
end

#payer_statusObject (readonly)

Returns the value of attribute payer_status.



59353
59354
59355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59353

def payer_status
  @payer_status
end

#payment_idObject (readonly)

Returns the value of attribute payment_id.



59353
59354
59355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59353

def payment_id
  @payment_id
end

#payment_methodObject (readonly)

Returns the value of attribute payment_method.



59353
59354
59355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59353

def payment_method
  @payment_method
end

#payment_stateObject (readonly)

Returns the value of attribute payment_state.



59353
59354
59355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59353

def payment_state
  @payment_state
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



59372
59373
59374
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59372

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

#subtype_to_hashObject



59376
59377
59378
59379
59380
59381
59382
59383
59384
59385
59386
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59376

def subtype_to_hash
  {
    :payment_id => payment_id,
    :payment_method => payment_method,
    :payment_state => payment_state,
    :payer_id => payer_id,
    :payer_email => payer_email,
    :payer_status => payer_status,
    :approval_url => approval_url
  }
end

#to_jsonObject



59368
59369
59370
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59368

def to_json
  JSON.dump(to_hash)
end