feat(pay): switch checkout counter to SPA redirect + JSON API
- redirect `/pay/checkout-counter/:trade_id` to `/cashier/:trade_id` - add `/pay/checkout-counter-resp/:trade_id` for checkout JSON payload - remove embedded `static` release and keep `www` as the web bundle source - regenerate PWA/www assets and move chain icons to `/www/images/chains`
This commit is contained in:
+9
-1
@@ -27,7 +27,15 @@ func RegisterRoute(e *echo.Echo) {
|
||||
})
|
||||
|
||||
payRoute := e.Group("/pay")
|
||||
payRoute.GET("/checkout-counter/:trade_id", comm.Ctrl.CheckoutCounter)
|
||||
payRoute.GET("/checkout-counter/:trade_id", func(ctx echo.Context) error {
|
||||
tradeId := ctx.Param("trade_id")
|
||||
|
||||
targetURL := fmt.Sprintf("/cashier/%s", tradeId)
|
||||
|
||||
return ctx.Redirect(http.StatusMovedPermanently, targetURL)
|
||||
})
|
||||
|
||||
payRoute.GET("/checkout-counter-resp/:trade_id", comm.Ctrl.CheckoutCounter)
|
||||
payRoute.GET("/check-status/:trade_id", comm.Ctrl.CheckStatus)
|
||||
payRoute.POST("/switch-network", comm.Ctrl.SwitchNetwork)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user