Class: Google::Apis::AndroidpublisherV3::SubscriptionPurchase

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/androidpublisher_v3/classes.rb,
generated/google/apis/androidpublisher_v3/representations.rb,
generated/google/apis/androidpublisher_v3/representations.rb

Overview

A SubscriptionPurchase resource indicates the status of a user's subscription purchase.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ SubscriptionPurchase

Returns a new instance of SubscriptionPurchase



1714
1715
1716
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1714

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#acknowledgement_stateFixnum

The acknowledgement state of the subscription product. Possible values are:

  • Yet to be acknowledged
  • Acknowledged Corresponds to the JSON property acknowledgementState

Returns:

  • (Fixnum)


1553
1554
1555
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1553

def acknowledgement_state
  @acknowledgement_state
end

#auto_renewingBoolean Also known as: auto_renewing?

Whether the subscription will automatically be renewed when it reaches its current expiry time. Corresponds to the JSON property autoRenewing

Returns:

  • (Boolean)


1559
1560
1561
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1559

def auto_renewing
  @auto_renewing
end

#auto_resume_time_millisFixnum

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. Corresponds to the JSON property autoResumeTimeMillis

Returns:

  • (Fixnum)


1567
1568
1569
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1567

def auto_resume_time_millis
  @auto_resume_time_millis
end

#cancel_reasonFixnum

The reason why a subscription was canceled or is not auto-renewing. Possible values are:

  • User canceled the subscription
  • Subscription was canceled by the system, for example because of a billing problem
  • Subscription was replaced with a new subscription
  • Subscription was canceled by the developer Corresponds to the JSON property cancelReason

Returns:

  • (Fixnum)


1578
1579
1580
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1578

def cancel_reason
  @cancel_reason
end

#cancel_survey_resultGoogle::Apis::AndroidpublisherV3::SubscriptionCancelSurveyResult

Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey). Corresponds to the JSON property cancelSurveyResult



1584
1585
1586
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1584

def cancel_survey_result
  @cancel_survey_result
end

#country_codeString

ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted. Corresponds to the JSON property countryCode

Returns:

  • (String)


1590
1591
1592
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1590

def country_code
  @country_code
end

#developer_payloadString

A developer-specified string that contains supplemental information about an order. Corresponds to the JSON property developerPayload

Returns:

  • (String)


1596
1597
1598
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1596

def developer_payload
  @developer_payload
end

#email_addressString

The email address of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. Corresponds to the JSON property emailAddress

Returns:

  • (String)


1602
1603
1604
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1602

def email_address
  @email_address
end

#expiry_time_millisFixnum

Time at which the subscription will expire, in milliseconds since the Epoch. Corresponds to the JSON property expiryTimeMillis

Returns:

  • (Fixnum)


1607
1608
1609
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1607

def expiry_time_millis
  @expiry_time_millis
end

#family_nameString

The family name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. Corresponds to the JSON property familyName

Returns:

  • (String)


1613
1614
1615
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1613

def family_name
  @family_name
end

#given_nameString

The given name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. Corresponds to the JSON property givenName

Returns:

  • (String)


1619
1620
1621
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1619

def given_name
  @given_name
end

#introductory_price_infoGoogle::Apis::AndroidpublisherV3::IntroductoryPriceInfo

Contains the introductory price information for a subscription. Corresponds to the JSON property introductoryPriceInfo



1624
1625
1626
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1624

def introductory_price_info
  @introductory_price_info
end

#kindString

This kind represents a subscriptionPurchase object in the androidpublisher service. Corresponds to the JSON property kind

Returns:

  • (String)


1630
1631
1632
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1630

def kind
  @kind
end

#linked_purchase_tokenString

The purchase token of the originating purchase if this subscription is one of the following:

  • Re-signup of a canceled but non-lapsed subscription
  • 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. Corresponds to the JSON property linkedPurchaseToken

Returns:

  • (String)


1645
1646
1647
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1645

def linked_purchase_token
  @linked_purchase_token
end

#order_idString

The order id of the latest recurring order associated with the purchase of the subscription. Corresponds to the JSON property orderId

Returns:

  • (String)


1651
1652
1653
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1651

def order_id
  @order_id
end

#payment_stateFixnum

