I am trying to pass some variables after some processes on my Handler
function. How can I redirect
to a new page an pass some json variables to this new template?
// main package
func main() {
apiRoutes := gin.Default()
apiRoutes.POST("api/ipg/send", controllers.GatewayIpgSendHandler)
apiRoutes.GET("ipg/:token", controllers.GatewayIpgRequestHandler)
// ... rest of the codes
}
// controllers package
func GatewayIpgRequestHandler(context *gin.Context) {
// some processes that lead to these variables.
wage := 123
amount := 13123
redirectUrl := "www.test.com/callback"
// What should I do here to pass those
// three variables above to an existing `custom-view.tmpl` file
// in my `templates` folder.
}
Here is the php(laravel) equivalent of what I want to do.