Skip to content

Commit

Permalink
Merge pull request #49 from iamport/fix/eximbay
Browse files Browse the repository at this point in the history
fix : eximbay 결제창 오류
  • Loading branch information
kjh5833 authored Dec 20, 2021
2 parents ab7beb5 + 09a593e commit 7134439
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
7 changes: 7 additions & 0 deletions sdk/src/main/java/com/iamport/sdk/data/sdk/Payment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ data class Payment(
}
}

// 엑심베이eximbay 의 경우 popup 파라미터를 false 로 해야 redirect 로 열림
if (PG.convertPG(pg) == PG.eximbay) {
if (popup == null || popup == true) {
return false to CONST.ERR_PAYMENT_VALIDATOR_EXIMBAY
}
}

// if (PG.convertPG(pg) == PG.paypal) {
// if (m_redirect_url.isNullOrBlank() || m_redirect_url == CONST.IAMPORT_DETECT_URL) {
// return false to CONST.ERR_PAYMENT_VALIDATOR_PAYPAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.webkit.WebView
import androidx.annotation.RequiresApi
import com.iamport.sdk.data.sdk.Payment
import com.iamport.sdk.domain.strategy.base.BaseWebViewStrategy
import com.iamport.sdk.domain.utils.CONST
import com.iamport.sdk.domain.utils.Event
import com.iamport.sdk.domain.utils.Util
import com.orhanobut.logger.Logger.d
Expand Down Expand Up @@ -40,6 +41,10 @@ open class WebViewStrategy : BaseWebViewStrategy() {
request?.url?.let {
d(it)

if (it.scheme == CONST.ABOUT_BLANK_SCHEME) {
return true // 이동하지 않음
}

if (isAppUrl(it)) {
bus.thirdPartyUri.postValue(Event(it))
return true
Expand Down
13 changes: 8 additions & 5 deletions sdk/src/main/java/com/iamport/sdk/domain/utils/CONST.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ object CONST {
const val APP_SCHME = "iamport_android"
const val HTTP_SCHEME = "http"
const val HTTPS_SCHEME = "https"
const val ABOUT_BLANK_SCHEME = "about:blank"
const val ABOUT_BLANK_SCHEME = "about"

const val EMPTY_STR = ""

Expand Down Expand Up @@ -62,9 +62,12 @@ object CONST {

// payment 객체 validation 관련
const val PASS_PAYMENT_VALIDATOR = "성공"
const val ERR_PAYMENT_VALIDATOR_VBANK = "가상계좌 결제는 만료일자(vbank_due) 항목 필수입니다 (YYYYMMDDhhmm 형식)"
const val ERR_PAYMENT_VALIDATOR_PHONE = "휴대폰 소액결제는 digital 항목 필수입니다"
const val ERR_PAYMENT_VALIDATOR_DANAL_VBANK = "다날 가상계좌 결제는 사업자 등록번호(biz_num) 항목 필수입니다 (계약된 사업자등록번호 10자리)"
// const val ERR_PAYMENT_VALIDATOR_PAYPAL = "페이팔 결제는 m_redirect_url 항목 필수입니다"

private const val PREFIX_ERR = "[SDK ERR]"
const val ERR_PAYMENT_VALIDATOR_VBANK = "$PREFIX_ERR 가상계좌 결제는 만료일자(vbank_due) 항목 필수입니다 (YYYYMMDDhhmm 형식)"
const val ERR_PAYMENT_VALIDATOR_PHONE = "$PREFIX_ERR 휴대폰 소액결제는 digital 항목 필수입니다"
const val ERR_PAYMENT_VALIDATOR_DANAL_VBANK = "$PREFIX_ERR 다날 가상계좌 결제는 사업자 등록번호(biz_num) 항목 필수입니다 (계약된 사업자등록번호 10자리)"
const val ERR_PAYMENT_VALIDATOR_EXIMBAY = "$PREFIX_ERR eximbay 는 모바일앱 결제시 IamPortRequest popup 파라미터를 false 로 지정해야 결제창이 열립니다."
// const val ERR_PAYMENT_VALIDATOR_PAYPAL = "$PREFIX_ERR 페이팔 결제는 m_redirect_url 항목 필수입니다"

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ 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?)
Expand All @@ -27,7 +28,7 @@ interface BaseMain {
javaScriptEnabled = true

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);
WebView.setWebContentsDebuggingEnabled(BuildConfig.DEBUG)
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Expand All @@ -42,8 +43,8 @@ interface BaseMain {
blockNetworkImage = false
loadsImagesAutomatically = true

if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
safeBrowsingEnabled = true // api 26
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
safeBrowsingEnabled = BuildConfig.DEBUG // api 26
}

useWideViewPort = false
Expand Down

0 comments on commit 7134439

Please sign in to comment.