Skip to content

Commit

Permalink
little debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
TeisNP committed Feb 12, 2024
1 parent 3d9c729 commit e3c819a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/billing/service.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package billing

import (
"fmt"
"os"
"strconv"

Expand Down Expand Up @@ -119,6 +120,7 @@ func (s *ServiceImpl) CancelSubscribtion(team *entities.Team) (*stripe.Subscript
// Set Customer on session if already a customer

sub := s.GetCustomerSubscribtion(*team.StripeCustomerID)
fmt.Println(sub.SubscriptionList())
sub.Next()
teamSubscription := sub.Subscription()

Expand Down
7 changes: 5 additions & 2 deletions internal/rest/controllers/teams/billing.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package teams

import (
"fmt"
"net/http"

"github.com/labstack/echo/v4"
Expand Down Expand Up @@ -34,8 +35,10 @@ func (h *Handlers) PostCreateCheckoutSession(c hs.AuthenticatedContext) error {
return echo.ErrInternalServerError
}

teamSubscription := h.BillingService.GetCustomerSubscribtion(*team.StripeCustomerID)
if teamSubscription != nil {
fmt.Println(team)

// teamSubscription := h.BillingService.GetCustomerSubscribtion(*team.StripeCustomerID)
if team.StripeCustomerID != nil {
if req.PriceLookupKey == "FREE" {
_, err := h.BillingService.CancelSubscribtion(team)
if err != nil {
Expand Down

0 comments on commit e3c819a

Please sign in to comment.