Add Validator for Purchase Product token (GooglePlay)

This commit is contained in:
suzuki.junsuke
2015-01-16 19:01:18 +09:00
parent 747fb8d079
commit 209eb6a980
3 changed files with 39 additions and 1 deletions

View File

@@ -122,6 +122,23 @@ func (c *Client) VerifySubscription(
return result, 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
}
func dialTimeout(network, addr string) (net.Conn, error) {
return net.DialTimeout(network, addr, defaultTimeout)
}