Skip to content

Commit ded8c4c

Browse files
committed
Typealias the purchase result type
1 parent 54fdec4 commit ded8c4c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

WooCommerce/Classes/ViewRelated/InAppPurchases/InAppPurchasesDebugView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import SwiftUI
2-
import StoreKit
32
import Yosemite
43

54
@MainActor

WooCommerce/Classes/ViewRelated/InAppPurchases/InAppPurchasesForWPComPlansManager.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ protocol WPComPlanProduct {
1515

1616
extension StoreKit.Product: WPComPlanProduct {}
1717

18+
typealias InAppPurchaseResult = StoreKit.Product.PurchaseResult
19+
1820
protocol InAppPurchasesForWPComPlansProtocol {
1921
/// Retrieves asynchronously all WPCom plans In-App Purchases products.
2022
///
@@ -33,7 +35,7 @@ protocol InAppPurchasesForWPComPlansProtocol {
3335
/// id: the id of the product to be purchased
3436
/// remoteSiteId: the id of the site linked to the purchasing plan
3537
///
36-
func purchaseProduct(with id: String, for remoteSiteId: Int64) async throws -> StoreKit.Product.PurchaseResult
38+
func purchaseProduct(with id: String, for remoteSiteId: Int64) async throws -> InAppPurchaseResult
3739

3840
/// Retries forwarding the product purchase to our backend, so the plan can be unlocked.
3941
/// This can happen when the purchase was previously successful but unlocking the WPCom plan request
@@ -73,7 +75,7 @@ final class InAppPurchasesForWPComPlansManager: InAppPurchasesForWPComPlansProto
7375
}
7476
}
7577

76-
func purchaseProduct(with id: String, for remoteSiteId: Int64) async throws -> StoreKit.Product.PurchaseResult {
78+
func purchaseProduct(with id: String, for remoteSiteId: Int64) async throws -> InAppPurchaseResult {
7779
try await withCheckedThrowingContinuation { continuation in
7880
stores.dispatch(InAppPurchaseAction.purchaseProduct(siteID: remoteSiteId, productID: id, completion: { result in
7981
continuation.resume(with: result)

0 commit comments

Comments
 (0)