playstore

package
v0.0.0-...-1e8cd38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTimeout

func SetTimeout(t time.Duration)

SetTimeout sets dial timeout duration

func VerifySignature

func VerifySignature(base64EncodedPublicKey string, receipt []byte, signature string) (isValid bool, err error)

VerifySignature verifies in app billing signature. You need to prepare a public key for your Android app's in app billing at https://play.google.com/apps/publish/

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

The Client type implements VerifySubscription method

func New

func New(jsonKey []byte) (Client, error)

New returns http client which includes the credentials to access androidpublisher API. You should create a service account for your project at https://console.developers.google.com and download a JSON key file to set this argument.

func (*Client) CancelSubscription

func (c *Client) CancelSubscription(packageName string, subscriptionID string, token string) error

CancelSubscription cancels a user's subscription purchase.

func (*Client) RefundSubscription

func (c *Client) RefundSubscription(packageName string, subscriptionID string, token string) error

RefundSubscription refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.

func (*Client) RevokeSubscription

func (c *Client) RevokeSubscription(packageName string, subscriptionID string, token string) error

RevokeSubscription refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.

func (*Client) VerifyProduct

func (c *Client) VerifyProduct(
	packageName string,
	productID string,
	token string,
) (*androidpublisher.ProductPurchase, error)

VerifyProduct verifies product status

func (*Client) VerifySubscription

func (c *Client) VerifySubscription(
	packageName string,
	subscriptionID string,
	token string,
) (*androidpublisher.SubscriptionPurchase, error)

VerifySubscription verifies subscription status

type IABClient

type IABClient interface {
	VerifySubscription(string, string, string) (*androidpublisher.SubscriptionPurchase, error)
	VerifyProduct(string, string, string) (*androidpublisher.ProductPurchase, error)
	CancelSubscription(string, string, string) error
	RefundSubscription(string, string, string) error
	RevokeSubscription(string, string, string) error
}

The IABClient type is an interface to verify purchase token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL