Sha256: 26c5a1bddf378cc3af8ce52762ebae92b12742cc5926eaf3064df8b86c11b034

Contents?: true

Size: 569 Bytes

Versions: 4

Compression:

Stored size: 569 Bytes

Contents

class PaymentNotificationsController < ApplicationController

  # Paypal needs to be able to access this without passing the auth token
  protect_from_forgery :except => [:create]

  unloadable

  def index
    create()
  end

  def create
    begin
      pm = PaymentHandler.create!(:params  => params)
      if pm.accept?
        head :accepted
      else
        Rails.logger.fatal("Failed Transaction for cart_id #{pm.cart_id}: #{pm.errors}")
        head :bad_request
      end
    rescue => e
      Rails.logger.fatal(e)
      head :bad_request
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ecommerce-0.0.6 app/controllers/payment_notifications_controller.rb
ecommerce-0.0.5 app/controllers/payment_notifications_controller.rb
ecommerce-0.0.4 app/controllers/payment_notifications_controller.rb
ecommerce-0.0.3 app/controllers/payment_notifications_controller.rb