Class: ActiveShipping::CPPWSRegisterResponse

Inherits:
Response
  • Object
show all
Includes:
CPPWSErrorResponse
Defined in:
lib/active_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

Returns a new instance of CPPWSRegisterResponse.



879
880
881
882
883
# File 'lib/active_shipping/carriers/canada_post_pws.rb', line 879

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.



878
879
880
# File 'lib/active_shipping/carriers/canada_post_pws.rb', line 878

def token_id
  @token_id
end

Instance Method Details

#redirect_url(customer_id, return_url) ⇒ Object



885
886
887
# File 'lib/active_shipping/carriers/canada_post_pws.rb', line 885

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