mid

https://docs.tosspayments.com/guides/payment/integration#4-%EA%B2%B0%EC%A0%9C-%EC%99%84%EB%A3%8C-%ED%9B%84-%EC%9D%91%EB%8B%B5-%ED%99%95%EC%9D%B8%ED%95%98%EA%B8%B0

"mId".

우 widget해 PaymentCallback에 TossPaymentResult.Success해 paymentKey, orderId, amount, additionalParameters. 위 document"mid"?

paymentWidget.requestPayment(
paymentInfo,
object : PaymentCallback {
override fun onPaymentFailed(fail: TossPaymentResult.Fail) {
Timber.d("renderPayment onPaymentFailed() : ${fail.errorCode} ${fail.errorMessage}")
showToast(fail.errorMessage)
viewModel.resultLoading(false)

binding.buttonPayment.isEnabled = true
}

override fun onPaymentSuccess(success: TossPaymentResult.Success) {
viewModel.requestApproval(success.paymentKey, success.orderId)
binding.buttonPayment.isEnabled = true
}
}
)
}

sealed interface TossPaymentResult {
@Parcelize
class Success(
val paymentKey: String,
val orderId: String,
val amount: Number,
val additionalParameters: Map<String, String>
) : TossPaymentResult, Parcelable

@Parcelize
class Fail(val errorCode: String, val errorMessage: String, val orderId: String?) :
TossPaymentResult, Parcelable
}
Was this page helpful?