Class: ActiveMerchant::Shipping::CPPWSRegisterResponse

Inherits:
Response show all
Includes:
CPPWSErrorResponse
Defined in:
lib/active_shipping/shipping/carriers/canada_post_pws.rb

Instance Attribute Summary collapse

Attributes included from CPPWSErrorResponse

#error_code

Attributes inherited from Response

#message, #params, #request, #test, #xml

Instance Method Summary collapse

Methods included from CPPWSErrorResponse

#handle_error

Methods inherited from Response

#success?, #test?

Constructor Details

#initialize(success, message, params = {}, options = {}) ⇒ CPPWSRegisterResponse


844
845
846
847
848
# File 'lib/active_shipping/shipping/carriers/canada_post_pws.rb', line 844

def initialize(success, message, params = {}, options = {})
  handle_error(message, options)
  super
  @token_id = options[:token_id]
end

Instance Attribute Details

#token_idObject (readonly)

Returns the value of attribute token_id


843
844
845
# File 'lib/active_shipping/shipping/carriers/canada_post_pws.rb', line 843

def token_id
  @token_id
end

Instance Method Details

#redirect_url(customer_id, return_url) ⇒ Object


850
851
852
# File 'lib/active_shipping/shipping/carriers/canada_post_pws.rb', line 850

def redirect_url(customer_id, return_url)
  "http://www.canadapost.ca/cpotools/apps/drc/merchant?return-url=#{CGI::escape(return_url)}&token-id=#{token_id}&platform-id=#{customer_id}"
end