SubscriptionPurchase

Struct SubscriptionPurchase 

Source
pub struct SubscriptionPurchase {
Show 21 fields pub auto_renewing: Option<bool>, pub cancel_reason: Option<i32>, pub cancel_survey_result: Option<SubscriptionCancelSurveyResult>, pub country_code: Option<String>, pub developer_payload: Option<String>, pub email_address: Option<String>, pub expiry_time_millis: Option<i64>, pub family_name: Option<String>, pub given_name: Option<String>, pub kind: Option<String>, pub linked_purchase_token: Option<String>, pub order_id: Option<String>, pub payment_state: Option<i32>, pub price_amount_micros: Option<i64>, pub price_change: Option<SubscriptionPriceChange>, pub price_currency_code: Option<String>, pub profile_id: Option<String>, pub profile_name: Option<String>, pub purchase_type: Option<i32>, pub start_time_millis: Option<i64>, pub user_cancellation_time_millis: Option<i64>,
}
Expand description

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

§Activities

This type is used in activities, which are methods you may call on this type or where this type is involved in. The list links the activity name, along with information about where it is used (one of request and response).

Fields§

§auto_renewing: Option<bool>

Whether the subscription will automatically be renewed when it reaches its current expiry time.

§cancel_reason: Option<i32>

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
§cancel_survey_result: Option<SubscriptionCancelSurveyResult>

Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey).

§country_code: Option<String>

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

§developer_payload: Option<String>

A developer-specified string that contains supplemental information about an order.

§email_address: Option<String>

The email address of the user when the subscription was purchased. Only present for purchases made with ‘Subscribe with Google’.

§expiry_time_millis: Option<i64>

Time at which the subscription will expire, in milliseconds since the Epoch.

§family_name: Option<String>

The family name of the user when the subscription was purchased. Only present for purchases made with ‘Subscribe with Google’.

§given_name: Option<String>

The given name of the user when the subscription was purchased. Only present for purchases made with ‘Subscribe with Google’.

§kind: Option<String>

This kind represents a subscriptionPurchase object in the androidpublisher service.

§linked_purchase_token: Option<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.
§order_id: Option<String>

The order id of the latest recurring order associated with the purchase of the subscription.

§payment_state: Option<i32>

The payment state of the subscription. Possible values are:

  • Payment pending
  • Payment received
  • Free trial
  • Pending deferred upgrade/downgrade
§price_amount_micros: Option<i64>

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.

§price_change: Option<SubscriptionPriceChange>

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.

§price_currency_code: Option<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”.

§profile_id: Option<String>

The Google profile id of the user when the subscription was purchased. Only present for purchases made with ‘Subscribe with Google’.

§profile_name: Option<String>

The profile name of the user when the subscription was purchased. Only present for purchases made with ‘Subscribe with Google’.

§purchase_type: Option<i32>

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)
  • Promo (i.e. purchased using a promo code)
§start_time_millis: Option<i64>

Time at which the subscription was granted, in milliseconds since the Epoch.

§user_cancellation_time_millis: Option<i64>

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

Trait Implementations§

Source§

impl Clone for SubscriptionPurchase

Source§

fn clone(&self) -> SubscriptionPurchase

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SubscriptionPurchase

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SubscriptionPurchase

Source§

fn default() -> SubscriptionPurchase

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SubscriptionPurchase

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SubscriptionPurchase

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ResponseResult for SubscriptionPurchase

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,