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.



42901
42902
42903
42904
42905
42906
42907
42908
42909
42910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42901

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.



42899
42900
42901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42899

def payer_email
  @payer_email
end

#payer_statusObject (readonly)

Returns the value of attribute payer_status.



42899
42900
42901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42899

def payer_status
  @payer_status
end

#payment_idObject (readonly)

Returns the value of attribute payment_id.



42899
42900
42901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42899

def payment_id
  @payment_id
end

#payment_methodObject (readonly)

Returns the value of attribute payment_method.



42899
42900
42901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42899

def payment_method
  @payment_method
end

#payment_stateObject (readonly)

Returns the value of attribute payment_state.



42899
42900
42901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42899

def payment_state
  @payment_state
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



42916
42917
42918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42916

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

#subtype_to_hashObject



42920
42921
42922
42923
42924
42925
42926
42927
42928
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42920

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



42912
42913
42914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42912

def to_json
  JSON.dump(to_hash)
end