diff --git a/CHANGELOG.md b/CHANGELOG.md index 932bced0..2c807a4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- In-app purchase unavailable for new providers. [#141](https://github.com/passepartoutvpn/passepartout-ios/issues/141) + ## 1.11.1 (2020-05-11) ### Added diff --git a/Passepartout-iOS/Global/Product.swift b/Passepartout-iOS/Global/Product.swift index 6f67763d..9e4439ec 100644 --- a/Passepartout-iOS/Global/Product.swift +++ b/Passepartout-iOS/Global/Product.swift @@ -88,12 +88,12 @@ struct Product: RawRepresentable, Equatable, Hashable { static var allProviders: [Product] { return InfrastructureFactory.shared.allMetadata.map { - return Product(providerId: $0.description) + return Product(providerMetadata: $0) } } - fileprivate init(providerId: String) { - self.init(rawValue: "\(Product.providersBundle).\(providerId)")! + fileprivate init(providerMetadata: Infrastructure.Metadata) { + self.init(rawValue: "\(Product.providersBundle).\(providerMetadata.inApp ?? providerMetadata.name)")! } // MARK: All @@ -137,7 +137,7 @@ struct Product: RawRepresentable, Equatable, Hashable { extension Infrastructure.Metadata { var product: Product { - return Product(providerId: inApp ?? name) + return Product(providerMetadata: self) } }