NTP-70918 | PS | removed upi sdk helper (#16744)
This commit is contained in:
@@ -56,7 +56,6 @@ import com.naviapp.BuildConfig
|
||||
import com.naviapp.adverse.AdverseDependencyProvider
|
||||
import com.naviapp.analytics.deeplink.DeeplinkManager
|
||||
import com.naviapp.app.NaviApplication
|
||||
import com.naviapp.common.helper.UpiSdkHelperImpl
|
||||
import com.naviapp.common.navigator.NaviDeepLinkNavigator
|
||||
import com.naviapp.utils.getVersionCode
|
||||
import dagger.hilt.android.EntryPointAccessors
|
||||
@@ -111,7 +110,6 @@ object NaviSDKHelper {
|
||||
CommonLibManager.init(
|
||||
application = naviApplication,
|
||||
listener = NaviDeepLinkNavigator,
|
||||
upiSdkHelper = UpiSdkHelperImpl(naviApplication.naviPayManager),
|
||||
baseUrl = BaseBuildConfig.BASE_URL,
|
||||
appVersionName = BuildConfig.VERSION_NAME,
|
||||
appVersionCode = getVersionCode(),
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2024-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.naviapp.common.helper
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import com.navi.common.upi.UpiDataType
|
||||
import com.navi.common.upi.UpiSdkAnalytics
|
||||
import com.navi.common.upi.UpiSdkHelper
|
||||
import com.navi.pay.common.setup.NaviPayManager
|
||||
import dagger.Lazy
|
||||
import org.json.JSONObject
|
||||
|
||||
class UpiSdkHelperImpl(private val naviPayManagerProvider: Lazy<NaviPayManager>) : UpiSdkHelper {
|
||||
|
||||
private val upiSdkAnalytics = UpiSdkAnalytics()
|
||||
|
||||
override suspend fun getDataByType(type: UpiDataType): JSONObject {
|
||||
upiSdkAnalytics.onDataRequest(type)
|
||||
return naviPayManagerProvider.get().getDataByType(type)
|
||||
}
|
||||
|
||||
override fun startAction(
|
||||
activity: Activity,
|
||||
launcher: ActivityResultLauncher<Intent>,
|
||||
data: JSONObject,
|
||||
) {
|
||||
upiSdkAnalytics.onStartAction(data)
|
||||
naviPayManagerProvider.get().startAction(activity, launcher, data)
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,6 @@ import com.navi.common.model.BuildConfigDetails
|
||||
import com.navi.common.model.NetworkInfo
|
||||
import com.navi.common.network.ApiConstants
|
||||
import com.navi.common.network.retrofit.CommonHttpClient
|
||||
import com.navi.common.upi.UpiSdkHelper
|
||||
import okhttp3.Interceptor
|
||||
|
||||
object CommonLibManager {
|
||||
@@ -27,7 +26,6 @@ object CommonLibManager {
|
||||
lateinit var flavor: String
|
||||
private var pulseUrl: String? = null
|
||||
|
||||
private lateinit var upiSdkHelper: UpiSdkHelper
|
||||
private val reactHeaderMap: Map<String, String> by lazy { commonHttpClient.reactHeaderMapData }
|
||||
private val reactHeaderInterceptor: Interceptor by lazy {
|
||||
commonHttpClient.reactHeaderInterceptor
|
||||
@@ -67,7 +65,6 @@ object CommonLibManager {
|
||||
fun init(
|
||||
application: Application,
|
||||
listener: DeepLinkListener,
|
||||
upiSdkHelper: UpiSdkHelper,
|
||||
baseUrl: String,
|
||||
appVersionName: String,
|
||||
appVersionCode: String,
|
||||
@@ -75,7 +72,6 @@ object CommonLibManager {
|
||||
flavor: String,
|
||||
sslPinningKey: String,
|
||||
) {
|
||||
this.upiSdkHelper = upiSdkHelper
|
||||
this.flavor = flavor
|
||||
DeepLinkManager.init(listener)
|
||||
AppServiceManager.init(
|
||||
@@ -88,10 +84,6 @@ object CommonLibManager {
|
||||
)
|
||||
}
|
||||
|
||||
fun getUpiSdkHelper(): UpiSdkHelper {
|
||||
return upiSdkHelper
|
||||
}
|
||||
|
||||
fun getReactHeaderConfig(): Map<String, String> {
|
||||
return reactHeaderMap
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2024-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.common.upi
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import org.json.JSONObject
|
||||
|
||||
interface UpiSdkHelper {
|
||||
suspend fun getDataByType(type: UpiDataType): JSONObject
|
||||
|
||||
fun startAction(activity: Activity, launcher: ActivityResultLauncher<Intent>, data: JSONObject)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.payment.nativepayment.di
|
||||
|
||||
import com.navi.pay.common.setup.NaviPayManager
|
||||
import dagger.hilt.EntryPoint
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
|
||||
/**
|
||||
* Hilt EntryPoints for accessing dependencies in non-Hilt managed classes within the navi-payment
|
||||
* module.
|
||||
*/
|
||||
@EntryPoint
|
||||
@InstallIn(SingletonComponent::class)
|
||||
interface NaviPaymentWebBridgeEntryPoint {
|
||||
fun naviPayManager(): NaviPayManager
|
||||
}
|
||||
@@ -15,12 +15,12 @@ import androidx.activity.ComponentActivity
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.google.gson.GsonBuilder
|
||||
import com.navi.common.CommonLibManager
|
||||
import com.navi.common.upi.METADATA
|
||||
import com.navi.common.upi.PAYER_BANK_ACCOUNT_ID
|
||||
import com.navi.common.upi.T_STORE_ORDER_REFERENCE_ID
|
||||
import com.navi.common.upi.UpiDataType
|
||||
import com.navi.common.utils.toJsonObject
|
||||
import com.navi.pay.common.setup.NaviPayManager
|
||||
import com.navi.pay.utils.NAVI_PAY_UPI_URI_KEY
|
||||
import com.navi.payment.model.initiatesdk.PaymentPrefetchDetail
|
||||
import com.navi.payment.model.initiatesdk.PaymentPrefetchMethodRequest
|
||||
@@ -28,6 +28,7 @@ import com.navi.payment.nativepayment.NaviPaymentAnalytics
|
||||
import com.navi.payment.nativepayment.activity.WebPaymentActivity
|
||||
import com.navi.payment.nativepayment.dataprovider.WebPaymentDataProvider
|
||||
import com.navi.payment.nativepayment.dataprovider.WebPaymentDataProvider.Companion.WEB_PAY_ACTION
|
||||
import com.navi.payment.nativepayment.di.NaviPaymentWebBridgeEntryPoint
|
||||
import com.navi.payment.nativepayment.model.WebPaymentAction
|
||||
import com.navi.payment.nativepayment.model.WebPaymentSource
|
||||
import com.navi.payment.nativepayment.utils.getPayloadBasedOnType
|
||||
@@ -37,6 +38,7 @@ import com.navi.payment.utils.getInstalledUpiApps
|
||||
import com.navi.paymentclients.deserializers.ThirdPartyPayloadDeserializer
|
||||
import com.navi.paymentclients.model.thirdparty.ThirdPartyResultData
|
||||
import com.navi.paymentclients.model.thirdparty.UpiResultResponse
|
||||
import dagger.hilt.android.EntryPointAccessors
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.launch
|
||||
@@ -48,6 +50,14 @@ class NaviPaymentWebBridge(
|
||||
private val webUrlHostName: String,
|
||||
) {
|
||||
|
||||
private val naviPayManager: NaviPayManager by lazy {
|
||||
EntryPointAccessors.fromApplication(
|
||||
activity.applicationContext,
|
||||
NaviPaymentWebBridgeEntryPoint::class.java,
|
||||
)
|
||||
.naviPayManager()
|
||||
}
|
||||
|
||||
private val gson =
|
||||
GsonBuilder()
|
||||
.registerTypeAdapter(ThirdPartyResultData::class.java, ThirdPartyPayloadDeserializer())
|
||||
@@ -112,8 +122,7 @@ class NaviPaymentWebBridge(
|
||||
val accountData =
|
||||
getPayloadBasedOnType(
|
||||
gson,
|
||||
CommonLibManager.getUpiSdkHelper()
|
||||
.getDataByType(UpiDataType.CONNECTED_BANK_ACCOUNT),
|
||||
naviPayManager.getDataByType(UpiDataType.CONNECTED_BANK_ACCOUNT),
|
||||
)
|
||||
as? UpiResultResponse
|
||||
val data =
|
||||
@@ -140,8 +149,7 @@ class NaviPaymentWebBridge(
|
||||
val accountData =
|
||||
getPayloadBasedOnType(
|
||||
gson,
|
||||
CommonLibManager.getUpiSdkHelper()
|
||||
.getDataByType(UpiDataType.CONNECTED_BANK_ACCOUNT),
|
||||
naviPayManager.getDataByType(UpiDataType.CONNECTED_BANK_ACCOUNT),
|
||||
)
|
||||
as? UpiResultResponse
|
||||
val installedApps = getInstalledUpiApps()
|
||||
|
||||
Reference in New Issue
Block a user