Class: Spree::AdyenNotificationsController

Inherits:
StoreController
  • Object
show all
Defined in:
app/controllers/spree/adyen_notifications_controller.rb

Instance Method Summary collapse

Instance Method Details

#notifyObject



7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/spree/adyen_notifications_controller.rb', line 7

def notify
  notification = AdyenNotification.build(params)
  notification.save!

  # prevent alteration to associated payment while we're handling the action
  Spree::Adyen::NotificationProcessor.new(notification).process!
  accept
rescue ActiveRecord::RecordNotUnique
  # Notification is a duplicate, ignore it and return a success.
  accept
end