Make it easy to build without Stripe

This commit is contained in:
binwiederhier
2025-08-07 16:41:39 +02:00
parent 32fa8d43c1
commit ea338ae4fa
11 changed files with 89 additions and 41 deletions

View File

@@ -10,6 +10,7 @@ import (
"errors"
"fmt"
"gopkg.in/yaml.v2"
"heckel.io/ntfy/v2/payments"
"io"
"net"
"net/http"
@@ -165,7 +166,7 @@ func New(conf *Config) (*Server, error) {
mailer = &smtpSender{config: conf}
}
var stripe stripeAPI
if hasStripe && conf.StripeSecretKey != "" {
if payments.Available && conf.StripeSecretKey != "" {
stripe = newStripeAPI()
}
messageCache, err := createMessageCache(conf)