mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
* Cache presentedOfferingContext when making a purchase from a paywall * Avoid using stale cached presentedOfferingContext Co-authored-by: Cursor <cursoragent@cursor.com> * Only remove cached context when date check passes * Include productId in cancel events and add tests * Add log * One more test * More tests * fix warning * Fix compilation * Fix integration test compilation for SPI import Co-authored-by: Cursor <cursoragent@cursor.com> * Include paywall and offering context in SK2 transaction listener * Improve comment * More tests --------- Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
894 B
Swift
33 lines
894 B
Swift
//
|
|
// TestStoreTransaction.swift
|
|
// RevenueCat
|
|
//
|
|
// Copyright © 2026 RevenueCat, Inc. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
/// Internal struct used to create `StoreTransaction` instances for testing purposes.
|
|
/// This allows developers to mock `StoreTransaction` objects in unit tests.
|
|
struct TestStoreTransaction: StoreTransactionType {
|
|
|
|
let productIdentifier: String
|
|
let purchaseDate: Date
|
|
let transactionIdentifier: String
|
|
let quantity: Int
|
|
let storefront: Storefront?
|
|
|
|
var hasKnownPurchaseDate: Bool { return true }
|
|
var hasKnownTransactionIdentifier: Bool { return true }
|
|
|
|
let jwsRepresentation: String? = nil
|
|
let environment: StoreEnvironment? = nil
|
|
let reason: TransactionReason? = nil
|
|
|
|
func finish(_ wrapper: any PaymentQueueWrapperType, completion: @escaping @Sendable () -> Void) {
|
|
// no-op
|
|
completion()
|
|
}
|
|
|
|
}
|