I have a rails application that calls an external API for payments. The service providing this API sends back response through a callback that i passed in the initial request. However, i want this response to be reflected back on the users front-end (browser) which I'm using react. Problem is i don't know how to connect the callback to the user front-end. Example code is as shown.
class PaymentsController < ActionController::API
def pay
# Payment call that includes my callback
end
def callback
# When payment is successful, this route is hit successfully
result = params[:Body]
# What i want to do is inform the user that payment is successful
end
end