The payment state of the subscription. Possible values are:

  • Payment pending
  • Payment received
  • Free trial
  • Pending deferred upgrade/downgrade Corresponds to the JSON property paymentState

Returns:

  • (Fixnum)


1660
1661
1662
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1660

def payment_state
  @payment_state
end

#price_amount_microsFixnum

Price of the subscription, not including 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. Corresponds to the JSON property priceAmountMicros

Returns:

  • (Fixnum)


1667
1668
1669
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1667

def price_amount_micros
  @price_amount_micros
end

#price_changeGoogle::Apis::AndroidpublisherV3::SubscriptionPriceChange

Contains the price change information for a subscription that can be used to control the user journey for the price change in the app. This can be in the form of seeking confirmation from the user or tailoring the experience for a successful conversion. Corresponds to the JSON property priceChange



1675
1676
1677
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1675

def price_change
  @price_change
end

#price_currency_codeString

ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP". Corresponds to the JSON property priceCurrencyCode

Returns:

  • (String)


1681
1682
1683
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1681

def price_currency_code
  @price_currency_code
end

#profile_idString

The Google profile id of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. Corresponds to the JSON property profileId

Returns:

  • (String)


1687
1688
1689
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1687

def profile_id
  @profile_id
end

#profile_nameString

The profile name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. Corresponds to the JSON property profileName

Returns:

  • (String)


1693
1694
1695
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1693

def profile_name
  @profile_name
end

#purchase_typeFixnum

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:

  • Test (i.e. purchased from a license testing account) Corresponds to the JSON property purchaseType

Returns:

  • (Fixnum)


1701
1702
1703
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1701

def purchase_type
  @purchase_type
end

#start_time_millisFixnum

Time at which the subscription was granted, in milliseconds since the Epoch. Corresponds to the JSON property startTimeMillis

Returns:

  • (Fixnum)


1706
1707
1708
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1706

def start_time_millis
  @start_time_millis
end

#user_cancellation_time_millisFixnum

The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0. Corresponds to the JSON property userCancellationTimeMillis

Returns:

  • (Fixnum)


1712
1713
1714
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1712

def user_cancellation_time_millis
  @user_cancellation_time_millis
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
# File 'generated/google/apis/androidpublisher_v3/classes.rb', line 1719

def update!(**args)
  @acknowledgement_state = args[:acknowledgement_state] if args.key?(:acknowledgement_state)
  @auto_renewing = args[:auto_renewing] if args.key?(:auto_renewing)
  @auto_resume_time_millis = args[:auto_resume_time_millis] if args.key?(:auto_resume_time_millis)
  @cancel_reason = args[:cancel_reason] if args.key?(:cancel_reason)
  @cancel_survey_result = args[:cancel_survey_result] if args.key?(:cancel_survey_result)
  @country_code = args[:country_code] if args.key?(:country_code)
  @developer_payload = args[:developer_payload] if args.key?(:developer_payload)
  @email_address = args[:email_address] if args.key?(:email_address)
  @expiry_time_millis = args[:expiry_time_millis] if args.key?(:expiry_time_millis)
  @family_name = args[:family_name] if args.key?(:family_name)
  @given_name = args[:given_name] if args.key?(:given_name)
  @introductory_price_info = args[:introductory_price_info] if args.key?(:introductory_price_info)
  @kind = args[:kind] if args.key?(:kind)
  @linked_purchase_token = args[:linked_purchase_token] if args.key?(:linked_purchase_token)
  @order_id = args[:order_id] if args.key?(:order_id)
  @payment_state = args[:payment_state] if args.key?(:payment_state)
  @price_amount_micros = args[:price_amount_micros] if args.key?(:price_amount_micros)
  @price_change = args[:price_change] if args.key?(:price_change)
  @price_currency_code = args[:price_currency_code] if args.key?(:price_currency_code)
  @profile_id = args[:profile_id] if args.key?(:profile_id)
  @profile_name = args[:profile_name] if args.key?(:profile_name)
  @purchase_type = args[:purchase_type] if args.key?(:purchase_type)
  @start_time_millis = args[:start_time_millis] if args.key?(:start_time_millis)
  @user_cancellation_time_millis = args[:user_cancellation_time_millis] if args.key?(:user_cancellation_time_millis)
end