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.

39 lignes
978B

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