1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-23 12:58:04 +02:00

Cont'd Twilio stuff

This commit is contained in:
binwiederhier 2023-05-16 14:15:58 -04:00
parent deb4f24856
commit 7c574d73de
16 changed files with 240 additions and 236 deletions

View file

@ -85,6 +85,15 @@ func (s *Server) ensureAdmin(next handleFunc) handleFunc {
})
}
func (s *Server) ensureCallsEnabled(next handleFunc) handleFunc {
return func(w http.ResponseWriter, r *http.Request, v *visitor) error {
if s.config.TwilioAccount == "" {
return errHTTPNotFound
}
return next(w, r, v)
}
}
func (s *Server) ensurePaymentsEnabled(next handleFunc) handleFunc {
return func(w http.ResponseWriter, r *http.Request, v *visitor) error {
if s.config.StripeSecretKey == "" || s.stripe == nil {