Google_PurchasesServiceResource
The "purchases" collection of methods.
Defined (1)
The class is defined in the following location(s).
- /src/contrib/Google_AndroidpublisherService.php
- class Google_PurchasesServiceResource extends Google_ServiceResource {
- /**
- * Cancels a user's subscription purchase. The subscription remains valid until its expiration time.
- * (purchases.cancel)
- *
- * @param string $packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing').
- * @param string $subscriptionId The purchased subscription ID (for example, 'monthly001').
- * @param string $token The token provided to the user's device when the subscription was purchased.
- * @param array $optParams Optional parameters.
- */
- public function cancel($packageName, $subscriptionId, $token, $optParams = array()) {
- $params = array('packageName' => $packageName, 'subscriptionId' => $subscriptionId, 'token' => $token);
- $params = array_merge($params, $optParams);
- $data = $this->__call('cancel', array($params));
- return $data;
- }
- /**
- * Checks whether a user's subscription purchase is valid and returns its expiry time.
- * (purchases.get)
- *
- * @param string $packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing').
- * @param string $subscriptionId The purchased subscription ID (for example, 'monthly001').
- * @param string $token The token provided to the user's device when the subscription was purchased.
- * @param array $optParams Optional parameters.
- * @return Google_SubscriptionPurchase
- */
- public function get($packageName, $subscriptionId, $token, $optParams = array()) {
- $params = array('packageName' => $packageName, 'subscriptionId' => $subscriptionId, 'token' => $token);
- $params = array_merge($params, $optParams);
- $data = $this->__call('get', array($params));
- if ($this->useObjects()) {
- return new Google_SubscriptionPurchase($data);
- } else {
- return $data;
- }
- }
- }