diff --git a/lib/revenuecat/revenuecat.go b/lib/revenuecat/revenuecat.go index e034fa5..9a74188 100644 --- a/lib/revenuecat/revenuecat.go +++ b/lib/revenuecat/revenuecat.go @@ -38,7 +38,6 @@ type Subscriber struct { Entitlements map[string]Entitlement `json:"entitlements"` Subscriptions map[string]Subscription `json:"subscriptions"` NonSubscriptions map[string][]NonSubscription `json:"non_subscriptions"` - ManagementURL *string `json:"management_url"` } type Entitlement struct { @@ -72,10 +71,10 @@ const ( type StoreType string const ( - StoreTypeAppStore StoreType = "app_store" - StoreTypePlayStore StoreType = "play_store" - StoreTypeStripe StoreType = "stripe" - StoreTypePromotional StoreType = "promotional" + StoreTypeAppStore StoreType = "app_store" + StoreTypePlay StoreType = "play_store" + StoreTypeStripe StoreType = "stripe" + StoreTypePromo StoreType = "promotional" ) // https://www.revenuecat.com/reference/subscribers @@ -87,19 +86,3 @@ func (c *Client) GetOrCreateSubscriberInfo(ctx context.Context, appUserID string path := fmt.Sprintf("/subscribers/%s", escapedAppUserID) return res, c.client.Do(ctx, "GET", path, nil, nil, &res) } - -func (s *Subscriber) ActiveSubscriptionCount() int { - activeNonSubCount := len(s.NonSubscriptions) // always active - activeSubCount := 0 - now := time.Now() - - for _, e := range s.Entitlements { - if e.ExpiresDate.Before(now) { - continue - } - - activeSubCount++ - } - - return activeNonSubCount + activeSubCount -}