I'm building a sinatra Ruby app that interacts with Jambool Social Gold API (a virtual currency platform).
After a transaction is complete (the user purchases points) Jambool sends a "postback" to "foo.com/postback?signature=foo".
The API documentation says that it expects an OK response in the body of the postback (after I validate the transaction). I am not sure how to do this, is this for Net::Http class? This is what I've tried so far:
get "/postback" do
signature = params[:signature]
if signature is valid
# HTTP okay here
else
# error
end
end
What is the API expecting as a successful response? and how do I generate it?
UPDATE: The solution is to use the HTTP verb POST and not GET:
post "/postback" do
"OK"
end