Documentation ¶
Index ¶
- func SetTimeout(t time.Duration)
- func VerifySignature(base64EncodedPublicKey string, receipt []byte, signature string) (isValid bool, err error)
- type Client
- func (c *Client) CancelSubscription(packageName string, subscriptionID string, token string) error
- func (c *Client) RefundSubscription(packageName string, subscriptionID string, token string) error
- func (c *Client) RevokeSubscription(packageName string, subscriptionID string, token string) error
- func (c *Client) VerifyProduct(packageName string, productID string, token string) (*androidpublisher.ProductPurchase, error)
- func (c *Client) VerifySubscription(packageName string, subscriptionID string, token string) (*androidpublisher.SubscriptionPurchase, error)
- type IABClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 ¶
CancelSubscription cancels a user's subscription purchase.
func (*Client) RefundSubscription ¶
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 ¶
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