Permalink
Browse files

Added more logic to the show method

  • Loading branch information...
1 parent 3f1100d commit cd38de048701f8629e0cd50fc72ea8821039ca34 @dwilkie committed Jan 29, 2011
@@ -22,13 +22,18 @@ def show
if @paypal_authentication.token_param_valid?
@paypal_authentication.get_authentication_details!
else
+ @paypal_authentication.destroy
url = new_paypal_authentication_path(resource_name)
end
else
url = @paypal_authentication.remote_url
end
end
else
+ set_flash_message(
+ :error,
+ :something_went_wrong_when_contacting_paypal
+ ) if session[:paypal_authentication_id]
url = new_paypal_authentication_path(resource_name)
end
redirect_to url if url
@@ -5,7 +5,8 @@ class Devise::PaypalAuthentication < ActiveRecord::Base
serialize :params
validates :token,
- :uniqueness => true
+ :uniqueness => true,
+ :allow_nil => true
def get_authentication_token!(permissions = {})
self.update_attributes!(
View
@@ -1,6 +1,5 @@
en:
devise:
- paypal_authable:
- success: "Successfully authorized from Paypal account."
- failure: "Unable to authorize you from Paypal account."
+ paypal_authentications:
+ something_went_wrong_when_contacting_paypal: "Sorry something went wrong when contacting Paypal. Please try again in a few minutes."

0 comments on commit cd38de0

Please sign in to comment.