parent
756675e622
commit
7587b8bc25
|
@ -40,8 +40,8 @@ android {
|
|||
applicationId "kr.co.vividnext.sodalive"
|
||||
minSdk 23
|
||||
targetSdk 33
|
||||
versionCode 82
|
||||
versionName "1.13.0"
|
||||
versionCode 83
|
||||
versionName "1.13.1"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
|
|
@ -159,39 +159,28 @@ class CanPaymentActivity : BaseActivity<ActivityCanPaymentBinding>(
|
|||
}
|
||||
|
||||
private fun requestPayment(chargeId: Long) {
|
||||
var username = SharedPreferenceManager.nickname
|
||||
|
||||
if (username.length > 10) {
|
||||
username = "${username.take(6)}..."
|
||||
}
|
||||
|
||||
val user = BootUser()
|
||||
.setId("${SharedPreferenceManager.userId}")
|
||||
.setUsername(SharedPreferenceManager.nickname)
|
||||
.setUsername(username)
|
||||
|
||||
val payload = Payload()
|
||||
.setApplicationId(
|
||||
if (viewModel.paymentMethodLiveData.value!! == PaymentMethod.PHONE) {
|
||||
BuildConfig.BOOTPAY_APP_ID
|
||||
} else {
|
||||
BuildConfig.BOOTPAY_APP_HECTO_ID
|
||||
}
|
||||
)
|
||||
.setApplicationId(BuildConfig.BOOTPAY_APP_HECTO_ID)
|
||||
.setOrderId("$chargeId")
|
||||
.setOrderName(canResponse!!.title)
|
||||
.setPrice(canResponse!!.price.toDouble())
|
||||
.setTaxFree(0.toDouble())
|
||||
.setPg(
|
||||
if (viewModel.paymentMethodLiveData.value!! == PaymentMethod.PHONE) {
|
||||
"웰컴페이먼츠"
|
||||
} else {
|
||||
"세틀뱅크"
|
||||
}
|
||||
)
|
||||
.setPg("세틀뱅크")
|
||||
.setMethod(viewModel.paymentMethodLiveData.value!!.method)
|
||||
.setUser(user)
|
||||
|
||||
Bootpay.init(this, this)
|
||||
.setPayload(
|
||||
if (viewModel.paymentMethodLiveData.value!! == PaymentMethod.PHONE) {
|
||||
payload
|
||||
} else {
|
||||
payload.setUser(user)
|
||||
}
|
||||
)
|
||||
.setPayload(payload)
|
||||
.setEventListener(object : BootpayEventListener {
|
||||
override fun onCancel(data: String) {
|
||||
Logger.e("onCancel: $data")
|
||||
|
@ -230,42 +219,22 @@ class CanPaymentActivity : BaseActivity<ActivityCanPaymentBinding>(
|
|||
val bootpayResponse = Gson().fromJson(data, BootpayResponse::class.java)
|
||||
val request = VerifyRequest(bootpayResponse.data.receiptId, bootpayResponse.data.orderId)
|
||||
|
||||
if (viewModel.paymentMethodLiveData.value!! == PaymentMethod.PHONE) {
|
||||
viewModel.verify(
|
||||
request,
|
||||
onSuccess = {
|
||||
Toast.makeText(applicationContext, "캔이 충전되었습니다", Toast.LENGTH_LONG).show()
|
||||
SharedPreferenceManager.can += (canResponse!!.rewardCan + canResponse!!.can)
|
||||
if (gotoPrevPage) {
|
||||
setResult(RESULT_OK)
|
||||
} else {
|
||||
val intent = Intent(applicationContext, CanStatusActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
finish()
|
||||
},
|
||||
onFailure = {
|
||||
Toast.makeText(applicationContext, it, Toast.LENGTH_LONG).show()
|
||||
viewModel.verifyHecto(
|
||||
request,
|
||||
onSuccess = {
|
||||
Toast.makeText(applicationContext, "캔이 충전되었습니다", Toast.LENGTH_LONG).show()
|
||||
SharedPreferenceManager.can += (canResponse!!.rewardCan + canResponse!!.can)
|
||||
if (gotoPrevPage) {
|
||||
setResult(RESULT_OK)
|
||||
} else {
|
||||
val intent = Intent(applicationContext, CanStatusActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
viewModel.verifyHecto(
|
||||
request,
|
||||
onSuccess = {
|
||||
Toast.makeText(applicationContext, "캔이 충전되었습니다", Toast.LENGTH_LONG).show()
|
||||
SharedPreferenceManager.can += (canResponse!!.rewardCan + canResponse!!.can)
|
||||
if (gotoPrevPage) {
|
||||
setResult(RESULT_OK)
|
||||
} else {
|
||||
val intent = Intent(applicationContext, CanStatusActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
finish()
|
||||
},
|
||||
onFailure = {
|
||||
Toast.makeText(applicationContext, it, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
)
|
||||
}
|
||||
finish()
|
||||
},
|
||||
onFailure = {
|
||||
Toast.makeText(applicationContext, it, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue