Class: Google::Apis::AndroidpublisherV3::SubscriptionPurchase
- Inherits:
-
Object
- Object
- Google::Apis::AndroidpublisherV3::SubscriptionPurchase
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/androidpublisher_v3/classes.rb,
lib/google/apis/androidpublisher_v3/representations.rb,
lib/google/apis/androidpublisher_v3/representations.rb
Overview
A SubscriptionPurchase resource indicates the status of a user's subscription purchase.
Instance Attribute Summary collapse
-
#acknowledgement_state ⇒ Fixnum
The acknowledgement state of the subscription product.
-
#auto_renewing ⇒ Boolean
(also: #auto_renewing?)
Whether the subscription will automatically be renewed when it reaches its current expiry time.
-
#auto_resume_time_millis ⇒ Fixnum
Time at which the subscription will be automatically resumed, in milliseconds since the Epoch.
-
#cancel_reason ⇒ Fixnum
The reason why a subscription was canceled or is not auto-renewing.
-
#cancel_survey_result ⇒ Google::Apis::AndroidpublisherV3::SubscriptionCancelSurveyResult
Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey).
-
#country_code ⇒ String
ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted.
-
#developer_payload ⇒ String
A developer-specified string that contains supplemental information about an order.
-
#email_address ⇒ String
The email address of the user when the subscription was purchased.
-
#expiry_time_millis ⇒ Fixnum
Time at which the subscription will expire, in milliseconds since the Epoch.
-
#external_account_id ⇒ String
User account identifier in the third-party service.
-
#family_name ⇒ String
The family name of the user when the subscription was purchased.
-
#given_name ⇒ String
The given name of the user when the subscription was purchased.
-
#introductory_price_info ⇒ Google::Apis::AndroidpublisherV3::IntroductoryPriceInfo
Contains the introductory price information for a subscription.
-
#kind ⇒ String
This kind represents a subscriptionPurchase object in the androidpublisher service.
-
#linked_purchase_token ⇒ String
The purchase token of the originating purchase if this subscription is one of the following: 0.
-
#obfuscated_external_account_id ⇒ String
An obfuscated version of the id that is uniquely associated with the user's account in your app.
-
#obfuscated_external_profile_id ⇒ String
An obfuscated version of the id that is uniquely associated with the user's profile in your app.
-
#order_id ⇒ String
The order id of the latest recurring order associated with the purchase of the subscription.
-
#payment_state ⇒ Fixnum
The payment state of the subscription.
-
#price_amount_micros ⇒ Fixnum
Price of the subscription, For tax exclusive countries, the price doesn't include tax.
-
#price_change ⇒ Google::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.
-
#price_currency_code ⇒ String
ISO 4217 currency code for the subscription price.
-
#profile_id ⇒ String
The Google profile id of the user when the subscription was purchased.
-
#profile_name ⇒ String
The profile name of the user when the subscription was purchased.
-
#promotion_code ⇒ String
The promotion code applied on this purchase.
-
#promotion_type ⇒ Fixnum
The type of promotion applied on this purchase.
-
#purchase_type ⇒ Fixnum
The type of purchase of the subscription.
-
#start_time_millis ⇒ Fixnum
Time at which the subscription was granted, in milliseconds since the Epoch.
-
#user_cancellation_time_millis ⇒ Fixnum
The time at which the subscription was canceled by the user, in milliseconds since the epoch.
Instance Method Summary collapse
-
#initialize(**args) ⇒ SubscriptionPurchase
constructor
A new instance of SubscriptionPurchase.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ SubscriptionPurchase
Returns a new instance of SubscriptionPurchase.
3518 3519 3520 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3518 def initialize(**args) update!(**args) end |
Instance Attribute Details
#acknowledgement_state ⇒ Fixnum
The acknowledgement state of the subscription product. Possible values are: 0.
Yet to be acknowledged 1. Acknowledged
Corresponds to the JSON property acknowledgementState
3324 3325 3326 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3324 def acknowledgement_state @acknowledgement_state end |
#auto_renewing ⇒ Boolean 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
3330 3331 3332 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3330 def auto_renewing @auto_renewing end |
#auto_resume_time_millis ⇒ Fixnum
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
3338 3339 3340 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3338 def auto_resume_time_millis @auto_resume_time_millis end |
#cancel_reason ⇒ Fixnum
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
Corresponds to the JSON property cancelReason
3346 3347 3348 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3346 def cancel_reason @cancel_reason end |
#cancel_survey_result ⇒ Google::Apis::AndroidpublisherV3::SubscriptionCancelSurveyResult
Information provided by the user when they complete the subscription
cancellation flow (cancellation reason survey).
Corresponds to the JSON property cancelSurveyResult
3352 3353 3354 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3352 def cancel_survey_result @cancel_survey_result end |
#country_code ⇒ String
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
3358 3359 3360 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3358 def country_code @country_code end |
#developer_payload ⇒ String
A developer-specified string that contains supplemental information about an
order.
Corresponds to the JSON property developerPayload
3364 3365 3366 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3364 def developer_payload @developer_payload end |
#email_address ⇒ String
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
3370 3371 3372 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3370 def email_address @email_address end |
#expiry_time_millis ⇒ Fixnum
Time at which the subscription will expire, in milliseconds since the Epoch.
Corresponds to the JSON property expiryTimeMillis
3375 3376 3377 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3375 def expiry_time_millis @expiry_time_millis end |
#external_account_id ⇒ String
User account identifier in the third-party service. Only present if account
linking happened as part of the subscription purchase flow.
Corresponds to the JSON property externalAccountId
3381 3382 3383 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3381 def external_account_id @external_account_id end |
#family_name ⇒ String
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
3387 3388 3389 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3387 def family_name @family_name end |
#given_name ⇒ String
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
3393 3394 3395 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3393 def given_name @given_name end |
#introductory_price_info ⇒ Google::Apis::AndroidpublisherV3::IntroductoryPriceInfo
Contains the introductory price information for a subscription.
Corresponds to the JSON property introductoryPriceInfo
3398 3399 3400 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3398 def introductory_price_info @introductory_price_info end |
#kind ⇒ String
This kind represents a subscriptionPurchase object in the androidpublisher
service.
Corresponds to the JSON property kind
3404 3405 3406 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3404 def kind @kind end |
#linked_purchase_token ⇒ String
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.
Corresponds to the JSON property linkedPurchaseToken
3418 3419 3420 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3418 def linked_purchase_token @linked_purchase_token end |
#obfuscated_external_account_id ⇒ String
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/com/android/billingclient/api/
BillingFlowParams.Builder#setobfuscatedaccountid when the purchase was made.
Corresponds to the JSON property obfuscatedExternalAccountId
3427 3428 3429 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3427 def @obfuscated_external_account_id end |
#obfuscated_external_profile_id ⇒ String
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/billingclient/api/BillingFlowParams.Builder#
setobfuscatedprofileid when the purchase was made.
Corresponds to the JSON property obfuscatedExternalProfileId
3435 3436 3437 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3435 def @obfuscated_external_profile_id end |
#order_id ⇒ String
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.
Corresponds to the JSON property orderId
3442 3443 3444 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3442 def order_id @order_id end |
#payment_state ⇒ Fixnum
The payment state of the subscription. Possible values are: 0. Payment pending
- Payment received 2. Free trial 3. Pending deferred upgrade/downgrade Not
present for canceled, expired subscriptions.
Corresponds to the JSON property
paymentState
3449 3450 3451 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3449 def payment_state @payment_state end |
#price_amount_micros ⇒ Fixnum
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.
Corresponds to the JSON property priceAmountMicros
3458 3459 3460 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3458 def price_amount_micros @price_amount_micros end |
#price_change ⇒ Google::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
3466 3467 3468 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3466 def price_change @price_change end |
#price_currency_code ⇒ String
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
3472 3473 3474 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3472 def price_currency_code @price_currency_code end |
#profile_id ⇒ String
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
3478 3479 3480 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3478 def profile_id @profile_id end |
#profile_name ⇒ String
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
3484 3485 3486 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3484 def profile_name @profile_name end |
#promotion_code ⇒ String
The promotion code applied on this purchase. This field is only set if a
vanity code promotion is applied when the subscription was purchased.
Corresponds to the JSON property promotionCode
3490 3491 3492 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3490 def promotion_code @promotion_code end |
#promotion_type ⇒ Fixnum
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:
- One time code 1. Vanity code
Corresponds to the JSON property
promotionType
3497 3498 3499 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3497 def promotion_type @promotion_type end |
#purchase_type ⇒ Fixnum
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)
Corresponds to the JSON property purchaseType
3505 3506 3507 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3505 def purchase_type @purchase_type end |
#start_time_millis ⇒ Fixnum
Time at which the subscription was granted, in milliseconds since the Epoch.
Corresponds to the JSON property startTimeMillis
3510 3511 3512 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3510 def start_time_millis @start_time_millis end |
#user_cancellation_time_millis ⇒ Fixnum
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
3516 3517 3518 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3516 def user_cancellation_time_millis @user_cancellation_time_millis end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 |
# File 'lib/google/apis/androidpublisher_v3/classes.rb', line 3523 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) @external_account_id = args[:external_account_id] if args.key?(:external_account_id) @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) @obfuscated_external_account_id = args[:obfuscated_external_account_id] if args.key?(:obfuscated_external_account_id) @obfuscated_external_profile_id = args[:obfuscated_external_profile_id] if args.key?(:obfuscated_external_profile_id) @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) @promotion_code = args[:promotion_code] if args.key?(:promotion_code) @promotion_type = args[:promotion_type] if args.key?(:promotion_type) @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 |