stripe
This commit is contained in:
parent
de22166113
commit
6963a88602
5 changed files with 129 additions and 17 deletions
14
main.go
14
main.go
|
|
@ -207,9 +207,15 @@ func main() {
|
|||
if len(os.Args) > 1 {
|
||||
return
|
||||
}
|
||||
server := http.ServeMux{}
|
||||
server.Handle("/", http.FileServer(http.Dir("www")))
|
||||
server.HandleFunc("POST /order/", orders.OrderHandler)
|
||||
|
||||
orders.InitStripe(os.Getenv("STRIPE_SECRET_KEY"))
|
||||
|
||||
mux := http.ServeMux{}
|
||||
|
||||
mux.Handle("/", http.FileServer(http.Dir("www")))
|
||||
mux.HandleFunc("POST /order/", orders.OrderHandler)
|
||||
mux.HandleFunc("POST /webhook", orders.WebhookHandler(os.Getenv("STRIPE_WEBHOOK_SECRET")))
|
||||
|
||||
log.Println("listening on :8000")
|
||||
log.Fatal(http.ListenAndServe(":8000", &server))
|
||||
log.Fatal(http.ListenAndServe(":8000", &mux))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue