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