1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-13 08:03:17 +02:00

More billing unit tests

This commit is contained in:
binwiederhier 2023-01-29 16:15:08 -05:00
parent f4c54a1643
commit 00af52411c
5 changed files with 168 additions and 12 deletions

View file

@ -229,6 +229,8 @@ func (s *Server) handleAccountBillingSubscriptionUpdate(w http.ResponseWriter, r
sub, err := s.stripe.GetSubscription(u.Billing.StripeSubscriptionID)
if err != nil {
return err
} else if sub.Items == nil || len(sub.Items.Data) != 1 {
return wrapErrHTTP(errHTTPBadRequestBillingRequestInvalid, "no items, or more than one item")
}
params := &stripe.SubscriptionParams{
CancelAtPeriodEnd: stripe.Bool(false),