payment gateway for rpn cn
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

38 lignes
932B

  1. package main
  2. import (
  3. "log"
  4. "net/http"
  5. "text/template"
  6. )
  7. func main() {
  8. //readConfig()
  9. readConfigForTest()
  10. http.HandleFunc("/choosePayment", choosePayment)
  11. http.HandleFunc("/rpnNameAndCard", rpnNameAndCard)
  12. http.HandleFunc("/rpn_notify", rpnNotify) //called by rpn
  13. // http.HandleFunc("/", Index)
  14. // http.HandleFunc("/show", Show)
  15. // http.HandleFunc("/new", New)
  16. // http.HandleFunc("/edit", Edit)
  17. // http.HandleFunc("/insert", Insert)
  18. // http.HandleFunc("/update", Update)
  19. // http.HandleFunc("/delete", Delete)
  20. fs := wrapHandler(http.FileServer(http.Dir("./PG")))
  21. http.HandleFunc("/", fs)
  22. http.ListenAndServe(":8080", nil)
  23. log.Println("Server started on: http://localhost:8080")
  24. }
  25. func errPage(w http.ResponseWriter, code int, msg string) {
  26. var data struct {
  27. ErrorMessage string
  28. }
  29. data.ErrorMessage = msg
  30. w.WriteHeader(code)
  31. t := template.Must(template.ParseFiles("PG/error.html"))
  32. t.Execute(w, data)
  33. }