Browse files

allow user easily overwrite controller actions

  • Loading branch information...
1 parent d4ee212 commit 57c3cdd7c8070af32fa0f06cb109390b54a86a4a @Paxa committed Dec 3, 2011
Showing with 22 additions and 19 deletions.
  1. +3 −19 app/controllers/robokassa_controller.rb
  2. +19 −0 lib/robokassa/controller.rb
View
22 app/controllers/robokassa_controller.rb
@@ -1,19 +1,3 @@
-class RobokassaController < ActionController::Base
- protect_from_forgery :only => []
-
- def notify
- interface = Robokassa.interface_class.create_by_notification_key params[:notification_key]
- params.delete :notification_key
- render :text => interface.notify(params, self)
- end
-
- def success
- retval = Robokassa.interface_class.success(params, self)
- redirect_to retval if retval.is_a? String
- end
-
- def fail
- retval = Robokassa.interface_class.fail(params, self)
- redirect_to retval if retval.is_a? String
- end
-end
+class RobokassaController < Robokassa::Controller
+
+end
View
19 lib/robokassa/controller.rb
@@ -0,0 +1,19 @@
+class Robokassa::Controller < ActionController::Base
+ protect_from_forgery :only => []
+
+ def notify
+ interface = Robokassa.interface_class.create_by_notification_key params[:notification_key]
+ params.delete :notification_key
+ render :text => interface.notify(params, self)
+ end
+
+ def success
+ retval = Robokassa.interface_class.success(params, self)
+ redirect_to retval if retval.is_a? String
+ end
+
+ def fail
+ retval = Robokassa.interface_class.fail(params, self)
+ redirect_to retval if retval.is_a? String
+ end
+end

0 comments on commit 57c3cdd

Please sign in to comment.