Class: Bitsy::V1::BlockchainNotificationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/bitsy/v1/blockchain_notifications_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/bitsy/v1/blockchain_notifications_controller.rb', line 5

def index
  bn = BlockchainNotification.new(blockchain_notification_params)
  if bn.test
    render text: "*ok*", status: 200
  elsif bn.save
    BlockchainNotificationJob.perform_async(bn.id)
    render text: "*ok*", status: 200
  else
    render nothing: true, status: 422
  end
end