// CancelSubscription cancels a user's subscription purchase. func (c *Client) CancelSubscription(packageName string, subscriptionID string, token string) error { service, err := androidpublisher.New(c.httpClient) if err != nil { return err } ps := androidpublisher.NewPurchasesSubscriptionsService(service) err = ps.Cancel(packageName, subscriptionID, token).Do() return err }
// VerifyProduct verifies product status func (c *Client) VerifyProduct( packageName string, productID string, token string, ) (*androidpublisher.ProductPurchase, error) { service, err := androidpublisher.New(c.httpClient) if err != nil { return nil, err } ps := androidpublisher.NewPurchasesProductsService(service) result, err := ps.Get(packageName, productID, token).Do() return result, err }
// VerifySubscription verifies subscription status func (c *Client) VerifySubscription( packageName string, subscriptionID string, token string, ) (*androidpublisher.SubscriptionPurchase, error) { service, err := androidpublisher.New(c.httpClient) if err != nil { return nil, err } ps := androidpublisher.NewPurchasesSubscriptionsService(service) result, err := ps.Get(packageName, subscriptionID, token).Do() return result, err }