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.



25013
25014
25015
25016
25017
25018
25019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25013

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



25011
25012
25013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25011

def id
  @id
end

#payment_redirect_urlObject (readonly)

Returns the value of attribute payment_redirect_url.



25011
25012
25013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25011

def payment_redirect_url
  @payment_redirect_url
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25025
25026
25027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25025

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

#subtype_to_hashObject



25029
25030
25031
25032
25033
25034
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25029

def subtype_to_hash
  {
    :id => id,
    :payment_redirect_url => payment_redirect_url
  }
end

#to_jsonObject



25021
25022
25023
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25021

def to_json
  JSON.dump(to_hash)
end