objc2_store_kit/generated/
SKPaymentTransaction.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/storekit/skpaymenttransactionstate?language=objc)
10// NS_ENUM
11#[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct SKPaymentTransactionState(pub NSInteger);
15impl SKPaymentTransactionState {
16    #[doc(alias = "SKPaymentTransactionStatePurchasing")]
17    #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
18    pub const Purchasing: Self = Self(0);
19    #[doc(alias = "SKPaymentTransactionStatePurchased")]
20    #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
21    pub const Purchased: Self = Self(1);
22    #[doc(alias = "SKPaymentTransactionStateFailed")]
23    #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
24    pub const Failed: Self = Self(2);
25    #[doc(alias = "SKPaymentTransactionStateRestored")]
26    #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
27    pub const Restored: Self = Self(3);
28    #[doc(alias = "SKPaymentTransactionStateDeferred")]
29    #[deprecated = "Use PurchaseResult.pending from Product.purchase(confirmIn:options:)"]
30    pub const Deferred: Self = Self(4);
31}
32
33unsafe impl Encode for SKPaymentTransactionState {
34    const ENCODING: Encoding = NSInteger::ENCODING;
35}
36
37unsafe impl RefEncode for SKPaymentTransactionState {
38    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
39}
40
41extern_class!(
42    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skpaymenttransaction?language=objc)
43    #[unsafe(super(NSObject))]
44    #[derive(Debug, PartialEq, Eq, Hash)]
45    #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
46    pub struct SKPaymentTransaction;
47);
48
49unsafe impl Send for SKPaymentTransaction {}
50
51unsafe impl Sync for SKPaymentTransaction {}
52
53extern_conformance!(
54    unsafe impl NSObjectProtocol for SKPaymentTransaction {}
55);
56
57impl SKPaymentTransaction {
58    extern_methods!(
59        /// This property is not atomic.
60        ///
61        /// # Safety
62        ///
63        /// This might not be thread-safe.
64        #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
65        #[unsafe(method(error))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn error(&self) -> Option<Retained<NSError>>;
68
69        /// This property is not atomic.
70        ///
71        /// # Safety
72        ///
73        /// This might not be thread-safe.
74        #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
75        #[unsafe(method(originalTransaction))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn originalTransaction(&self) -> Option<Retained<SKPaymentTransaction>>;
78
79        #[cfg(feature = "SKPayment")]
80        /// This property is not atomic.
81        ///
82        /// # Safety
83        ///
84        /// This might not be thread-safe.
85        #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
86        #[unsafe(method(payment))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn payment(&self) -> Retained<SKPayment>;
89
90        #[cfg(feature = "SKDownload")]
91        /// This property is not atomic.
92        ///
93        /// # Safety
94        ///
95        /// This might not be thread-safe.
96        #[deprecated = "Hosted content is no longer supported"]
97        #[unsafe(method(downloads))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn downloads(&self) -> Retained<NSArray<SKDownload>>;
100
101        /// This property is not atomic.
102        ///
103        /// # Safety
104        ///
105        /// This might not be thread-safe.
106        #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
107        #[unsafe(method(transactionDate))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn transactionDate(&self) -> Option<Retained<NSDate>>;
110
111        /// This property is not atomic.
112        ///
113        /// # Safety
114        ///
115        /// This might not be thread-safe.
116        #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
117        #[unsafe(method(transactionIdentifier))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn transactionIdentifier(&self) -> Option<Retained<NSString>>;
120
121        /// This property is not atomic.
122        ///
123        /// # Safety
124        ///
125        /// This might not be thread-safe.
126        #[deprecated]
127        #[unsafe(method(transactionReceipt))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn transactionReceipt(&self) -> Option<Retained<NSData>>;
130
131        /// This property is not atomic.
132        ///
133        /// # Safety
134        ///
135        /// This might not be thread-safe.
136        #[deprecated = "Use PurchaseResult from Product.purchase(confirmIn:options:)"]
137        #[unsafe(method(transactionState))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn transactionState(&self) -> SKPaymentTransactionState;
140    );
141}
142
143/// Methods declared on superclass `NSObject`.
144impl SKPaymentTransaction {
145    extern_methods!(
146        #[unsafe(method(init))]
147        #[unsafe(method_family = init)]
148        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
149
150        #[unsafe(method(new))]
151        #[unsafe(method_family = new)]
152        pub unsafe fn new() -> Retained<Self>;
153    );
154}