All Downloads are FREE. Search and download functionalities are using the official Maven repository.

target.apidocs.com.google.api.services.androidpublisher.model.SubscriptionPurchase.html Maven / Gradle / Ivy

There is a newer version: v3-rev20241217-2.0.0
Show newest version






SubscriptionPurchase (Google Play Android Developer API v3-rev20240129-2.0.0)












com.google.api.services.androidpublisher.model

Class SubscriptionPurchase

  • All Implemented Interfaces:
    Cloneable, Map<String,Object>


    public final class SubscriptionPurchase
    extends com.google.api.client.json.GenericJson
    A SubscriptionPurchase resource indicates the status of a user's subscription purchase.

    This is the Java data model class that specifies how to parse/serialize into the JSON that is transmitted over HTTP when working with the Google Play Android Developer API. For a detailed explanation see: https://developers.google.com/api-client-library/java/google-http-java-client/json

    Author:
    Google, Inc.
    • Constructor Detail

      • SubscriptionPurchase

        public SubscriptionPurchase()
    • Method Detail

      • getAcknowledgementState

        public Integer getAcknowledgementState()
        The acknowledgement state of the subscription product. Possible values are: 0. Yet to be acknowledged 1. Acknowledged
        Returns:
        value or null for none
      • setAcknowledgementState

        public SubscriptionPurchase setAcknowledgementState(Integer acknowledgementState)
        The acknowledgement state of the subscription product. Possible values are: 0. Yet to be acknowledged 1. Acknowledged
        Parameters:
        acknowledgementState - acknowledgementState or null for none
      • getAutoRenewing

        public Boolean getAutoRenewing()
        Whether the subscription will automatically be renewed when it reaches its current expiry time.
        Returns:
        value or null for none
      • setAutoRenewing

        public SubscriptionPurchase setAutoRenewing(Boolean autoRenewing)
        Whether the subscription will automatically be renewed when it reaches its current expiry time.
        Parameters:
        autoRenewing - autoRenewing or null for none
      • getAutoResumeTimeMillis

        public Long getAutoResumeTimeMillis()
        Time at which the subscription will be automatically resumed, in milliseconds since the Epoch. Only present if the user has requested to pause the subscription.
        Returns:
        value or null for none
      • setAutoResumeTimeMillis

        public SubscriptionPurchase setAutoResumeTimeMillis(Long autoResumeTimeMillis)
        Time at which the subscription will be automatically resumed, in milliseconds since the Epoch. Only present if the user has requested to pause the subscription.
        Parameters:
        autoResumeTimeMillis - autoResumeTimeMillis or null for none
      • getCancelReason

        public Integer getCancelReason()
        The reason why a subscription was canceled or is not auto-renewing. Possible values are: 0. User canceled the subscription 1. Subscription was canceled by the system, for example because of a billing problem 2. Subscription was replaced with a new subscription 3. Subscription was canceled by the developer
        Returns:
        value or null for none
      • setCancelReason

        public SubscriptionPurchase setCancelReason(Integer cancelReason)
        The reason why a subscription was canceled or is not auto-renewing. Possible values are: 0. User canceled the subscription 1. Subscription was canceled by the system, for example because of a billing problem 2. Subscription was replaced with a new subscription 3. Subscription was canceled by the developer
        Parameters:
        cancelReason - cancelReason or null for none
      • getCancelSurveyResult

        public SubscriptionCancelSurveyResult getCancelSurveyResult()
        Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey).
        Returns:
        value or null for none
      • setCancelSurveyResult

        public SubscriptionPurchase setCancelSurveyResult(SubscriptionCancelSurveyResult cancelSurveyResult)
        Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey).
        Parameters:
        cancelSurveyResult - cancelSurveyResult or null for none
      • getCountryCode

        public String getCountryCode()
        ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted.
        Returns:
        value or null for none
      • setCountryCode

        public SubscriptionPurchase setCountryCode(String countryCode)
        ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted.
        Parameters:
        countryCode - countryCode or null for none
      • getDeveloperPayload

        public String getDeveloperPayload()
        A developer-specified string that contains supplemental information about an order.
        Returns:
        value or null for none
      • setDeveloperPayload

        public SubscriptionPurchase setDeveloperPayload(String developerPayload)
        A developer-specified string that contains supplemental information about an order.
        Parameters:
        developerPayload - developerPayload or null for none
      • getEmailAddress

        public String getEmailAddress()
        The email address of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
        Returns:
        value or null for none
      • setEmailAddress

        public SubscriptionPurchase setEmailAddress(String emailAddress)
        The email address of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
        Parameters:
        emailAddress - emailAddress or null for none
      • getExpiryTimeMillis

        public Long getExpiryTimeMillis()
        Time at which the subscription will expire, in milliseconds since the Epoch.
        Returns:
        value or null for none
      • setExpiryTimeMillis

        public SubscriptionPurchase setExpiryTimeMillis(Long expiryTimeMillis)
        Time at which the subscription will expire, in milliseconds since the Epoch.
        Parameters:
        expiryTimeMillis - expiryTimeMillis or null for none
      • getExternalAccountId

        public String getExternalAccountId()
        User account identifier in the third-party service. Only present if account linking happened as part of the subscription purchase flow.
        Returns:
        value or null for none
      • setExternalAccountId

        public SubscriptionPurchase setExternalAccountId(String externalAccountId)
        User account identifier in the third-party service. Only present if account linking happened as part of the subscription purchase flow.
        Parameters:
        externalAccountId - externalAccountId or null for none
      • getFamilyName

        public String getFamilyName()
        The family name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
        Returns:
        value or null for none
      • setFamilyName

        public SubscriptionPurchase setFamilyName(String familyName)
        The family name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
        Parameters:
        familyName - familyName or null for none
      • getGivenName

        public String getGivenName()
        The given name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
        Returns:
        value or null for none
      • setGivenName

        public SubscriptionPurchase setGivenName(String givenName)
        The given name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
        Parameters:
        givenName - givenName or null for none
      • getIntroductoryPriceInfo

        public IntroductoryPriceInfo getIntroductoryPriceInfo()
        Introductory price information of the subscription. This is only present when the subscription was purchased with an introductory price. This field does not indicate the subscription is currently in introductory price period.
        Returns:
        value or null for none
      • setIntroductoryPriceInfo

        public SubscriptionPurchase setIntroductoryPriceInfo(IntroductoryPriceInfo introductoryPriceInfo)
        Introductory price information of the subscription. This is only present when the subscription was purchased with an introductory price. This field does not indicate the subscription is currently in introductory price period.
        Parameters:
        introductoryPriceInfo - introductoryPriceInfo or null for none
      • getKind

        public String getKind()
        This kind represents a subscriptionPurchase object in the androidpublisher service.
        Returns:
        value or null for none
      • setKind

        public SubscriptionPurchase setKind(String kind)
        This kind represents a subscriptionPurchase object in the androidpublisher service.
        Parameters:
        kind - kind or null for none
      • getLinkedPurchaseToken

        public String getLinkedPurchaseToken()
        The purchase token of the originating purchase if this subscription is one of the following: 0. Re-signup of a canceled but non-lapsed subscription 1. Upgrade/downgrade from a previous subscription For example, suppose a user originally signs up and you receive purchase token X, then the user cancels and goes through the resignup flow (before their subscription lapses) and you receive purchase token Y, and finally the user upgrades their subscription and you receive purchase token Z. If you call this API with purchase token Z, this field will be set to Y. If you call this API with purchase token Y, this field will be set to X. If you call this API with purchase token X, this field will not be set.
        Returns:
        value or null for none
      • setLinkedPurchaseToken

        public SubscriptionPurchase setLinkedPurchaseToken(String linkedPurchaseToken)
        The purchase token of the originating purchase if this subscription is one of the following: 0. Re-signup of a canceled but non-lapsed subscription 1. Upgrade/downgrade from a previous subscription For example, suppose a user originally signs up and you receive purchase token X, then the user cancels and goes through the resignup flow (before their subscription lapses) and you receive purchase token Y, and finally the user upgrades their subscription and you receive purchase token Z. If you call this API with purchase token Z, this field will be set to Y. If you call this API with purchase token Y, this field will be set to X. If you call this API with purchase token X, this field will not be set.
        Parameters:
        linkedPurchaseToken - linkedPurchaseToken or null for none
      • getObfuscatedExternalAccountId

        public String getObfuscatedExternalAccountId()
        An obfuscated version of the id that is uniquely associated with the user's account in your app. Present for the following purchases: * If account linking happened as part of the subscription purchase flow. * It was specified using https://developer.android.com/reference/co m/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid when the purchase was made.
        Returns:
        value or null for none
      • setObfuscatedExternalAccountId

        public SubscriptionPurchase setObfuscatedExternalAccountId(String obfuscatedExternalAccountId)
        An obfuscated version of the id that is uniquely associated with the user's account in your app. Present for the following purchases: * If account linking happened as part of the subscription purchase flow. * It was specified using https://developer.android.com/reference/co m/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid when the purchase was made.
        Parameters:
        obfuscatedExternalAccountId - obfuscatedExternalAccountId or null for none
      • getObfuscatedExternalProfileId

        public String getObfuscatedExternalProfileId()
        An obfuscated version of the id that is uniquely associated with the user's profile in your app. Only present if specified using https://developer.android.com/reference/com/android/billin gclient/api/BillingFlowParams.Builder#setobfuscatedprofileid when the purchase was made.
        Returns:
        value or null for none
      • setObfuscatedExternalProfileId

        public SubscriptionPurchase setObfuscatedExternalProfileId(String obfuscatedExternalProfileId)
        An obfuscated version of the id that is uniquely associated with the user's profile in your app. Only present if specified using https://developer.android.com/reference/com/android/billin gclient/api/BillingFlowParams.Builder#setobfuscatedprofileid when the purchase was made.
        Parameters:
        obfuscatedExternalProfileId - obfuscatedExternalProfileId or null for none
      • getOrderId

        public String getOrderId()
        The order id of the latest recurring order associated with the purchase of the subscription. If the subscription was canceled because payment was declined, this will be the order id from the payment declined order.
        Returns:
        value or null for none
      • setOrderId

        public SubscriptionPurchase setOrderId(String orderId)
        The order id of the latest recurring order associated with the purchase of the subscription. If the subscription was canceled because payment was declined, this will be the order id from the payment declined order.
        Parameters:
        orderId - orderId or null for none
      • getPaymentState

        public Integer getPaymentState()
        The payment state of the subscription. Possible values are: 0. Payment pending 1. Payment received 2. Free trial 3. Pending deferred upgrade/downgrade Not present for canceled, expired subscriptions.
        Returns:
        value or null for none
      • setPaymentState

        public SubscriptionPurchase setPaymentState(Integer paymentState)
        The payment state of the subscription. Possible values are: 0. Payment pending 1. Payment received 2. Free trial 3. Pending deferred upgrade/downgrade Not present for canceled, expired subscriptions.
        Parameters:
        paymentState - paymentState or null for none
      • getPriceAmountMicros

        public Long getPriceAmountMicros()
        Price of the subscription, For tax exclusive countries, the price doesn't include tax. For tax inclusive countries, the price includes tax. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000.
        Returns:
        value or null for none
      • setPriceAmountMicros

        public SubscriptionPurchase setPriceAmountMicros(Long priceAmountMicros)
        Price of the subscription, For tax exclusive countries, the price doesn't include tax. For tax inclusive countries, the price includes tax. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000.
        Parameters:
        priceAmountMicros - priceAmountMicros or null for none
      • getPriceChange

        public SubscriptionPriceChange getPriceChange()
        The latest price change information available. This is present only when there is an upcoming price change for the subscription yet to be applied. Once the subscription renews with the new price or the subscription is canceled, no price change information will be returned.
        Returns:
        value or null for none
      • setPriceChange

        public SubscriptionPurchase setPriceChange(SubscriptionPriceChange priceChange)
        The latest price change information available. This is present only when there is an upcoming price change for the subscription yet to be applied. Once the subscription renews with the new price or the subscription is canceled, no price change information will be returned.
        Parameters:
        priceChange - priceChange or null for none
      • getPriceCurrencyCode

        public String getPriceCurrencyCode()
        ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP".
        Returns:
        value or null for none
      • setPriceCurrencyCode

        public SubscriptionPurchase setPriceCurrencyCode(String priceCurrencyCode)
        ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP".
        Parameters:
        priceCurrencyCode - priceCurrencyCode or null for none
      • getProfileId

        public String getProfileId()
        The Google profile id of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
        Returns:
        value or null for none
      • setProfileId

        public SubscriptionPurchase setProfileId(String profileId)
        The Google profile id of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
        Parameters:
        profileId - profileId or null for none
      • getProfileName

        public String getProfileName()
        The profile name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
        Returns:
        value or null for none
      • setProfileName

        public SubscriptionPurchase setProfileName(String profileName)
        The profile name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
        Parameters:
        profileName - profileName or null for none
      • getPromotionCode

        public String getPromotionCode()
        The promotion code applied on this purchase. This field is only set if a vanity code promotion is applied when the subscription was purchased.
        Returns:
        value or null for none
      • setPromotionCode

        public SubscriptionPurchase setPromotionCode(String promotionCode)
        The promotion code applied on this purchase. This field is only set if a vanity code promotion is applied when the subscription was purchased.
        Parameters:
        promotionCode - promotionCode or null for none
      • getPromotionType

        public Integer getPromotionType()
        The type of promotion applied on this purchase. This field is only set if a promotion is applied when the subscription was purchased. Possible values are: 0. One time code 1. Vanity code
        Returns:
        value or null for none
      • setPromotionType

        public SubscriptionPurchase setPromotionType(Integer promotionType)
        The type of promotion applied on this purchase. This field is only set if a promotion is applied when the subscription was purchased. Possible values are: 0. One time code 1. Vanity code
        Parameters:
        promotionType - promotionType or null for none
      • getPurchaseType

        public Integer getPurchaseType()
        The type of purchase of the subscription. This field is only set if this purchase was not made using the standard in-app billing flow. Possible values are: 0. Test (i.e. purchased from a license testing account) 1. Promo (i.e. purchased using a promo code)
        Returns:
        value or null for none
      • setPurchaseType

        public SubscriptionPurchase setPurchaseType(Integer purchaseType)
        The type of purchase of the subscription. This field is only set if this purchase was not made using the standard in-app billing flow. Possible values are: 0. Test (i.e. purchased from a license testing account) 1. Promo (i.e. purchased using a promo code)
        Parameters:
        purchaseType - purchaseType or null for none
      • getStartTimeMillis

        public Long getStartTimeMillis()
        Time at which the subscription was granted, in milliseconds since the Epoch.
        Returns:
        value or null for none
      • setStartTimeMillis

        public SubscriptionPurchase setStartTimeMillis(Long startTimeMillis)
        Time at which the subscription was granted, in milliseconds since the Epoch.
        Parameters:
        startTimeMillis - startTimeMillis or null for none
      • getUserCancellationTimeMillis

        public Long getUserCancellationTimeMillis()
        The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0.
        Returns:
        value or null for none
      • setUserCancellationTimeMillis

        public SubscriptionPurchase setUserCancellationTimeMillis(Long userCancellationTimeMillis)
        The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0.
        Parameters:
        userCancellationTimeMillis - userCancellationTimeMillis or null for none
      • clone

        public SubscriptionPurchase clone()
        Overrides:
        clone in class com.google.api.client.json.GenericJson

Copyright © 2011–2024 Google. All rights reserved.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy