lib/helpers/controller_helpers.rb in wepay-rails-0.1.94 vs lib/helpers/controller_helpers.rb in wepay-rails-0.1.95

- old
+ new

@@ -1,10 +1,10 @@ module WepayRails module Helpers module ControllerHelpers - def redirect_to_wepay_for_auth(wepayable_object, scope=wepay_gateway.scope) + def redirect_to_wepay_for_auth(wepayable_object, scope=WepayRails::Configuration.settings[:scope]) redirect_to wepay_gateway.auth_code_url(wepayable_object, scope) end # @deprecated Use wepay_gateway instead of gateway def gateway @@ -29,10 +29,10 @@ def initialize_wepay_access_token(wepayable_object) #auth_code) auth_code = wepayable_object.send(WepayRails::Configuration.wepayable_column.to_sym) session[unique_wepay_access_token_key] = wepay_gateway.access_token(auth_code) return rescue WepayRails::Exceptions::ExpiredTokenError => e - redirect_to_wepay_for_auth(wepay_gateway.scope) and return + redirect_to_wepay_for_auth(wepayable_object, WepayRails::Configuration.settings[:scope]) and return end # Since we are saving the access token in the session, # ensure key uniqueness. Might be a good idea to have this # be a setting in the wepay.yml file. \ No newline at end of file