Class: Google::Apis::AndroidpublisherV2::SubscriptionPurchase
- Inherits:
-
Object
- Object
- Google::Apis::AndroidpublisherV2::SubscriptionPurchase
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/androidpublisher_v2/classes.rb,
generated/google/apis/androidpublisher_v2/representations.rb,
generated/google/apis/androidpublisher_v2/representations.rb
Overview
A SubscriptionPurchase resource indicates the status of a user's subscription purchase.
Instance Attribute Summary collapse
-
#auto_renewing ⇒ Boolean
(also: #auto_renewing?)
Whether the subscription will automatically be renewed when it reaches its current expiry time.
-
#cancel_reason ⇒ Fixnum
The reason why a subscription was canceled or is not auto-renewing.
-
#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.
-
#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.
-
#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: - 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.
-
#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, not including tax.
-
#price_currency_code ⇒ String
ISO 4217 currency code for the subscription price.
-
#profile_id ⇒ String
The profile id of the user when the subscription was purchased.
-
#profile_name ⇒ String
The profile name of the user when the subscription was purchased.
-
#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.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ SubscriptionPurchase
Returns a new instance of SubscriptionPurchase
1417 1418 1419 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1417 def initialize(**args) update!(**args) end |
Instance Attribute Details
#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
1289 1290 1291 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1289 def auto_renewing @auto_renewing end |
#cancel_reason ⇒ Fixnum
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
1301 1302 1303 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1301 def cancel_reason @cancel_reason 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
1307 1308 1309 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1307 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
1313 1314 1315 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1313 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
1319 1320 1321 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1319 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
1324 1325 1326 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1324 def expiry_time_millis @expiry_time_millis 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
1330 1331 1332 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1330 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
1336 1337 1338 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1336 def given_name @given_name end |
#kind ⇒ String
This kind represents a subscriptionPurchase object in the androidpublisher
service.
Corresponds to the JSON property kind
1342 1343 1344 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1342 def kind @kind end |
#linked_purchase_token ⇒ String
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
1357 1358 1359 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1357 def linked_purchase_token @linked_purchase_token end |
#order_id ⇒ String
The order id of the latest recurring order associated with the purchase of the
subscription.
Corresponds to the JSON property orderId
1363 1364 1365 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1363 def order_id @order_id end |
#payment_state ⇒ Fixnum
The payment state of the subscription. Possible values are:
- Payment pending
- Payment received
- Free trial
Corresponds to the JSON property
paymentState
1371 1372 1373 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1371 def payment_state @payment_state end |
#price_amount_micros ⇒ Fixnum
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
1378 1379 1380 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1378 def price_amount_micros @price_amount_micros 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
1384 1385 1386 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1384 def price_currency_code @price_currency_code end |
#profile_id ⇒ String
The 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
1390 1391 1392 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1390 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
1396 1397 1398 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1396 def profile_name @profile_name 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:
- Test (i.e. purchased from a license testing account)
Corresponds to the JSON property
purchaseType
1404 1405 1406 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1404 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
1409 1410 1411 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1409 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
1415 1416 1417 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1415 def user_cancellation_time_millis @user_cancellation_time_millis end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 |
# File 'generated/google/apis/androidpublisher_v2/classes.rb', line 1422 def update!(**args) @auto_renewing = args[:auto_renewing] if args.key?(:auto_renewing) @cancel_reason = args[:cancel_reason] if args.key?(:cancel_reason) @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) @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_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 |