class PurchasesSubscriptions extends Resource (View source)

The "subscriptions" collection of methods.

Typical usage is:

 $androidpublisherService = new Google\Service\AndroidPublisher(...);
 $subscriptions = $androidpublisherService->purchases_subscriptions;

Methods

acknowledge(string $packageName, string $subscriptionId, string $token, SubscriptionPurchasesAcknowledgeRequest $postBody, array $optParams = [])

Acknowledges a subscription purchase. (subscriptions.acknowledge)

cancel(string $packageName, string $subscriptionId, string $token, array $optParams = [])

Cancels a user's subscription purchase. The subscription remains valid until its expiration time. (subscriptions.cancel)

defer(string $packageName, string $subscriptionId, string $token, SubscriptionPurchasesDeferRequest $postBody, array $optParams = [])

Defers a user's subscription purchase until a specified future expiration time. (subscriptions.defer)

get(string $packageName, string $subscriptionId, string $token, array $optParams = [])

Checks whether a user's subscription purchase is valid and returns its expiry time. (subscriptions.get)

refund(string $packageName, string $subscriptionId, string $token, array $optParams = [])

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

revoke(string $packageName, string $subscriptionId, string $token, array $optParams = [])

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

Details

acknowledge(string $packageName, string $subscriptionId, string $token, SubscriptionPurchasesAcknowledgeRequest $postBody, array $optParams = [])

Acknowledges a subscription purchase. (subscriptions.acknowledge)

Parameters

string $packageName

The package name of the application for which this subscription was purchased (for example, 'com.some.thing').

string $subscriptionId

The purchased subscription ID (for example, 'monthly001').

string $token

The token provided to the user's device when the subscription was purchased.

SubscriptionPurchasesAcknowledgeRequest $postBody
array $optParams

Optional parameters.

Exceptions

Exception

cancel(string $packageName, string $subscriptionId, string $token, array $optParams = [])

Cancels a user's subscription purchase. The subscription remains valid until its expiration time. (subscriptions.cancel)

Parameters

string $packageName

The package name of the application for which this subscription was purchased (for example, 'com.some.thing').

string $subscriptionId

The purchased subscription ID (for example, 'monthly001').

string $token

The token provided to the user's device when the subscription was purchased.

array $optParams

Optional parameters.

Exceptions

Exception

SubscriptionPurchasesDeferResponse defer(string $packageName, string $subscriptionId, string $token, SubscriptionPurchasesDeferRequest $postBody, array $optParams = [])

Defers a user's subscription purchase until a specified future expiration time. (subscriptions.defer)

Parameters

string $packageName

The package name of the application for which this subscription was purchased (for example, 'com.some.thing').

string $subscriptionId

The purchased subscription ID (for example, 'monthly001').

string $token

The token provided to the user's device when the subscription was purchased.

SubscriptionPurchasesDeferRequest $postBody
array $optParams

Optional parameters.

Return Value

SubscriptionPurchasesDeferResponse

Exceptions

Exception

SubscriptionPurchase get(string $packageName, string $subscriptionId, string $token, array $optParams = [])

Checks whether a user's subscription purchase is valid and returns its expiry time. (subscriptions.get)

Parameters

string $packageName

The package name of the application for which this subscription was purchased (for example, 'com.some.thing').

string $subscriptionId

The purchased subscription ID (for example, 'monthly001').

string $token

The token provided to the user's device when the subscription was purchased.

array $optParams

Optional parameters.

Return Value

SubscriptionPurchase

Exceptions

Exception

refund(string $packageName, string $subscriptionId, string $token, array $optParams = [])

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

(subscriptions.refund)

Parameters

string $packageName

The package name of the application for which this subscription was purchased (for example, 'com.some.thing').

string $subscriptionId

"The purchased subscription ID (for example, 'monthly001').

string $token

The token provided to the user's device when the subscription was purchased.

array $optParams

Optional parameters.

Exceptions

Exception

revoke(string $packageName, string $subscriptionId, string $token, array $optParams = [])

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

(subscriptions.revoke)

Parameters

string $packageName

The package name of the application for which this subscription was purchased (for example, 'com.some.thing').

string $subscriptionId

The purchased subscription ID (for example, 'monthly001').

string $token

The token provided to the user's device when the subscription was purchased.

array $optParams

Optional parameters.

Exceptions

Exception