From 14e209ebc380157239af17971546ab06db64ad79 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 8 Jan 2025 11:57:10 +0100 Subject: [PATCH] Removed IAP module as not used --- WooCommerce/build.gradle | 1 - WooCommerce/src/debug/AndroidManifest.xml | 5 - .../android/di/InAppPurchasesModule.kt | 45 - .../android/iapshowcase/IAPDebugLogWrapper.kt | 20 - .../iapshowcase/IAPShowcaseActivity.kt | 23 - .../iapshowcase/IapMobilePayApiProvider.kt | 46 - .../purchase/IAPShowcasePurchaseFragment.kt | 95 -- .../purchase/IAPShowcasePurchaseViewModel.kt | 91 -- .../IAPShowcaseSupportCheckerFragment.kt | 52 -- .../IAPShowcaseSupportCheckerViewModel.kt | 46 - .../debug/res/layout/activity_iapshowcase.xml | 7 - .../layout/fragment_iap_showcase_purchase.xml | 95 -- .../fragment_iap_showcase_support_checker.xml | 34 - WooCommerce/src/debug/res/values/strings.xml | 8 - developer.properties-example | 1 - docs/iap-module.md | 94 -- libs/iap/.gitignore | 1 - libs/iap/build.gradle | 41 - libs/iap/proguard-rules.pro | 21 - libs/iap/src/main/AndroidManifest.xml | 2 - .../internal/core/IAPBillingClientProvider.kt | 18 - .../core/IAPBillingClientStateHandler.kt | 85 -- .../internal/core/IAPBillingClientWrapper.kt | 35 - .../core/IAPBillingFlowParamsBuilder.kt | 16 - .../android/iap/internal/core/IAPExt.kt | 28 - .../android/iap/internal/core/IAPInMapper.kt | 14 - .../android/iap/internal/core/IAPManager.kt | 201 ----- .../iap/internal/core/IAPManagerFactory.kt | 29 - .../android/iap/internal/core/IAPOutMapper.kt | 66 -- .../core/IAPPeriodicPurchaseStatusChecker.kt | 50 -- .../core/IAPPurchasesUpdatedListener.kt | 30 - .../model/IAPBillingClientConnectionResult.kt | 8 - .../android/iap/internal/model/IAPParams.kt | 12 - .../model/IAPProductDetailsResponse.kt | 9 - .../iap/internal/model/IAPPurchaseResult.kt | 30 - .../network/ApiImplementationProvider.kt | 21 - .../internal/network/IAPMobilePayAPIStub.kt | 42 - .../IAPPurchaseWPComPlanActionsImpl.kt | 83 -- .../IAPPurchaseWpComPlanHandler.kt | 101 --- .../IAPPurchaseWpComPlanSupportCheckerImpl.kt | 33 - .../android/iap/pub/IAPActivityWrapper.kt | 5 - .../android/iap/pub/IAPLogWrapper.kt | 9 - .../iap/pub/IAPSitePurchasePlanFactory.kt | 35 - .../iap/pub/PurchaseWPComPlanActions.kt | 14 - .../pub/PurchaseWpComPlanSupportChecker.kt | 8 - .../android/iap/pub/model/IAPError.kt | 26 - .../iap/pub/model/IAPSupportedResult.kt | 6 - .../iap/pub/model/WPComIsPurchasedResult.kt | 12 - .../iap/pub/model/WPComProductResult.kt | 13 - .../iap/pub/model/WPComPurchaseResult.kt | 6 - .../iap/pub/network/IAPMobilePayAPI.kt | 15 - .../iap/pub/network/SandboxTestingConfig.kt | 6 - .../model/CreateAndConfirmOrderResponse.kt | 8 - .../network/ApiImplementationProviderTest.kt | 52 -- .../pub/IAPPurchaseWPComPlanActionsTest.kt | 811 ------------------ .../IAPPurchaseWpComPlanSupportCheckerTest.kt | 124 --- .../android/iap/pub/IAPTestDataHelper.kt | 76 -- .../iap/pub/IAPTestPreparationHelper.kt | 45 - settings.gradle | 1 - 59 files changed, 2911 deletions(-) delete mode 100644 WooCommerce/src/debug/kotlin/com/woocommerce/android/di/InAppPurchasesModule.kt delete mode 100644 WooCommerce/src/debug/kotlin/com/woocommerce/android/iapshowcase/IAPDebugLogWrapper.kt delete mode 100644 WooCommerce/src/debug/kotlin/com/woocommerce/android/iapshowcase/IAPShowcaseActivity.kt delete mode 100644 WooCommerce/src/debug/kotlin/com/woocommerce/android/iapshowcase/IapMobilePayApiProvider.kt delete mode 100644 WooCommerce/src/debug/kotlin/com/woocommerce/android/iapshowcase/purchase/IAPShowcasePurchaseFragment.kt delete mode 100644 WooCommerce/src/debug/kotlin/com/woocommerce/android/iapshowcase/purchase/IAPShowcasePurchaseViewModel.kt delete mode 100644 WooCommerce/src/debug/kotlin/com/woocommerce/android/iapshowcase/supportcheck/IAPShowcaseSupportCheckerFragment.kt delete mode 100644 WooCommerce/src/debug/kotlin/com/woocommerce/android/iapshowcase/supportcheck/IAPShowcaseSupportCheckerViewModel.kt delete mode 100644 WooCommerce/src/debug/res/layout/activity_iapshowcase.xml delete mode 100644 WooCommerce/src/debug/res/layout/fragment_iap_showcase_purchase.xml delete mode 100644 WooCommerce/src/debug/res/layout/fragment_iap_showcase_support_checker.xml delete mode 100644 WooCommerce/src/debug/res/values/strings.xml delete mode 100644 docs/iap-module.md delete mode 100644 libs/iap/.gitignore delete mode 100644 libs/iap/build.gradle delete mode 100644 libs/iap/proguard-rules.pro delete mode 100644 libs/iap/src/main/AndroidManifest.xml delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPBillingClientProvider.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPBillingClientStateHandler.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPBillingClientWrapper.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPBillingFlowParamsBuilder.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPExt.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPInMapper.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPManager.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPManagerFactory.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPOutMapper.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPPeriodicPurchaseStatusChecker.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/core/IAPPurchasesUpdatedListener.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/model/IAPBillingClientConnectionResult.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/model/IAPParams.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/model/IAPProductDetailsResponse.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/model/IAPPurchaseResult.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/network/ApiImplementationProvider.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/network/IAPMobilePayAPIStub.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/planpurchase/IAPPurchaseWPComPlanActionsImpl.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/planpurchase/IAPPurchaseWpComPlanHandler.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/internal/planpurchase/IAPPurchaseWpComPlanSupportCheckerImpl.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/IAPActivityWrapper.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/IAPLogWrapper.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/IAPSitePurchasePlanFactory.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/PurchaseWPComPlanActions.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/PurchaseWpComPlanSupportChecker.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/model/IAPError.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/model/IAPSupportedResult.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/model/WPComIsPurchasedResult.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/model/WPComProductResult.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/model/WPComPurchaseResult.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/network/IAPMobilePayAPI.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/network/SandboxTestingConfig.kt delete mode 100644 libs/iap/src/main/java/com/woocommerce/android/iap/pub/network/model/CreateAndConfirmOrderResponse.kt delete mode 100644 libs/iap/src/test/kotlin/com/woocommerce/android/iap/internal/network/ApiImplementationProviderTest.kt delete mode 100644 libs/iap/src/test/kotlin/com/woocommerce/android/iap/pub/IAPPurchaseWPComPlanActionsTest.kt delete mode 100644 libs/iap/src/test/kotlin/com/woocommerce/android/iap/pub/IAPPurchaseWpComPlanSupportCheckerTest.kt delete mode 100644 libs/iap/src/test/kotlin/com/woocommerce/android/iap/pub/IAPTestDataHelper.kt delete mode 100644 libs/iap/src/test/kotlin/com/woocommerce/android/iap/pub/IAPTestPreparationHelper.kt diff --git a/WooCommerce/build.gradle b/WooCommerce/build.gradle index 71dc80c9291..6bca880c5a5 100644 --- a/WooCommerce/build.gradle +++ b/WooCommerce/build.gradle @@ -319,7 +319,6 @@ dependencies { implementation project(":libs:commons") implementation project(":libs:cardreader") - debugImplementation project(":libs:iap") implementation(libs.facebook.shimmer) implementation(libs.photoview) diff --git a/WooCommerce/src/debug/AndroidManifest.xml b/WooCommerce/src/debug/AndroidManifest.xml index a96d39261a2..42bb9847ebc 100644 --- a/WooCommerce/src/debug/AndroidManifest.xml +++ b/WooCommerce/src/debug/AndroidManifest.xml @@ -32,11 +32,6 @@ android:enabled="@bool/enable_leak_canary" android:exported="false" /> - - { - CreateAndConfirmOrderResponse.Success(response.orderId) - } - is MobilePayRestClient.CreateOrderResponse.Error -> { - when (response.type) { - MobilePayRestClient.CreateOrderErrorType.API_ERROR, - MobilePayRestClient.CreateOrderErrorType.AUTH_ERROR, - MobilePayRestClient.CreateOrderErrorType.GENERIC_ERROR, - MobilePayRestClient.CreateOrderErrorType.INVALID_RESPONSE -> - CreateAndConfirmOrderResponse.Server(response.message ?: "Reason is not provided") - MobilePayRestClient.CreateOrderErrorType.TIMEOUT, - MobilePayRestClient.CreateOrderErrorType.NETWORK_ERROR -> CreateAndConfirmOrderResponse.Network - } - } - } - } - } -} diff --git a/WooCommerce/src/debug/kotlin/com/woocommerce/android/iapshowcase/purchase/IAPShowcasePurchaseFragment.kt b/WooCommerce/src/debug/kotlin/com/woocommerce/android/iapshowcase/purchase/IAPShowcasePurchaseFragment.kt deleted file mode 100644 index 0d85420499f..00000000000 --- a/WooCommerce/src/debug/kotlin/com/woocommerce/android/iapshowcase/purchase/IAPShowcasePurchaseFragment.kt +++ /dev/null @@ -1,95 +0,0 @@ -package com.woocommerce.android.iapshowcase.purchase - -import android.os.Bundle -import android.util.Log -import android.view.View -import android.widget.Button -import android.widget.TextView -import android.widget.Toast -import androidx.appcompat.app.AppCompatActivity -import androidx.appcompat.widget.Toolbar -import androidx.core.view.isVisible -import androidx.fragment.app.Fragment -import androidx.fragment.app.viewModels -import androidx.lifecycle.ViewModel -import androidx.lifecycle.ViewModelProvider -import com.woocommerce.android.R -import com.woocommerce.android.iap.pub.IAPActivityWrapper -import com.woocommerce.android.iap.pub.IAPSitePurchasePlanFactory -import com.woocommerce.android.iap.pub.network.SandboxTestingConfig -import com.woocommerce.android.iapshowcase.IAPDebugLogWrapper -import com.woocommerce.android.iapshowcase.IapMobilePayApiProvider -import dagger.hilt.android.AndroidEntryPoint -import javax.inject.Inject - -@AndroidEntryPoint -class IAPShowcasePurchaseFragment : Fragment(R.layout.fragment_iap_showcase_purchase) { - @Inject - lateinit var mobilePayAPIProvider: IapMobilePayApiProvider - - @Inject - lateinit var debugLogWrapper: IAPDebugLogWrapper - - private val viewModel: IAPShowcasePurchaseViewModel by viewModels { - object : ViewModelProvider.Factory { - @Suppress("UNCHECKED_CAST") - override fun create(modelClass: Class): T { - return IAPShowcasePurchaseViewModel( - IAPSitePurchasePlanFactory.createIAPSitePurchasePlan( - this@IAPShowcasePurchaseFragment.requireActivity().application, - debugLogWrapper, - mobilePayAPIProvider::buildMobilePayAPI, - object : SandboxTestingConfig { - override val isDebug: Boolean - get() = true - override val iapTestingSandboxUrl: String - get() = "" - } - ) - ) as T - } - } - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - setupToolbar(view) - setupObservers(view) - - view.findViewById