提现错误码 文案统一处理

This commit is contained in:
renhaoting 2026-01-05 16:22:02 +08:00
parent fa47bba027
commit 0d092b8422
5 changed files with 129 additions and 54 deletions

View File

@ -66,7 +66,7 @@ object VidiConst {
const val URL_ZERO_BUY: String = "https://jt.3idiotstudio.com"
const val URL_WITHDRAW: String = "https://zz.rsappinc.com/eonline4/" //"https://jpec.3idiotstudio.com"
const val URL_WITHDRAW: String = "https://zz.rsappinc.com" //"https://jpec.3idiotstudio.com"

View File

@ -223,26 +223,24 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
val reqInitBean = result.data.data
reqInitBean?.let {
var errorHintRes = 0
var failType = 0
if (it.error == 0 && !it.uuid.isNullOrEmpty() && !it.items.isNullOrEmpty()) {
val itemId = if (withdrawNum <= VidiConst.WITHDRAW_SMALL_NUM) 0 else 1
val withDrawItem = it.items?.get(itemId)!!
if (withDrawItem.status == INIT_ACTIVE) {
if (withDrawItem.status == WithdrawManager.INIT_OK) {
requestPayout(it.uuid!!, withDrawItem.id, withdrawNum)
} else {
errorHintRes = R.string.withdraw_fail_reach_day_limit
failType = withDrawItem.status
}
} else {
// 0成功1失败2签名验证失败3客户端版本过低4 ts长度错误
when (it.error) {
3-> errorHintRes = R.string.withdraw_fail_version_toolow
}
failType = it.error + 10
}
if (errorHintRes > 0) {
showFailDialog(errorHintRes)
if (failType > 0) {
showFailDialog(WithdrawManager.instance().getFailHintStrRes(failType))
}
}
@ -267,30 +265,21 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
is Result.Loading -> {
}
is Result.Success -> {
var errHintRes = 0
var failType: Int? = 0
when (result.data?.data?.error) {
if (result.data?.data?.error == 0) {
saveNewRecord(result.data.data!!, payCashNum, currentTimeMs)
} else {
/* 错误码
0成功1失败2签名验证失败3客户端版本过低4uuid错误5所在地国家或地区不在提现限制内6提现金额不符对应的产品id7提现产品id不对8达到提现金额限制9提现次数超过限制10今日没有提现机会11提现账号达到次数限制12身份审核条件不满足不能提现13巴西提现参数 document_type 错误
14巴西提现参数 document_id 错误15 巴西提现参数 AccountType 错误16 巴西提现参数 Name 错误17巴西提现参数 Account DocumentId 不同18巴西提现参数account_type为CPF时 对应的 account 错误19巴西提现参数account_type为CNPJ时 对应的 account 错误20巴西提现参数 account_type 错误
21巴西提现参数 document_type 错误22巴西提现参数account_type为CPF时 对应的 document_id 错误23巴西提现参数account_type为CNPJ时 对应的 document_id 错误24 ts长度错误25 没提0.1就提现其它的
*/
0 -> {
saveNewRecord(result.data.data!!, payCashNum, currentTimeMs)
failType = result.data?.data?.error
if (failType != null && failType > 0) {
failType += 20
showFailDialog(WithdrawManager.instance().getFailHintStrRes(failType))
}
5-> {
errHintRes = R.string.withdraw_fail_region_restricit
}
8-> {
errHintRes = R.string.withdraw_fail_amount_limit
}
9-> {
errHintRes = R.string.withdraw_fail_amount_limit
}
}
if (errHintRes > 0) {
showFailDialog(errHintRes)
}
}
is Result.Error -> {
@ -338,7 +327,7 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
}
TRANSACTION_STATE_FAIL -> {
showFailDialog(WithdrawManager.instance().getFailShowTextRes(record.failReason))
showFailDialog(WithdrawManager.instance().getFailHintStrRes(record.failReason))
WithdrawManager.instance().saveRecordHasNotifyState(record.recordNo)
}
}
@ -400,8 +389,6 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
companion object {
const val INIT_ACTIVE = 1
internal fun startActivity(activity: Activity) {
activity.startActivity(Intent(activity.applicationContext, WithDrawActivity::class.java))
}

View File

@ -21,13 +21,13 @@ import com.gamedog.vididin.beans.WatchAdNotifyBean
import com.gamedog.vididin.beans.resp.PayoutReply
import com.gamedog.vididin.beans.resp.WithdrawRecord
import com.gamedog.vididin.core.login.login.AccountManager
import com.gamedog.vididin.features.withdraw.WithDrawActivity.Companion.INIT_ACTIVE
import com.gamedog.vididin.features.withdraw.dialogs.WithdrawBindBankDialog
import com.gamedog.vididin.features.withdraw.dialogs.WithdrawFailDialog
import com.gamedog.vididin.features.withdraw.dialogs.WithdrawInfoConfirmDialog
import com.gamedog.vididin.features.withdraw.dialogs.WithdrawSuccessDialog
import com.gamedog.vididin.manager.WithdrawItemBean
import com.gamedog.vididin.manager.WithdrawManager
import com.gamedog.vididin.manager.WithdrawManager.Companion.INIT_OK
import com.gamedog.vididin.manager.WithdrawManager.Companion.TRANSACTION_STATE_FAIL
import com.gamedog.vididin.manager.WithdrawManager.Companion.TRANSACTION_STATE_ONGOING
import com.gamedog.vididin.manager.WithdrawManager.Companion.TRANSACTION_STATE_SUCCESS
@ -126,7 +126,7 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
if (it.error == 0 && !it.uuid.isNullOrEmpty() && !it.items.isNullOrEmpty()) {
val itemId = if (withdrawNum <= VidiConst.WITHDRAW_SMALL_NUM) 0 else 1
val withDrawItem = it.items?.get(itemId)!!
if (withDrawItem.status == INIT_ACTIVE) {
if (withDrawItem.status == INIT_OK) {
requestPayout(it.uuid!!, withDrawItem.id, withdrawNum)
} else {
errorHintRes = R.string.withdraw_fail_reach_day_limit
@ -276,7 +276,7 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
}
TRANSACTION_STATE_FAIL -> {
showFailDialog(WithdrawManager.instance().getFailShowTextRes(record.failReason))
showFailDialog(WithdrawManager.instance().getFailHintStrRes(record.failReason))
WithdrawManager.instance().saveRecordHasNotifyState(record.recordNo)
}
}

View File

@ -51,6 +51,38 @@ class WithdrawManager private constructor() {
companion object {
const val EACH_SUB_ITEM_CASH_NUM: Double = 1.0
//----------------------- FROM pagsmile.proto ------------------------------
// init接口 status
// 1可提现 2:条件未达成 3:已提现, 4:禁止提现, 5:提现中
const val INIT_OK = 1
const val ERROR_NOT_REACH_CONDITION = 2
const val ERROR_ALREADY_WITHDRAWED = 3
const val ERROR_FORBID = 4
const val ERROR_WITHDRAWING = 5
// init接口 服务器 error 字段
// 0成功1失败2签名验证失败3客户端版本过低4 ts长度错误
const val ERROR_FAILED_UNKNOW = 1 + 10
const val ERROR_APP_VERSION_LOW = 3 + 10
/* payout接口 错误码
0成功1失败2签名验证失败3客户端版本过低4uuid错误5所在地国家或地区不在提现限制内6提现金额不符对应的产品id7提现产品id不对8达到提现金额限制9提现次数超过限制10今日没有提现机会11提现账号达到次数限制12身份审核条件不满足不能提现13巴西提现参数 document_type 错误
14巴西提现参数 document_id 错误15 巴西提现参数 AccountType 错误16 巴西提现参数 Name 错误17巴西提现参数 Account DocumentId 不同18巴西提现参数account_type为CPF时 对应的 account 错误19巴西提现参数account_type为CNPJ时 对应的 account 错误20巴西提现参数 account_type 错误
21巴西提现参数 document_type 错误22巴西提现参数account_type为CPF时 对应的 document_id 错误23巴西提现参数account_type为CNPJ时 对应的 document_id 错误24 ts长度错误25 没提0.1就提现其它的
*/
const val ERROR_PAYOUT_UNKNOW = 1 + 20
const val ERROR_PAYOUT_APP_VERSION_LOW = 3 + 20
const val ERROR_PAYOUT_COUNTRY_RESTRICTION = 5 + 20
const val ERROR_PAYOUT_REACH_TOTAL_LIMIT = 8 + 20
const val ERROR_PAYOUT_REACH_TIMES_LIMIT = 9 + 20
const val ERROR_PAYOUT_TODAY_NO_CHANCE = 10 + 20
const val ERROR_PAYOUT_ACCOUNT_REACH_TIMES_LIMIT = 11 + 20
const val ERROR_PAYOUT_USER_IDENTITY_LIMIT = 12 + 20
const val ERROR_PAYOUT_MUST_WITHDRAW01_FIRST = 25 + 20
// subBean 状态
const val STATE_NEED_WATCH_AD: Int = 0
@ -65,10 +97,6 @@ class WithdrawManager private constructor() {
const val TRANSACTION_STATE_FAIL : Int = 3
// 提现失败分类(自定义)
const val FAIL_TYPE_UNKNOWN : Int = 1
const val FAIL_TYPE_APP_VERSION_LOW : Int = 2
@Volatile
private var instance: WithdrawManager? = null
@ -376,7 +404,7 @@ class WithdrawManager private constructor() {
is Result.Success -> {
val checkResult = reqResult.data.data
var failedType = 0
var failedType = ERROR_FAILED_UNKNOW
when (checkResult?.error) {
0 -> {
@ -390,17 +418,17 @@ class WithdrawManager private constructor() {
handleTransactionSuccess(recordNo)
}
3 -> {
failedType = FAIL_TYPE_UNKNOWN
failedType = ERROR_FAILED_UNKNOW
}
}
}
1 -> {
failedType = FAIL_TYPE_UNKNOWN
failedType = ERROR_FAILED_UNKNOW
}
2 -> {
failedType = FAIL_TYPE_APP_VERSION_LOW
3 -> {
failedType = ERROR_APP_VERSION_LOW
}
}
@ -451,17 +479,75 @@ class WithdrawManager private constructor() {
private fun sendWithdrawResultStatistic(cashNum: Double, isSuccess: Boolean, failType: Int) {
StatisticUtil.reportEvents(StatisticUtil.KEY_Withdrawal_Reason,
mapOf("Reason_Type" to (if (isSuccess) "Success" else "Fail"),
"Fail_Reason" to getFailHintStr(failType),
"Fail_Reason" to getFailHintStrRes(failType),
"Withdrawal_Position" to cashNum,
"Withdrawal_Day" to 1))
}
private fun getFailHintStr(failType: Int) : String {
var failReasonStr = ""
fun getFailHintStrRes(failType: Int) : Int {
var failTextRes = R.string.withdraw_normal_fail
when (failType) {
ERROR_NOT_REACH_CONDITION -> {
failTextRes = R.string.withdraw_fail_not_reach_condition
}
ERROR_ALREADY_WITHDRAWED -> {
failTextRes = R.string.withdraw_fail_already_withdraw
}
ERROR_FORBID -> {
failTextRes = R.string.withdraw_fail_forbidden
}
ERROR_WITHDRAWING -> {
failTextRes = R.string.withdraw_fail_withdrawing
}
ERROR_FAILED_UNKNOW -> {
failTextRes = R.string.withdraw_normal_fail
}
ERROR_APP_VERSION_LOW -> {
failTextRes = R.string.withdraw_fail_version_toolow
}
ERROR_PAYOUT_UNKNOW -> {
failTextRes = R.string.withdraw_normal_fail
}
ERROR_PAYOUT_APP_VERSION_LOW -> {
failTextRes = R.string.withdraw_fail_version_toolow
}
ERROR_PAYOUT_COUNTRY_RESTRICTION -> {
failTextRes = R.string.withdraw_fail_country_restriction
}
ERROR_PAYOUT_REACH_TOTAL_LIMIT -> {
failTextRes = R.string.withdraw_fail_reach_amount_limit
}
ERROR_PAYOUT_REACH_TIMES_LIMIT -> {
failTextRes = R.string.withdraw_fail_reach_times_limit
}
ERROR_PAYOUT_TODAY_NO_CHANCE -> {
failTextRes = R.string.withdraw_fail_today_no_chance
}
ERROR_PAYOUT_ACCOUNT_REACH_TIMES_LIMIT -> {
failTextRes = R.string.withdraw_account_times_limit
}
ERROR_PAYOUT_USER_IDENTITY_LIMIT -> {
failTextRes = R.string.withdraw_fail_user_identity_limit
}
ERROR_PAYOUT_MUST_WITHDRAW01_FIRST -> {
failTextRes = R.string.withdraw_fail_must_withdraw_01_first
}
}
return failReasonStr
return failTextRes
}
private fun notifyWithdrawCheckResult(recordNo: String) {
@ -484,15 +570,6 @@ class WithdrawManager private constructor() {
return dataBean
}
fun getFailShowTextRes(failReason: Int): Int {
var failTextRes = R.string.withdraw_normal_fail
when (failReason) {
FAIL_TYPE_APP_VERSION_LOW -> {
failTextRes = R.string.withdraw_fail_version_toolow
}
}
return failTextRes
}
private fun getStartedItemRestCashNum(itemIndex: Int): Double {
if (itemIndex in 0..mItemList.size-1) {

View File

@ -219,6 +219,17 @@
<string name="claim_reward_onging">This purchase reward claim is ongoing.</string>
<string name="has_claimed_reward">You have claimed this reward.</string>
<string name="game_center">Game Center</string>
<string name="withdraw_fail_not_reach_condition">Not reach withdraw condition</string>
<string name="withdraw_fail_already_withdraw">You\'ve already withdrawed</string>
<string name="withdraw_fail_forbidden">Withdraw_forbidden</string>
<string name="withdraw_fail_withdrawing">Withdrawing</string>
<string name="withdraw_fail_country_restriction">Country restriction</string>
<string name="withdraw_fail_reach_amount_limit">Reach amount limit</string>
<string name="withdraw_fail_reach_times_limit">Reach times limit</string>
<string name="withdraw_fail_today_no_chance">Today chance is run out</string>
<string name="withdraw_account_times_limit">Your account is reach times limit</string>
<string name="withdraw_fail_user_identity_limit">Your account is not valid</string>
<string name="withdraw_fail_must_withdraw_01_first">You have to withdraw 0.1 firstly</string>
</resources>