Class: Postfinancecheckout::WebhooksController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Postfinancecheckout::WebhooksController
- Defined in:
- app/controllers/postfinancecheckout/webhooks_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/postfinancecheckout/webhooks_controller.rb', line 5 def create transaction_id = params[:entityId] transaction = Postfinancecheckout::Transaction.find(transaction_id) if transaction.status == 'FULFILL' Postfinancecheckout.config.on_success.call(transaction_id) elsif transaction.status == 'FAILED' || transaction.status == 'VOIDED' || transaction.status == 'DECLINE' Postfinancecheckout.config.on_failure.call(transaction_id) end head :ok end |