diff --git a/sdk/src/main/java/com/iamport/sdk/domain/di/appModule.kt b/sdk/src/main/java/com/iamport/sdk/domain/di/appModule.kt index bae316a8..c145ca9c 100644 --- a/sdk/src/main/java/com/iamport/sdk/domain/di/appModule.kt +++ b/sdk/src/main/java/com/iamport/sdk/domain/di/appModule.kt @@ -32,7 +32,7 @@ val appModule = module { single { JudgeStrategy() } single { ChaiStrategy() } single { WebViewStrategy() } - single { NiceTransWebViewStrategy() } +// single { NiceTransWebViewStrategy() } single { CertificationWebViewStrategy() } } \ No newline at end of file diff --git a/sdk/src/main/java/com/iamport/sdk/domain/repository/StrategyRepository.kt b/sdk/src/main/java/com/iamport/sdk/domain/repository/StrategyRepository.kt index 5c935a2b..0e50e15d 100644 --- a/sdk/src/main/java/com/iamport/sdk/domain/repository/StrategyRepository.kt +++ b/sdk/src/main/java/com/iamport/sdk/domain/repository/StrategyRepository.kt @@ -9,7 +9,6 @@ import com.iamport.sdk.domain.strategy.base.IStrategy import com.iamport.sdk.domain.strategy.base.JudgeStrategy import com.iamport.sdk.domain.strategy.chai.ChaiStrategy import com.iamport.sdk.domain.strategy.webview.IamPortMobileModeWebViewClient -import com.iamport.sdk.domain.strategy.webview.NiceTransWebViewStrategy import com.iamport.sdk.domain.strategy.webview.WebViewStrategy import com.orhanobut.logger.Logger import org.koin.core.component.KoinApiExtension @@ -25,7 +24,7 @@ class StrategyRepository : IamportKoinComponent { private val webViewStrategy: WebViewStrategy by inject() // webview 사용하는 pg - private val niceTransWebViewStrategy: NiceTransWebViewStrategy by inject() +// private val niceTransWebViewStrategy: NiceTransWebViewStrategy by inject() /** * 실제로 앱 띄울 결제 타입 @@ -72,7 +71,7 @@ class StrategyRepository : IamportKoinComponent { Pair(it, request.pay_method).let { pair: Pair -> return when { isChaiPayment(pair) -> PaymentKinds.CHAI - isNiceTransPayment(pair) -> PaymentKinds.NICE + isNiceTransPayment(pair) -> PaymentKinds.WEB // PaymentKinds.NICE 사용 안함 else -> PaymentKinds.WEB } } @@ -81,24 +80,26 @@ class StrategyRepository : IamportKoinComponent { } // for 결제요청 - fun getWebViewStrategy(payment: Payment): IStrategy { - return when (getPaymentKinds(payment)) { - PaymentKinds.NICE -> niceTransWebViewStrategy - else -> webViewStrategy - } + fun getWebViewStrategy(): IStrategy { + return webViewStrategy +// return when (getPaymentKinds(payment)) { +// PaymentKinds.NICE -> niceTransWebViewStrategy +// else -> webViewStrategy +// } } // for webview mode inject - fun getWebViewClient(payment: Payment): WebViewClient { - return when (getPaymentKinds(payment)) { - PaymentKinds.NICE -> niceTransWebViewStrategy - else -> webViewStrategy - } + fun getWebViewClient(): WebViewClient { + return webViewStrategy +// return when (getPaymentKinds(payment)) { +// PaymentKinds.NICE -> niceTransWebViewStrategy +// else -> webViewStrategy +// } } - fun getNiceTransWebViewClient(): NiceTransWebViewStrategy { - return niceTransWebViewStrategy - } +// fun getNiceTransWebViewClient(): NiceTransWebViewStrategy { +// return niceTransWebViewStrategy +// } fun getMobileWebModeClient(): IamPortMobileModeWebViewClient { return mobileWebModeStrategy ?: run { diff --git a/sdk/src/main/java/com/iamport/sdk/domain/strategy/webview/IamPortMobileModeWebViewClient.kt b/sdk/src/main/java/com/iamport/sdk/domain/strategy/webview/IamPortMobileModeWebViewClient.kt index 9a01b664..f0cad31e 100644 --- a/sdk/src/main/java/com/iamport/sdk/domain/strategy/webview/IamPortMobileModeWebViewClient.kt +++ b/sdk/src/main/java/com/iamport/sdk/domain/strategy/webview/IamPortMobileModeWebViewClient.kt @@ -4,10 +4,11 @@ import android.os.Build import android.webkit.WebResourceRequest import android.webkit.WebView import androidx.annotation.RequiresApi +import com.iamport.sdk.data.nice.BankPayResultCode import com.iamport.sdk.domain.utils.Event import com.orhanobut.logger.Logger -open class IamPortMobileModeWebViewClient : NiceTransWebViewStrategy() { +open class IamPortMobileModeWebViewClient : WebViewStrategy() { @RequiresApi(Build.VERSION_CODES.LOLLIPOP) override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean { @@ -19,5 +20,4 @@ open class IamPortMobileModeWebViewClient : NiceTransWebViewStrategy() { return super.shouldOverrideUrlLoading(view, request) } - } \ No newline at end of file diff --git a/sdk/src/main/java/com/iamport/sdk/domain/strategy/webview/NiceTransWebViewStrategy.kt b/sdk/src/main/java/com/iamport/sdk/domain/strategy/webview/NiceTransWebViewStrategy.kt index 8b675d78..41c2f14b 100644 --- a/sdk/src/main/java/com/iamport/sdk/domain/strategy/webview/NiceTransWebViewStrategy.kt +++ b/sdk/src/main/java/com/iamport/sdk/domain/strategy/webview/NiceTransWebViewStrategy.kt @@ -14,6 +14,12 @@ import com.orhanobut.logger.Logger.* import java.net.URLDecoder import java.nio.charset.StandardCharsets +/** +// 해당로직 쓰지 않아도 정상 결제 되는 듯 함 +// NiceTransWebViewStrategy 가 필요없어진 듯 +// bankpay launcher 도 삭제해도 될 듯 + */ + open class NiceTransWebViewStrategy : WebViewStrategy() { // private val niceApi: NiceApi by inject() @@ -29,16 +35,16 @@ open class NiceTransWebViewStrategy : WebViewStrategy() { request?.url?.let { d("아주 나이스~ $it") - if (isNiceTransScheme(it)) { - - bankTid = it.getQueryParameter(NiceBankpay.USER_KEY).toString() - niceTransUrl = it.getQueryParameter(NiceBankpay.CALLBACKPARAM).toString() - - makeBankPayData(it)?.let { data -> - bus.niceTransRequestParam.postValue(Event(data)) // 뱅크페이 앱 열기 - } - return true - } +// if (isNiceTransScheme(it)) { +// +// bankTid = it.getQueryParameter(NiceBankpay.USER_KEY).toString() +// niceTransUrl = it.getQueryParameter(NiceBankpay.CALLBACKPARAM).toString() +// +// makeBankPayData(it)?.let { data -> +// bus.niceTransRequestParam.postValue(Event(data)) // 뱅크페이 앱 열기 +// } +// return true +// } } return super.shouldOverrideUrlLoading(view, request) diff --git a/sdk/src/main/java/com/iamport/sdk/domain/utils/UICoroutineScope.kt b/sdk/src/main/java/com/iamport/sdk/domain/utils/UICoroutineScope.kt index 4b9ac214..3cdcf72b 100644 --- a/sdk/src/main/java/com/iamport/sdk/domain/utils/UICoroutineScope.kt +++ b/sdk/src/main/java/com/iamport/sdk/domain/utils/UICoroutineScope.kt @@ -16,7 +16,7 @@ class UICoroutineScope(private val dispatchers: CoroutineContext = Dispatchers.M get() = dispatchers + job override fun releaseCoroutine() { - Logger.d("UICoroutineScope", "onRelease coroutine") + Logger.d("UICoroutineScope onRelease coroutine") job.cancel() } } \ No newline at end of file diff --git a/sdk/src/main/java/com/iamport/sdk/domain/utils/WebViewLiveDataEventBus.kt b/sdk/src/main/java/com/iamport/sdk/domain/utils/WebViewLiveDataEventBus.kt index ba1ae718..fd777ea2 100644 --- a/sdk/src/main/java/com/iamport/sdk/domain/utils/WebViewLiveDataEventBus.kt +++ b/sdk/src/main/java/com/iamport/sdk/domain/utils/WebViewLiveDataEventBus.kt @@ -13,7 +13,7 @@ object WebViewLiveDataEventBus { val openWebView = MutableLiveData>() // 나이스 + 실시간계좌 뱅크페이 앱 결과 - val niceTransRequestParam = MutableLiveData>() +// val niceTransRequestParam = MutableLiveData>() // 외부앱 val thirdPartyUri = MutableLiveData>() diff --git a/sdk/src/main/java/com/iamport/sdk/presentation/activity/BaseMain.kt b/sdk/src/main/java/com/iamport/sdk/presentation/activity/BaseMain.kt index 44d82e37..c9c3d0f4 100644 --- a/sdk/src/main/java/com/iamport/sdk/presentation/activity/BaseMain.kt +++ b/sdk/src/main/java/com/iamport/sdk/presentation/activity/BaseMain.kt @@ -13,7 +13,7 @@ import com.iamport.sdk.data.sdk.Payment interface BaseMain { fun openWebView(payment: Payment) fun openThirdPartyApp(it: Uri) - fun openNiceTransApp(it: String) +// fun openNiceTransApp(it: String) fun observeViewModel(payment: Payment?) fun requestPayment(it: Payment) fun sdkFinish(iamPortResponse: IamPortResponse?) diff --git a/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamPortMobileWebMode.kt b/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamPortMobileWebMode.kt index 86d4e251..44a71907 100644 --- a/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamPortMobileWebMode.kt +++ b/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamPortMobileWebMode.kt @@ -5,7 +5,6 @@ import android.os.Build import android.view.View import android.webkit.WebView import androidx.activity.ComponentActivity -import androidx.activity.result.ActivityResultLauncher import androidx.lifecycle.LiveData import com.iamport.sdk.data.sdk.IamPortResponse import com.iamport.sdk.data.sdk.Payment @@ -17,7 +16,7 @@ import com.orhanobut.logger.Logger import org.koin.core.component.KoinApiExtension @KoinApiExtension -open class IamPortMobileWebMode(bankPayLauncher: ActivityResultLauncher?) : IamPortWebViewMode(bankPayLauncher = bankPayLauncher) { +open class IamPortMobileWebMode() : IamPortWebViewMode() { fun initStart(activity: ComponentActivity, webview: WebView) { Logger.i("HELLO I'MPORT Mobile Web Mode SDK!") @@ -28,10 +27,10 @@ open class IamPortMobileWebMode(bankPayLauncher: ActivityResultLauncher? observeViewModel(null) // 관찰할 LiveData } - override fun processBankPayPayment(resPair: Pair) { - Logger.d("processBankPayPayment") - viewModel.mobileModeProcessBankPayPayment(resPair) - } +// override fun processBankPayPayment(resPair: Pair) { +// Logger.d("ignore processBankPayPayment") +// viewModel.mobileModeProcessBankPayPayment(resPair) +// } /** @@ -40,7 +39,7 @@ open class IamPortMobileWebMode(bankPayLauncher: ActivityResultLauncher? override fun observeViewModel(payment: Payment?) { activity?.run { - viewModel.niceTransRequestParam().observe(this, EventObserver(this@IamPortMobileWebMode::openNiceTransApp)) +// viewModel.niceTransRequestParam().observe(this, EventObserver(this@IamPortMobileWebMode::openNiceTransApp)) viewModel.thirdPartyUri().observe(this, EventObserver(this@IamPortMobileWebMode::openThirdPartyApp)) viewModel.impResponse().observe(this, EventObserver(this@IamPortMobileWebMode::sdkFinish)) diff --git a/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamPortWebViewMode.kt b/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamPortWebViewMode.kt index 7d3b0d13..04ca55e8 100644 --- a/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamPortWebViewMode.kt +++ b/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamPortWebViewMode.kt @@ -5,7 +5,6 @@ import android.net.Uri import android.view.View import android.webkit.WebView import androidx.activity.ComponentActivity -import androidx.activity.result.ActivityResultLauncher import com.google.gson.GsonBuilder import com.iamport.sdk.data.sdk.IamPortResponse import com.iamport.sdk.data.sdk.Payment @@ -24,7 +23,6 @@ import org.koin.core.qualifier.named @KoinApiExtension open class IamPortWebViewMode @JvmOverloads constructor( - val bankPayLauncher: ActivityResultLauncher?, scope: BaseCoroutineScope = UICoroutineScope() ) : IamportKoinComponent, BaseMain, BaseCoroutineScope by scope { @@ -45,9 +43,9 @@ open class IamPortWebViewMode @JvmOverloads constructor( observeViewModel(payment) // 관찰할 LiveData } - open fun processBankPayPayment(resPair: Pair) { - viewModel.processBankPayPayment(resPair) - } +// open fun processBankPayPayment(resPair: Pair) { +// viewModel.processBankPayPayment(resPair) +// } /** * 관찰할 LiveData 옵저빙 @@ -58,7 +56,7 @@ open class IamPortWebViewMode @JvmOverloads constructor( activity?.let { viewModel.run { openWebView().observe(it, EventObserver(this@IamPortWebViewMode::openWebView)) - niceTransRequestParam().observe(it, EventObserver(this@IamPortWebViewMode::openNiceTransApp)) +// niceTransRequestParam().observe(it, EventObserver(this@IamPortWebViewMode::openNiceTransApp)) thirdPartyUri().observe(it, EventObserver(this@IamPortWebViewMode::openThirdPartyApp)) impResponse().observe(it, EventObserver(this@IamPortWebViewMode::sdkFinish)) @@ -88,7 +86,7 @@ open class IamPortWebViewMode @JvmOverloads constructor( viewModel.run { d("do removeObservers") openWebView().removeObservers(it) - niceTransRequestParam().removeObservers(it) +// niceTransRequestParam().removeObservers(it) thirdPartyUri().removeObservers(it) impResponse().removeObservers(it) } @@ -125,15 +123,15 @@ open class IamPortWebViewMode @JvmOverloads constructor( /** * 뱅크페이 외부앱 열기 for nice PG + 실시간계좌이체(trans) */ - override fun openNiceTransApp(it: String) { - d("openNiceTransApp $it") - runCatching { - bankPayLauncher?.launch(it) - }.onFailure { - // 뱅크페이 앱 패키지는 하드코딩 - activity?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Util.getMarketId(ProvidePgPkg.BANKPAY.pkg)))) - } - } +// override fun openNiceTransApp(it: String) { +// d("openNiceTransApp $it") +// runCatching { +// bankPayLauncher?.launch(it) +// }.onFailure { +//// 뱅크페이 앱 패키지는 하드코딩 +// activity?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Util.getMarketId(ProvidePgPkg.BANKPAY.pkg)))) +// } +// } /** * 외부앱 열기 @@ -200,7 +198,7 @@ open class IamPortWebViewMode @JvmOverloads constructor( JsNativeInterface(payment, get(named("${CONST.KOIN_KEY}Gson")), evaluateJS), CONST.PAYMENT_WEBVIEW_JS_INTERFACE_NAME ) - webViewClient = viewModel.getWebViewClient(payment) + webViewClient = viewModel.getWebViewClient() visibility = View.VISIBLE loadUrl(CONST.PAYMENT_FILE_URL) // load WebView diff --git a/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamportSdk.kt b/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamportSdk.kt index 4de889a2..2e7298d7 100644 --- a/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamportSdk.kt +++ b/sdk/src/main/java/com/iamport/sdk/presentation/activity/IamportSdk.kt @@ -15,12 +15,10 @@ import com.iamport.sdk.data.sdk.IamPortApprove import com.iamport.sdk.data.sdk.IamPortResponse import com.iamport.sdk.data.sdk.Payment import com.iamport.sdk.data.sdk.ProvidePgPkg -import com.iamport.sdk.domain.core.Iamport import com.iamport.sdk.domain.core.IamportReceiver import com.iamport.sdk.domain.di.IamportKoinComponent import com.iamport.sdk.domain.utils.* import com.iamport.sdk.domain.utils.Util.observeAlways -import com.iamport.sdk.presentation.contract.BankPayContract import com.iamport.sdk.presentation.contract.ChaiContract import com.iamport.sdk.presentation.viewmodel.MainViewModel import com.iamport.sdk.presentation.viewmodel.MainViewModelFactory @@ -63,8 +61,8 @@ internal class IamportSdk( // --------------------------------------------- // 뱅크페이 앱 런처s - private var bankPayLauncher: ActivityResultLauncher? = null // 뱅크페이 앱 런처(for webview & mobile web mode) - private val bankPayContract by lazy { BankPayContract() } +// private var bankPayLauncher: ActivityResultLauncher? = null // 뱅크페이 앱 런처(for webview & mobile web mode) +// private val bankPayContract by lazy { BankPayContract() } // 차이 앱 런처 private var launcherChai: ActivityResultLauncher>? = null // 차이앱 런처 @@ -100,21 +98,21 @@ internal class IamportSdk( MODE.ACTIVITY -> { hostHelper.getActivityRef()?.run { launcherChai = registerForActivityResult(chaiContract) { resultCallback() } - bankPayLauncher = registerForActivityResult(bankPayContract) { - if (it != null) { - resultBankPayAppCallback(it) - } - } +// bankPayLauncher = registerForActivityResult(bankPayContract) { +// if (it != null) { +// resultBankPayAppCallback(it) +// } +// } } } MODE.FRAGMENT -> { hostHelper.getFragmentRef()?.run { launcherChai = registerForActivityResult(chaiContract) { resultCallback() } - bankPayLauncher = registerForActivityResult(bankPayContract) { - if (it != null) { - resultBankPayAppCallback(it) - } - } +// bankPayLauncher = registerForActivityResult(bankPayContract) { +// if (it != null) { +// resultBankPayAppCallback(it) +// } +// } } } MODE.NONE -> { @@ -155,7 +153,7 @@ internal class IamportSdk( hostHelper.getActivityRef()?.let { webviewRef.get()?.let { webview -> - iamPortMobileWebMode = IamPortMobileWebMode(bankPayLauncher) + iamPortMobileWebMode = IamPortMobileWebMode() iamPortMobileWebMode?.initStart(it, webview) // webview only 모드 } } @@ -386,14 +384,14 @@ internal class IamportSdk( /** * 나이스 뱅크페이 앱 종료 콜백 감지 for 웹뷰모드, 모바일웹모드 */ - private fun resultBankPayAppCallback(resPair: Pair) { - d("Result Callback BankPayLauncher") - if (modeWebViewRef?.get() != null) { - iamPortWebViewMode?.processBankPayPayment(resPair) - return - } - iamPortMobileWebMode?.processBankPayPayment(resPair) - } +// private fun resultBankPayAppCallback(resPair: Pair) { +// d("Result Callback BankPayLauncher") +// if (modeWebViewRef?.get() != null) { +// iamPortWebViewMode?.processBankPayPayment(resPair) +// return +// } +// iamPortMobileWebMode?.processBankPayPayment(resPair) +// } /** @@ -445,7 +443,7 @@ internal class IamportSdk( clearMainViewModel() modeWebViewRef?.get()?.let { webView -> hostHelper.getActivityRef()?.let { activity -> - iamPortWebViewMode = IamPortWebViewMode(bankPayLauncher) + iamPortWebViewMode = IamPortWebViewMode() iamPortWebViewMode?.initStart(activity, webView, payment, paymentResultCallBack) // webview only 모드 } ?: run { w("Cannot found activity, So running activity mode") diff --git a/sdk/src/main/java/com/iamport/sdk/presentation/activity/WebViewActivity.kt b/sdk/src/main/java/com/iamport/sdk/presentation/activity/WebViewActivity.kt index 6b9cd6dc..e26d5ead 100644 --- a/sdk/src/main/java/com/iamport/sdk/presentation/activity/WebViewActivity.kt +++ b/sdk/src/main/java/com/iamport/sdk/presentation/activity/WebViewActivity.kt @@ -15,7 +15,6 @@ import com.iamport.sdk.domain.IamportWebChromeClient import com.iamport.sdk.domain.JsNativeInterface import com.iamport.sdk.domain.di.IamportKoinComponent import com.iamport.sdk.domain.utils.* -import com.iamport.sdk.presentation.contract.BankPayContract import com.iamport.sdk.presentation.viewmodel.WebViewModel import com.orhanobut.logger.Logger.* import kotlinx.coroutines.* @@ -37,13 +36,13 @@ class WebViewActivity : BaseActivity(), Ia /** * 뱅크페이 앱 열기 위한 런처 */ - private var launcherBankPay = - registerForActivityResult(BankPayContract()) { res: Pair? -> - res?.let { - loadingVisible(true) - viewModel.processBankPayPayment(res) - } ?: e("NICE TRANS result is NULL") - } +// private var launcherBankPay = +// registerForActivityResult(BankPayContract()) { res: Pair? -> +// res?.let { +// loadingVisible(true) +// viewModel.processBankPayPayment(res) +// } ?: e("NICE TRANS result is NULL") +// } override fun onDestroy() { runCatching { @@ -102,7 +101,7 @@ class WebViewActivity : BaseActivity(), Ia viewModel.openWebView().observe(this, EventObserver(this::openWebView)) - viewModel.niceTransRequestParam().observe(this, EventObserver(this::openNiceTransApp)) +// viewModel.niceTransRequestParam().observe(this, EventObserver(this::openNiceTransApp)) viewModel.thirdPartyUri().observe(this, EventObserver(this::openThirdPartyApp)) viewModel.impResponse().observe(this, EventObserver(this::sdkFinish)) @@ -135,7 +134,7 @@ class WebViewActivity : BaseActivity(), Ia d("WebViewActivity removeObservers") viewModel.loading().removeObservers(this) viewModel.openWebView().removeObservers(this) - viewModel.niceTransRequestParam().removeObservers(this) +// viewModel.niceTransRequestParam().removeObservers(this) viewModel.thirdPartyUri().removeObservers(this) viewModel.impResponse().removeObservers(this) }.onFailure { @@ -178,15 +177,15 @@ class WebViewActivity : BaseActivity(), Ia /** * 뱅크페이 외부앱 열기 for nice PG + 실시간계좌이체(trans) */ - override fun openNiceTransApp(it: String) { - runCatching { - launcherBankPay.launch(it) // 뱅크페이 앱 실행 - }.onFailure { - // 뱅크페이 앱 패키지는 하드코딩 - startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Util.getMarketId(ProvidePgPkg.BANKPAY.pkg)))) - } - loadingVisible(false) - } +// override fun openNiceTransApp(it: String) { +// runCatching { +// launcherBankPay.launch(it) // 뱅크페이 앱 실행 +// }.onFailure { +// 뱅크페이 앱 패키지는 하드코딩 +// startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Util.getMarketId(ProvidePgPkg.BANKPAY.pkg)))) +// } +// loadingVisible(false) +// } /** * 외부앱 열기 @@ -261,7 +260,7 @@ class WebViewActivity : BaseActivity(), Ia JsNativeInterface(payment, get(named("${CONST.KOIN_KEY}Gson")), evaluateJS), CONST.PAYMENT_WEBVIEW_JS_INTERFACE_NAME ) - webViewClient = viewModel.getWebViewClient(payment) + webViewClient = viewModel.getWebViewClient() visibility = View.VISIBLE loadUrl(CONST.PAYMENT_FILE_URL) // load WebView diff --git a/sdk/src/main/java/com/iamport/sdk/presentation/viewmodel/WebViewModel.kt b/sdk/src/main/java/com/iamport/sdk/presentation/viewmodel/WebViewModel.kt index b83b3ba9..eff8a625 100644 --- a/sdk/src/main/java/com/iamport/sdk/presentation/viewmodel/WebViewModel.kt +++ b/sdk/src/main/java/com/iamport/sdk/presentation/viewmodel/WebViewModel.kt @@ -38,9 +38,9 @@ class WebViewModel(private val repository: StrategyRepository) : BaseViewModel() /** * 뱅크페이 외부앱 열기 */ - fun niceTransRequestParam(): LiveData> { - return bus.niceTransRequestParam - } +// fun niceTransRequestParam(): LiveData> { +// return bus.niceTransRequestParam +// } /** * 외부앱 열기 @@ -75,23 +75,23 @@ class WebViewModel(private val repository: StrategyRepository) : BaseViewModel() /** * PG(nice or 비nice) 따라 webview client 가져오기 */ - fun getWebViewClient(payment: Payment): WebViewClient { - return repository.getWebViewClient(payment) + fun getWebViewClient(): WebViewClient { + return repository.getWebViewClient() } /** * 뱅크페이 결과 처리 */ - fun processBankPayPayment(resPair: Pair) { - repository.getNiceTransWebViewClient().processBankPayPayment(resPair) - } +// fun processBankPayPayment(resPair: Pair) { +// repository.getNiceTransWebViewClient().processBankPayPayment(resPair) +// } /** * MobileWebMode 뱅크페이 결과 처리 */ - fun mobileModeProcessBankPayPayment(resPair: Pair) { - getMobileWebModeClient().processBankPayPayment(resPair) - } +// fun mobileModeProcessBankPayPayment(resPair: Pair) { +// getMobileWebModeClient().processBankPayPayment(resPair) +// } /** * MobileWebMode WebViewClient @@ -112,7 +112,7 @@ class WebViewModel(private val repository: StrategyRepository) : BaseViewModel() */ fun requestPayment(payment: Payment) { viewModelScope.launch { - repository.getWebViewStrategy(payment).doWork(payment) + repository.getWebViewStrategy().doWork(payment) } } } \ No newline at end of file