-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[
StoreKit 2
]: Refunding Purchases Integration (#6)
* Bump mint dependencies - Bumps `swiftformat` from `0.47.12` to `0.52.7` - Bumps `SwiftLint` from `0.47.1` to `0.53.0` * Integrate refund purchase feature Implement a refund purchase feature as a step towards supporting `StoreKit 2` * Update `Usage.md` * Update `UML` diagram * Update `.swiftformat` rules * Increase test coverage - Implement unit tests for `IAPError` - Implement unit tests for `ProcessInfo` - Implement unit tests for `SystemInfoProvider` * Implement unit tests - Implement unit tests for `Flare` - Implement unit tests for `IAPProvider` * Implement `RefundRequestProvider` tests * Update `codecov.yml` * Update `CHANGELOG.md` * Update `Package.swift` * Bump min `swift` version from `5.5` to `5.7` * Update `README.md` * Update `CHANGELOG.md`
- Loading branch information
1 parent
1d2975d
commit ba39791
Showing
39 changed files
with
1,052 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
excluded: | ||
- Tests | ||
- Package.swift | ||
- [email protected] | ||
- .build | ||
|
||
# Rules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
nicklockwood/SwiftFormat@0.47.12 | ||
realm/SwiftLint@0.47.1 | ||
nicklockwood/SwiftFormat@0.52.7 | ||
realm/SwiftLint@0.53.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "Concurrency", | ||
"repositoryURL": "https://github.com/space-code/concurrency", | ||
"state": { | ||
"branch": null, | ||
"revision": "f9611694f77f64e43d9467a16b2f5212cd04099b", | ||
"version": "0.0.1" | ||
} | ||
"pins" : [ | ||
{ | ||
"identity" : "concurrency", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/space-code/concurrency", | ||
"state" : { | ||
"revision" : "f9611694f77f64e43d9467a16b2f5212cd04099b", | ||
"version" : "0.0.1" | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
}, | ||
{ | ||
"identity" : "objects-factory", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/space-code/objects-factory.git", | ||
"state" : { | ||
"revision" : "be016801934d18d91e33845e5e5b9a12617698b0", | ||
"version" : "1.0.0" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Sources/Flare/Classes/Helpers/ProcessInfo/ProcessInfo+.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Flare | ||
// Copyright © 2023 Space Code. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
#if DEBUG | ||
extension ProcessInfo { | ||
static var isRunningUnitTests: Bool { | ||
self[.XCTestConfigurationFile] != nil | ||
} | ||
} | ||
|
||
// MARK: - Extensions | ||
|
||
extension ProcessInfo { | ||
static subscript(key: String) -> String? { | ||
processInfo.environment[key] | ||
} | ||
} | ||
|
||
// MARK: - Constants | ||
|
||
private extension String { | ||
static let XCTestConfigurationFile = "XCTestConfigurationFilePath" | ||
} | ||
|
||
#endif |
22 changes: 22 additions & 0 deletions
22
Sources/Flare/Classes/Helpers/ScenesHolder/IScenesHolder.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Flare | ||
// Copyright © 2023 Space Code. All rights reserved. | ||
// | ||
|
||
#if canImport(UIKit) | ||
import UIKit | ||
#endif | ||
|
||
// MARK: - IScenesHolder | ||
|
||
/// A type that holds all connected scenes. | ||
protocol IScenesHolder { | ||
#if os(iOS) || VISION_OS | ||
/// The scenes that are connected to the app. | ||
var connectedScenes: Set<UIScene> { get } | ||
#endif | ||
} | ||
|
||
#if os(iOS) || VISION_OS | ||
extension UIApplication: IScenesHolder {} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// Flare | ||
// Copyright © 2023 Space Code. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// It encompasses all types of refund errors. | ||
public enum RefundError: Error, Equatable { | ||
/// The duplicate refund request. | ||
case duplicateRequest | ||
/// The refund request failed. | ||
case failed | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Flare | ||
// Copyright © 2023 Space Code. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// It encompasses all refund request states. | ||
public enum RefundRequestStatus: Sendable { | ||
/// A user cancelled the refund request. | ||
case userCancelled | ||
/// The request completed successfully. | ||
case success | ||
/// The refund request failed with an error. | ||
case failed(error: Error) | ||
/// The unknown error occurred. | ||
case unknown | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.