Google_PurchasesServiceResource

The "purchases" collection of methods.

Defined (1)

The class is defined in the following location(s).

/src/contrib/Google_AndroidpublisherService.php  
  1. class Google_PurchasesServiceResource extends Google_ServiceResource { 
  2.  
  3. /** 
  4. * Cancels a user's subscription purchase. The subscription remains valid until its expiration time. 
  5. * (purchases.cancel) 
  6. * @param string $packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). 
  7. * @param string $subscriptionId The purchased subscription ID (for example, 'monthly001'). 
  8. * @param string $token The token provided to the user's device when the subscription was purchased. 
  9. * @param array $optParams Optional parameters. 
  10. */ 
  11. public function cancel($packageName, $subscriptionId, $token, $optParams = array()) { 
  12. $params = array('packageName' => $packageName, 'subscriptionId' => $subscriptionId, 'token' => $token); 
  13. $params = array_merge($params, $optParams); 
  14. $data = $this->__call('cancel', array($params)); 
  15. return $data; 
  16. /** 
  17. * Checks whether a user's subscription purchase is valid and returns its expiry time. 
  18. * (purchases.get) 
  19. * @param string $packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). 
  20. * @param string $subscriptionId The purchased subscription ID (for example, 'monthly001'). 
  21. * @param string $token The token provided to the user's device when the subscription was purchased. 
  22. * @param array $optParams Optional parameters. 
  23. * @return Google_SubscriptionPurchase 
  24. */ 
  25. public function get($packageName, $subscriptionId, $token, $optParams = array()) { 
  26. $params = array('packageName' => $packageName, 'subscriptionId' => $subscriptionId, 'token' => $token); 
  27. $params = array_merge($params, $optParams); 
  28. $data = $this->__call('get', array($params)); 
  29. if ($this->useObjects()) { 
  30. return new Google_SubscriptionPurchase($data); 
  31. } else { 
  32. return $data;