Documentation ¶
Index ¶
- type AcknowledgementState
- type CancelReason
- type CancelSurveyReason
- type CancelSurveyResult
- type Client
- func (c *Client) AcknowledgeProduct(pkg, prod, token string, opts ...Option) error
- func (c *Client) AcknowledgeSubscription(pkg, sub, token string, opts ...Option) error
- func (c *Client) CancelSubscription(pkg, sub, token string) error
- func (c *Client) DeferSubscription(pkg, sub, token string, expected, desired int64) (int64, error)
- func (c *Client) GetProduct(pkg, prod, token string) (*Product, error)
- func (c *Client) GetSubscription(pkg, sub, token string) (*Subscription, error)
- func (c *Client) RefundSubscription(pkg, sub, token string) error
- func (c *Client) RevokeSubscription(pkg, sub, token string) error
- type ConsumptionState
- type DeferralInfo
- type DeveloperPayload
- type IntroductoryPriceInfo
- type NewPrice
- type Option
- type PaymentState
- type PriceChange
- type PriceChangeState
- type Product
- type PurchaseState
- type PurchaseType
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcknowledgementState ¶
type AcknowledgementState int
AcknowledgementState is the data type for acknowledgement states.
const ( NotAcknowledged AcknowledgementState = 0 Acknowledged AcknowledgementState = 1 )
List of acknowledgement states.
type CancelReason ¶
type CancelReason int
CancelReason is the data type for cancel reasons.
const ( CRUserCanceled CancelReason = 0 CRSystemCanceled CancelReason = 1 CRReplaced CancelReason = 2 CRDeveloperCanceled CancelReason = 3 )
List of cancel reasons.
type CancelSurveyReason ¶
type CancelSurveyReason int
CancelSurveyReason is the data type for cancel survey reasons.
const ( CSROther CancelSurveyReason = 0 CSRNoUse CancelSurveyReason = 1 CSRTechnicalIssue CancelSurveyReason = 2 CSRCostRelated CancelSurveyReason = 3 CSRFoundBetter CancelSurveyReason = 4 )
List of cancel survey reasons.
type CancelSurveyResult ¶
type CancelSurveyResult struct { Reason CancelSurveyReason `json:"cancelSurveyReason"` UserInput string `json:"userInputCancelReason"` }
CancelSurveyResult is the info provided by the user when they complete the subscription cancellation flow.
type Client ¶
Client provides PlayStore in-app billing API.
func NewClientWithProxy ¶
NewClientWithProxy creates a new PlayStore client with a proxy.
func (*Client) AcknowledgeProduct ¶
AcknowledgeProduct acknowledges purchase of an in-app product.
func (*Client) AcknowledgeSubscription ¶
AcknowledgeSubscription acknowledges a subscription purchase.
func (*Client) CancelSubscription ¶
CancelSubscription cancels a subscription purchase.
func (*Client) DeferSubscription ¶
DeferSubscription defers a subscription purchase.
func (*Client) GetProduct ¶
GetProduct checks the purchase and consumption status of an in-app product.
func (*Client) GetSubscription ¶
func (c *Client) GetSubscription(pkg, sub, token string) (*Subscription, error)
GetSubscription checks the purchase and consumption status of a subscription.
func (*Client) RefundSubscription ¶
RefundSubscription refunds a subscription purchase.
func (*Client) RevokeSubscription ¶
RevokeSubscription revokes a subscription purchase.
type ConsumptionState ¶
type ConsumptionState int
ConsumptionState is the data type for consumption states.
const ( NotConsumed ConsumptionState = 0 Consumed ConsumptionState = 1 )
List of consumption states.
type DeferralInfo ¶
type DeferralInfo struct { ExpectedTimeMillis int64 `json:"expectedExpiryTimeMillis"` DesiredTimeMillis int64 `json:"desiredExpiryTimeMillis"` }
DeferralInfo is the info about the new desired expiry time for the subscription.
type DeveloperPayload ¶
type DeveloperPayload string
DeveloperPayload is the optional developer payload argument.
type IntroductoryPriceInfo ¶
type IntroductoryPriceInfo struct { CurrencyCode string `json:"introductoryPriceCurrencyCode"` AmountMicros int64 `json:"introductoryPriceAmountMicros"` Period string `json:"introductoryPricePeriod"` Cycles int `json:"introductoryPriceCycles"` }
IntroductoryPriceInfo is the introductory price info of a subscription.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is the common type for optional arguments.
type PaymentState ¶
type PaymentState int
PaymentState is the data type for payment states.
const ( PaymentPending PaymentState = 0 PaymentReceived PaymentState = 1 PaymentFreeTrial PaymentState = 2 PaymentDeferred PaymentState = 3 )
List of payment states.
type PriceChange ¶
type PriceChange struct { NewPrice *NewPrice `json:"newPrice"` State PriceChangeState `json:"state"` }
PriceChange is the latest price change info available.
type PriceChangeState ¶
type PriceChangeState int
PriceChangeState is the data type for price change states.
const ( PCOutstanding PriceChangeState = 0 PCAccepted PriceChangeState = 1 )
List of price change states.
type Product ¶
type Product struct { Kind string `json:"kind"` PurchaseTimeMillis int64 `json:"purchaseTimeMillis"` PurchaseState PurchaseState `json:"purchaseState"` ConsumptionState ConsumptionState `json:"consumptionState"` DeveloperPayload string `json:"developerPayload"` OrderID string `json:"orderId"` PurchaseType PurchaseType `json:"purchaseType"` AcknowledgementState AcknowledgementState `json:"acknowledgementState"` }
Product indicates the status of an in-app product purchase.
type PurchaseState ¶
type PurchaseState int
PurchaseState is the data type for purchase states.
const ( PurchaseDone PurchaseState = 0 PurchaseCanceled PurchaseState = 1 PurchasePending PurchaseState = 2 )
List of purchase states.
type PurchaseType ¶
type PurchaseType int
PurchaseType is the data type for purchase types.
const ( PTTest PurchaseType = 0 PTPromo PurchaseType = 1 PTRewarded PurchaseType = 2 )
List of purchase types.
type Subscription ¶
type Subscription struct { Kind string `json:"kind"` StartTimeMillis int64 `json:"startTimeMillis"` ExpiryTimeMillis int64 `json:"expiryTimeMillis"` AutoResumeTimeMillis int64 `json:"autoResumeTimeMillis"` AutoRenewing bool `json:"autoRenewing"` PriceCurrencyCode string `json:"priceCurrencyCode"` PriceAmountMicros int64 `json:"priceAmountMicros"` IntroductoryPriceInfo *IntroductoryPriceInfo `json:"introductoryPriceInfo"` CountryCode string `json:"countryCode"` DeveloperPayload string `json:"developerPayload"` PaymentState PaymentState `json:"paymentState"` CancelReason CancelReason `json:"cancelReason"` UserCancellationTimeMillis int64 `json:"userCancellationTimeMillis"` CancelSurveyResult *CancelSurveyResult `json:"cancelSurveyResult"` OrderID string `json:"orderId"` LinkedPurchaseToken string `json:"linkedPurchaseToken"` PurchaseType PurchaseType `json:"purchaseType"` PriceChange *PriceChange `json:"priceChange"` ProfileName string `json:"profileName"` EmailAddress string `json:"emailAddress"` GivenName string `json:"givenName"` FamilyName string `json:"familyName"` ProfileID string `json:"profileId"` AcknowledgementState AcknowledgementState `json:"acknowledgementState"` }
Subscription indicates the status of a subscription purchase.