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.



44361
44362
44363
44364
44365
44366
44367
44368
44369
44370
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44361

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_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))
end

Instance Attribute Details

#payer_emailObject (readonly)

Returns the value of attribute payer_email.



44359
44360
44361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44359

def payer_email
  @payer_email
end

#payer_statusObject (readonly)

Returns the value of attribute payer_status.



44359
44360
44361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44359

def payer_status
  @payer_status
end

#payment_idObject (readonly)

Returns the value of attribute payment_id.



44359
44360
44361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44359

def payment_id
  @payment_id
end

#payment_methodObject (readonly)

Returns the value of attribute payment_method.



44359
44360
44361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44359

def payment_method
  @payment_method
end

#payment_stateObject (readonly)

Returns the value of attribute payment_state.



44359
44360
44361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44359

def payment_state
  @payment_state
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



44376
44377
44378
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44376

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

#subtype_to_hashObject



44380
44381
44382
44383
44384
44385
44386
44387
44388
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44380

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

#to_jsonObject



44372
44373
44374
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44372

def to_json
  JSON.dump(to_hash)
end