Skip to content

Commit 9cb0d76

Browse files
authored
Merge pull request #7893 from woocommerce/issue/7836-iap-integration-fixes
Include real site ID in IAP purchases
2 parents 8083bfc + b5f767d commit 9cb0d76

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

WooCommerce/Classes/ViewRelated/Hub Menu/HubMenu.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct HubMenu: View {
113113
NavigationLink(destination: CouponListView(siteID: viewModel.siteID), isActive: $showingCoupons) {
114114
EmptyView()
115115
}.hidden()
116-
NavigationLink(destination: InAppPurchasesDebugView(), isActive: $showingIAPDebug) {
116+
NavigationLink(destination: InAppPurchasesDebugView(siteID: viewModel.siteID), isActive: $showingIAPDebug) {
117117
EmptyView()
118118
}.hidden()
119119
LazyNavigationLink(destination: viewModel.getReviewDetailDestination(), isActive: $viewModel.showingReviewDetail) {

WooCommerce/Classes/ViewRelated/InAppPurchases/InAppPurchasesDebugView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import StoreKit
33
import Yosemite
44

55
struct InAppPurchasesDebugView: View {
6+
let siteID: Int64
67
private let stores = ServiceLocator.stores
78
@State var products: [StoreKit.Product] = []
89

@@ -19,7 +20,7 @@ struct InAppPurchasesDebugView: View {
1920
} else {
2021
ForEach(products) { product in
2122
Button(product.description) {
22-
stores.dispatch(InAppPurchaseAction.purchaseProduct(siteID: 0, product: product, completion: { _ in }))
23+
stores.dispatch(InAppPurchaseAction.purchaseProduct(siteID: siteID, product: product, completion: { _ in }))
2324
}
2425
}
2526
}
@@ -45,6 +46,6 @@ struct InAppPurchasesDebugView: View {
4546

4647
struct InAppPurchasesDebugView_Previews: PreviewProvider {
4748
static var previews: some View {
48-
InAppPurchasesDebugView()
49+
InAppPurchasesDebugView(siteID: 0)
4950
}
5051
}

0 commit comments

Comments
 (0)