Thanks to EdSF for the guidance:
def create
@postback_jwt = JWT.decode(params[:jwt], ENV['GOOGLE_WALLET_SECRET'])
order_id = @postback_jwt["response"]["orderId"]
render :new
response.body = order_id
end
Another option:
def create
@postback_jwt = JWT.decode(params[:jwt], ENV['GOOGLE_WALLET_SECRET'])
order_id = @postback_jwt["response"]["orderId"]
render text: order_id
end
The order of the response and render through me off. The response.body...
line needs to go below the render...
line. Otherwise the render will clear the body. And redirect
doesn't work.
Neither work in development because you can't have a postback to localhost. So testing has to be done on a production/staging server.