Documentation
¶
Index ¶
Constants ¶
View Source
const ( CancelReasonUnsubscribe = "UNSUBSCRIBE" CancelReasonBillingError = "BILLING_ERROR" CancelReasonDeveloperInitiated = "DEVELOPER_INITIATED" CancelReasonPriceIncrease = "PRICE_INCREASE" CancelReasonCustomerSupport = "CUSTOMER_SUPPORT" CancelReasonSubscriptionPaused = "SUBSCRIPTION_PAUSED" CancelReasonUnknown = "UNKNOWN" )
View Source
const ( EnvironmentSandbox = "SANDBOX" EnvironmentProduction = "PRODUCTION" )
View Source
const ( EventTypeTest = "TEST" EventTypeInitialPurchase = "INITIAL_PURCHASE" EventTypeNonRenewingPurchase = "NON_RENEWING_PURCHASE" EventTypeRenewal = "RENEWAL" EventTypeProductChange = "PRODUCT_CHANGE" EventTypeCancellation = "CANCELLATION" EventTypeUnCancellation = "UNCANCELLATION" EventTypeBillingIssue = "BILLING_ISSUE" EventTypeSubscriberAlias = "SUBSCRIBER_ALIAS" EventTypeSubscriptionPaused = "SUBSCRIPTION_PAUSED" EventTypeTransfer = "TRANSFER" EventTypeExpiration = "EXPIRATION" EventTypeSubscriptionExtended = "SUBSCRIPTION_EXTENDED" EventTypeTemporaryEntitlementGrant = "TEMPORARY_ENTITLEMENT_GRANT" )
View Source
const ( PeriodTypeTrial = "TRIAL" PeriodTypeIntro = "INTRO" PeriodTypeNormal = "NORMAL" PeriodTypePromotional = "PROMOTIONAL" )
View Source
const ( StoreAmazon = "AMAZON" StorePlayStore = "PLAY_STORE" StoreAppStore = "APP_STORE" StoreStripe = "STRIPE" StoreMacAppStore = "MAC_APP_STORE" StorePromotional = "PROMOTIONAL" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entitlement ¶ added in v0.3.1
type Event ¶
type Event struct { ID string `json:"id"` Type eventType `json:"type"` EventTimestampAt milliseconds `json:"event_timestamp_ms"` AppUserID string `json:"app_user_id"` Aliases []string `json:"aliases"` OriginalAppUserID string `json:"original_app_user_id"` ProductID string `json:"product_id"` EntitlementIDs []string `json:"entitlement_ids"` PeriodType periodType `json:"period_type"` PurchasedAt milliseconds `json:"purchased_at_ms"` GracePeriodExpirationAt milliseconds `json:"grace_period_expiration_at_ms"` ExpirationAt milliseconds `json:"expiration_at_ms"` AutoResumeAt milliseconds `json:"auto_resume_at_ms"` Store store `json:"store"` Environment environment `json:"environment"` IsTrialConversion null.Bool `json:"is_trial_conversion"` CancelReason cancelReason `json:"cancel_reason"` ExpirationReason cancelReason `json:"expiration_reason"` NewProductID string `json:"new_product_id"` PresentedOfferingID string `json:"presented_offering_id"` Price price `json:"price"` Currency null.String `json:"currency"` PriceInPurchasedCurrency float32 `json:"price_in_purchased_currency"` TakeHomePercentage float32 `json:"takehome_percentage"` CommissionPercentage float32 `json:"commission_percentage"` SubscriberAttributes subscriberAttributes `json:"subscriber_attributes"` TransactionID string `json:"transaction_id"` OriginalTransactionID string `json:"original_transaction_id"` TransferredFrom []string `json:"transferred_from"` TransferredTo []string `json:"transferred_to"` CountryCode string `json:"country_code"` OfferCode string `json:"offer_code"` }
Event represents an Event of RevenueCat webhook
func (*Event) GetAllRelatedUserID ¶ added in v0.4.0
GetAllRelatedUserID returns a unique id list of AppUserID, OriginalAppUserID, and Aliases.
func (*Event) HasEntitlementID ¶ added in v0.2.6
HasEntitlementID checks whether the id exists or not.
type NonSubscription ¶ added in v0.3.1
type Subscriber ¶ added in v0.3.1
type Subscriber struct { Entitlements map[string]Entitlement `json:"entitlements"` FirstSeen time.Time `json:"first_seen"` LastSeen time.Time `json:"last_seen"` ManagementURL null.String `json:"management_url"` OriginalAppUserID null.String `json:"original_app_user_id"` Subscriptions map[string]Subscription `json:"subscriptions"` NonSubscription map[string][]NonSubscription `json:"non_subscriptions"` }
type SubscriberResponse ¶ added in v0.3.1
type SubscriberResponse struct { RequestDateAt milliseconds `json:"request_date_ms"` Subscriber Subscriber `json:"subscriber"` }
type Subscription ¶ added in v0.3.1
type Subscription struct { ExpiresDate time.Time `json:"expires_date"` GracePeriodExpiresDate null.Time `json:"grace_period_expires_date"` PurchaseDate time.Time `json:"purchase_date"` OriginalPurchaseDate time.Time `json:"original_purchase_date"` PeriodType periodType `json:"period_type"` Store store `json:"store"` IsSandBox bool `json:"is_sandbox"` UnsubscribeDetectedAt null.Time `json:"unsubscribe_detected_at"` BillingIssueDetectedAt null.Time `json:"billing_issue_detected_at"` }
type WebhookEvent ¶
WebhookEvent represents a request body of RevenueCat webhook. https://docs.revenuecat.com/docs/webhooks
Click to show internal directories.
Click to hide internal directories.