Browse Source

no message

master
weigang 5 years ago
parent
commit
e60cb38876
  1. 20
      app/Constants/v3/ErrorCode.php
  2. 13
      app/Service/v3/Implementations/PaymentService.php

20
app/Constants/v3/ErrorCode.php

@ -98,6 +98,26 @@ class ErrorCode extends AbstractConstants
*/
const PAYMENT_FAIL = 651;
/**
* @Message("今日付款次数已达上限")
*/
const PAYMENT_SEND_NUM_LIMIT = 652;
/**
* @Message("微信未实名认证")
*/
const PAYMENT_V2_ACCOUNT_SIMPLE_BAN = 653;
/**
* @Message("姓名校验出错")
*/
const PAYMENT_NAME_MISMATCH = 654;
/**
* @Message("金额超限了")
*/
const PAYMENT_AMOUNT_LIMIT = 655;
/************************************/
/* 用户相关 701-750 */
/************************************/

13
app/Service/v3/Implementations/PaymentService.php

@ -207,7 +207,18 @@ class PaymentService implements PaymentServiceInterface
if (in_array($result['error_code'], $arr)) {
$msg = $result['error_code_des'];
}
throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL, $msg);
if ($result['error_code'] == 'SENDNUM_LIMIT') {
throw new ErrorCodeException(ErrorCode::PAYMENT_SEND_NUM_LIMIT);
} elseif ($result['error_code'] == 'V2_ACCOUNT_SIMPLE_BAN') {
throw new ErrorCodeException(ErrorCode::PAYMENT_V2_ACCOUNT_SIMPLE_BAN);
} elseif ($result['error_code'] == 'NAME_MISMATCH') {
throw new ErrorCodeException(ErrorCode::PAYMENT_NAME_MISMATCH);
} elseif ($result['error_code'] == 'AMOUNT_LIMIT') {
throw new ErrorCodeException(ErrorCode::PAYMENT_AMOUNT_LIMIT);
}
throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL);
}
return true;

Loading…
Cancel
Save