Struct iap::AppleResponse
source · [−]pub struct AppleResponse {
pub status: i32,
pub is_retryable: Option<bool>,
pub environment: Option<String>,
pub latest_receipt: Option<String>,
pub latest_receipt_info: Option<Vec<AppleLatestReceipt>>,
pub receipt: Option<AppleReceipt>,
}
Expand description
See https://developer.apple.com/documentation/appstorereceipts/responsebody for more details on each field
Fields
status: i32
Either 0 if the receipt is valid, or a status code if there is an error. The status code reflects the status of the app receipt as a whole.
is_retryable: Option<bool>
An indicator that an error occurred during the request. A value of 1 indicates a temporary issue; retry validation for this receipt at a later time. A value of 0 indicates an unresolvable issue; do not retry validation for this receipt. Only applicable to status codes 21100-21199.
environment: Option<String>
The environment for which the receipt was generated. Possible values: Sandbox, Production
latest_receipt: Option<String>
The latest Base64 encoded app receipt. Only returned for receipts that contain auto-renewable subscriptions.
latest_receipt_info: Option<Vec<AppleLatestReceipt>>
An array that contains all in-app purchase transactions. This excludes transactions for consumable products that have been marked as finished by your app. Only returned for receipts that contain auto-renewable subscriptions.
receipt: Option<AppleReceipt>
A JSON representation of the receipt that was sent for verification
Implementations
sourceimpl AppleResponse
impl AppleResponse
sourcepub fn is_subscription(&self, transaction_id: &str) -> bool
pub fn is_subscription(&self, transaction_id: &str) -> bool
Returns true if the receipt we are validating is from a subscription purchase
sourcepub fn get_product_id(&self, transaction_id: &str) -> Option<String>
pub fn get_product_id(&self, transaction_id: &str) -> Option<String>
Get the unique identifier of the product set in App Store Connect, ie: productIdentifier property of the SKPayment
object
sourcepub fn get_receipt(&self, transaction_id: &str) -> Option<AppleInAppReceipt>
pub fn get_receipt(&self, transaction_id: &str) -> Option<AppleInAppReceipt>
Get the receipt from receipt.in_app
by the transaction_id
sourcepub fn get_latest_receipt(&self) -> Option<AppleInAppReceipt>
pub fn get_latest_receipt(&self) -> Option<AppleInAppReceipt>
Get the receipt with the latest expiration date from receipt.in_app
Trait Implementations
sourceimpl Clone for AppleResponse
impl Clone for AppleResponse
sourcefn clone(&self) -> AppleResponse
fn clone(&self) -> AppleResponse
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AppleResponse
impl Debug for AppleResponse
sourceimpl Default for AppleResponse
impl Default for AppleResponse
sourcefn default() -> AppleResponse
fn default() -> AppleResponse
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for AppleResponse
impl<'de> Deserialize<'de> for AppleResponse
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for AppleResponse
impl Serialize for AppleResponse
Auto Trait Implementations
impl RefUnwindSafe for AppleResponse
impl Send for AppleResponse
impl Sync for AppleResponse
impl Unpin for AppleResponse
impl UnwindSafe for AppleResponse
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more