Skip to content

Commit

Permalink
πŸ”„ Sync from monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
mojo-machine[bot] committed Jan 11, 2024
1 parent 062e71a commit 68ea10c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/revenuecat/revenuecat.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type Entitlement struct {
type Subscription struct {
PeriodType PeriodType `json:"period_type"`
UnsubscribeDetectedAt *time.Time `json:"unsubscribe_detected_at"`
Store StoreType `json:"store"`
}

type PeriodType string
Expand All @@ -57,6 +58,20 @@ const (
PeriodTypeNormal PeriodType = "normal"
)

// Possible values for store:
// - app_store: The product was purchased through Apple App Store.
// - play_store: The product was purchased through the Google Play Store.
// - stripe: The product was purchased through Stripe.
// - promotional: The product was granted via RevenueCat.
type StoreType string

const (
StoreTypeAppStore StoreType = "app_store"
StoreTypePlay StoreType = "play_store"
StoreTypeStripe StoreType = "stripe"
StoreTypePromo StoreType = "promotional"
)

// https://www.revenuecat.com/reference/subscribers
// This API either fetches a user or creates one :shrug:
// for now, we only care about the expiry date of the full_access entitlement
Expand Down

0 comments on commit 68ea10c

Please sign in to comment.