Class: Io::Flow::V0::Models::RedirectAuthorizationDetails

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

Overview

Represents an online payment that requires the user to redirect to another site before entering their payment information.

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 = {}) ⇒ RedirectAuthorizationDetails

Returns a new instance of RedirectAuthorizationDetails.



46931
46932
46933
46934
46935
46936
46937
46938
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46931

def initialize(incoming={})
  super(:discriminator => OnlineAuthorizationDetails::Types::REDIRECT_AUTHORIZATION_DETAILS)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :payment_redirect_url], 'RedirectAuthorizationDetails')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @payment_redirect_url = HttpClient::Preconditions.assert_class('payment_redirect_url', opts.delete(:payment_redirect_url), String)
  @confirmation_details = (x = opts.delete(:confirmation_details); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ConfirmationDetails) ? x : ::Io::Flow::V0::Models::ConfirmationDetails.from_json(x)))
end

Instance Attribute Details

#confirmation_detailsObject (readonly)

Returns the value of attribute confirmation_details.



46929
46930
46931
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46929

def confirmation_details
  @confirmation_details
end

#idObject (readonly)

Returns the value of attribute id.



46929
46930
46931
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46929

def id
  @id
end

#payment_redirect_urlObject (readonly)

Returns the value of attribute payment_redirect_url.



46929
46930
46931
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46929

def payment_redirect_url
  @payment_redirect_url
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



46944
46945
46946
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46944

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

#subtype_to_hashObject



46948
46949
46950
46951
46952
46953
46954
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46948

def subtype_to_hash
  {
    :id => id,
    :payment_redirect_url => payment_redirect_url,
    :confirmation_details => confirmation_details.nil? ? nil : confirmation_details.to_hash
  }
end

#to_jsonObject



46940
46941
46942
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46940

def to_json
  JSON.dump(to_hash)
end