Replaced CustomerInfo.nonSubscriptionTransactions with a new non-StoreTransaction type#1733
Conversation
CustomerInfo.nonSubscriptionsTransactions with a new non-StoreTransaction typeCustomerInfo.nonSubscriptionTransactions with a new non-StoreTransaction type
…StoreTransaction` type Fixes [CF-781] Making that return type a `StoreTransaction` was my mistake from an earlier refactor. I saw the two types were similar, so I made them conform to the same interface. However, they represent different concepts. ### Changes: - Added new `NonSubscriptionTransaction` type - Deprecated `CustomerInfo.nonSubscriptionTransactions` with a `renamed` for a new `nonSubscriptions` - Made the old `BackendParsedTransaction` initialization depend on the new type to avoid duplicating code - Add new test to cover the new method, and left the existing one - Added more checks in `CustomerInfoTest` for missing properties - Updated all APITesters
8681caa to
60fc16d
Compare
|
Bump? 👀 |
|
adding @vegaro since he brought this up originally |
|
why did that close it?? I think GH's having some issues right now, sorry, I'll reopen |
aboedo
left a comment
There was a problem hiding this comment.
Looks great to me, a clean fix ✨
Let's wait for Cesar to take a look too before merging in case I'm missing something
| let productIdentifier: String | ||
| let purchaseDate: Date | ||
| let transactionIdentifier: String | ||
| let quantity: Int |
There was a problem hiding this comment.
Would it make sense to add this property to the new model? I see it's been set to 1, so I'm not sure it's coming from the backend
There was a problem hiding this comment.
It wasn't. We only had it so we could expose the SK2 version, but since it was a dummy value I thought not to until the backend sends it.
There was a problem hiding this comment.
Awesome, we should rename the Android model too (it's called Transaction and NonSubscriptionTransaction is cleaner). I created https://revenuecats.atlassian.net/browse/CSDK-308 to track that. Properties also differ with Android so those should also be renamed in Android since they are cleaner in your version.
### Changes: * Replaced `CustomerInfo.nonSubscriptionTransactions` with a new non-`StoreTransaction` type (#1733) via NachoSoto (@NachoSoto) * `Purchases.configure`: added overload taking a `Configuration.Builder` (#1720) via NachoSoto (@NachoSoto) * Extract Attribution logic out of Purchases (#1693) via Joshua Liebowitz (@taquitos) * Remove create alias (#1695) via Joshua Liebowitz (@taquitos) All attribution APIs can now be accessed from `Purchases.shared.attribution`. ### Improvements: * Improved purchasing logs, added promotional offer information (#1725) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator`: don't log attribute errors if there are none (#1742) via NachoSoto (@NachoSoto) * `FatalErrorUtil`: don't override `fatalError` on release builds (#1736) via NachoSoto (@NachoSoto) * `SKPaymentTransaction`: added more context to warnings about missing properties (#1731) via NachoSoto (@NachoSoto) * New SwiftUI Purchase Tester example (#1722) via Josh Holtz (@joshdholtz) * update docs for `showManageSubscriptions` (#1729) via aboedo (@aboedo) * `PurchasesOrchestrator`: unify finish transactions between SK1 and SK2 (#1704) via NachoSoto (@NachoSoto) * `SubscriberAttribute`: converted into `struct` (#1648) via NachoSoto (@NachoSoto) * `CacheFetchPolicy.notStaleCachedOrFetched`: added warning to docstring (#1708) via NachoSoto (@NachoSoto) * Clear cached offerings and products after Storefront changes (2/4) (#1583) via Juanpe Catalán (@Juanpe) * `ROT13`: optimized initialization and removed magic numbers (#1702) via NachoSoto (@NachoSoto) ### Fixes: * `logIn`/`logOut`: sync attributes before aliasing (#1716) via NachoSoto (@NachoSoto) * `Purchases.customerInfo(fetchPolicy:)`: actually use `fetchPolicy` parameter (#1721) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator`: fix behavior dealing with `nil` `SKPaymentTransaction.productIdentifier` during purchase (#1680) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator.handlePurchasedTransaction`: always refresh receipt data (#1703) via NachoSoto (@NachoSoto)
Fixes CF-781
Making
CustomerInfo.nonSubscriptionTransactionsreturn type aStoreTransactionwas my mistake from an earlier refactor. I saw the two types were similar, so I made them conform to the same interface.However, they represent different concepts.
Changes:
NonSubscriptionTransactiontypeCustomerInfo.nonSubscriptionTransactionswith arenamedfor a newnonSubscriptionsBackendParsedTransactioninitialization depend on the new type to avoid duplicating codeCustomerInfoTestfor missing properties