优化一下自动提现接口就是user/tixian_shenhe_servers.py,tixian_shenhe_views.py,让文件以及对应的申请,回调,确认接口,让它更好用一点,允许用户多次提现审核,强化收款接口,及时更新数据库中的收款状态,其次,更新了客服提现审核接口,关于大于200元的提现,同意之后直接按驳回处理,微信官方不支持大于200元的提现申请去掉了订单24小时或48小时自动结算的定时任务,将订单广播通知的任务,名称改成和新代码一样
This commit is contained in:
@@ -25,17 +25,21 @@ from utils.wechat_v3 import build_authorization
|
||||
from .models import TixianAutoRecord
|
||||
from .tixian_shenhe_services import (
|
||||
RECONCILE_ALLOW_NEW,
|
||||
RECONCILE_AUDIT_CLOSED,
|
||||
RECONCILE_COMPLETED,
|
||||
RECONCILE_PENDING,
|
||||
RECONCILE_WAIT_CONFIRM,
|
||||
check_collect_quota_limits,
|
||||
create_audit_application,
|
||||
close_audit_over_limit_refund,
|
||||
close_audit_wechat_failed,
|
||||
get_audit_for_collect,
|
||||
handle_post_transfer_failure,
|
||||
reconcile_shenhe_wechat_bills,
|
||||
release_collect_quota_for_record,
|
||||
reserve_collect_quota_limits,
|
||||
resolve_collect_context,
|
||||
validate_collect_amount,
|
||||
validate_collect_eligibility,
|
||||
)
|
||||
|
||||
@@ -217,7 +221,16 @@ def process_audit_collect(request):
|
||||
tixianjilu_id_val = ctx['jilu'].id if ctx.get('jilu') else audit.tixianjilu_id
|
||||
leixing = audit.leixing
|
||||
|
||||
# 二次资格校验:不通过仅返回错误,审核单保持待收款(6),不退款,用户补齐资质后可再点收款
|
||||
amount_ok, amount_msg = validate_collect_amount(audit)
|
||||
if not amount_ok:
|
||||
with transaction.atomic():
|
||||
close_audit_over_limit_refund(audit, None, amount_msg)
|
||||
return Response({
|
||||
'code': 400,
|
||||
'msg': f'{amount_msg},可到账金额已退回余额(手续费不退),请重新申请',
|
||||
})
|
||||
|
||||
# 收款前严格资格校验:不通过仅返回错误,审核单保持待收款(6),不退款
|
||||
collect_ok, collect_msg = validate_collect_eligibility(user_main, leixing)
|
||||
if not collect_ok:
|
||||
logger.warning(
|
||||
@@ -241,6 +254,11 @@ def process_audit_collect(request):
|
||||
action, payload = reconcile_shenhe_wechat_bills(shenhe_danhao)
|
||||
if action == RECONCILE_COMPLETED:
|
||||
return Response({'code': 8, 'msg': payload.get('msg', '该提现已完成,请勿重复操作')})
|
||||
if action == RECONCILE_AUDIT_CLOSED:
|
||||
return Response({
|
||||
'code': 400,
|
||||
'msg': payload.get('msg', '该笔提现已关闭,请重新申请'),
|
||||
})
|
||||
if action == RECONCILE_WAIT_CONFIRM:
|
||||
quota_resp = _verify_collect_quota_or_response(user_main, audit, shenhe_danhao)
|
||||
if quota_resp:
|
||||
@@ -344,6 +362,11 @@ def process_audit_collect(request):
|
||||
return _build_collect_success_response(post_payload)
|
||||
if post_action == RECONCILE_COMPLETED:
|
||||
return Response({'code': 8, 'msg': '该提现已完成,请勿重复操作'})
|
||||
if post_action == RECONCILE_AUDIT_CLOSED:
|
||||
return Response({
|
||||
'code': 400,
|
||||
'msg': post_payload.get('msg', '该笔提现已关闭,请重新申请'),
|
||||
})
|
||||
if post_action == RECONCILE_PENDING:
|
||||
pending_msg = (
|
||||
post_payload.get('msg', post_payload)
|
||||
|
||||
Reference in New Issue
Block a user