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.



54769
54770
54771
54772
54773
54774
54775
54776
54777
54778
54779
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54769

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))
  @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.



54767
54768
54769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54767

def approval_url
  @approval_url
end

#payer_emailObject (readonly)

Returns the value of attribute payer_email.



54767
54768
54769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54767

def payer_email
  @payer_email
end

#payer_statusObject (readonly)

Returns the value of attribute payer_status.



54767
54768
54769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54767

def payer_status
  @payer_status
end

#payment_idObject (readonly)

Returns the value of attribute payment_id.



54767
54768
54769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54767

def payment_id
  @payment_id
end

#payment_methodObject (readonly)

Returns the value of attribute payment_method.



54767
54768
54769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54767

def payment_method
  @payment_method
end

#payment_stateObject (readonly)

Returns the value of attribute payment_state.



54767
54768
54769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54767

def payment_state
  @payment_state
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



54785
54786
54787
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54785

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

#subtype_to_hashObject



54789
54790
54791
54792
54793
54794
54795
54796
54797
54798
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54789

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

#to_jsonObject



54781
54782
54783
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54781

def to_json
  JSON.dump(to_hash)
end