import Foundation enum SubscriptionProductID { static let weekly = "com.app-for-reddit.pro.weekly" static let monthly = "com.app-for-reddit.pro.monthly" static let yearly = "com.app-for-reddit.pro.yearly" static let lifetime = "com.app-for-reddit.pro.lifetime" static let catalog: [String] = [weekly, monthly, yearly, lifetime] static func productIDs(from config: PaywallConfig) -> [String] { if let ids = config.productIDs, !ids.isEmpty { return ids } return catalog } static func planKey(for productID: String) -> String { productID.split(separator: ".").last.map(String.init) ?? productID } static func plan(for productID: String) -> PaywallPlan? { PaywallPlan(productID: productID) } }