Skip to content

Commit

Permalink
Added a few comments. Not sure if the second lot is technically corre…
Browse files Browse the repository at this point in the history
…ct...
  • Loading branch information
kmclellan committed Sep 2, 2012
1 parent 3081037 commit 77b6679
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/controllers/notifications_controller.rb
Expand Up @@ -3,7 +3,14 @@ class NotificationsController < InheritedResources::Base
actions :create

def create
#(See SagePayTransaction model)
# The following takes the notification params returned from SagePay
# it saves them in the database table: Sage_Pay_Transactions
# and returns the notification params as sage_pay_transaction
sage_pay_transaction = SagePayTransaction.record_notification_from_params(params)
#(See SagePayTransaction model)
# Takes notification params from above
# The following returns a response to SagePay with a URL to payment/action where action is pay,defer,release etc (from SagePayTransactionsController)
render :text => sage_pay_transaction.response(payment_url(sage_pay_transaction.payment))
rescue Exception => e
render :text => SagePay::Server::NotificationResponse.new(:status => :error, :status_detail => "An error occurred: #{e.message}", :redirect_url => payments_url).response
Expand Down

0 comments on commit 77b6679

Please sign in to comment.