Files
Pine f1147dced3 feat(pay): 微信支付V3子应用与算力充值
- app/pay 独立支付子应用(config/wxpay/models/repository/service/routers),便于后期拆分微服务
- 充值订单表 0026_compute_recharge;套餐支持折扣(discount)与上架开关(enabled),DB system_configs 优先、env 兜底
- 统一小程序支付:桌面端出小程序码→扫码进小程序确认页按 openid 发起 JSAPI→回调幂等到账(引擎 adjust_user_quota+镜像回写)
- 内嵌 wechatpayv3(含 async_),响应验签失败降级告警;新增 aiofiles 依赖

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-30 22:29:44 +08:00

89 lines
3.7 KiB
Python

# -*- coding: utf-8 -*-
from .type import RequestType
def goldplan_plan_change(self, sub_mchid, operation_type):
"""点金计划管理
:param sub_mchid: 子商户的商户号,由微信支付生成并下发。示例值:'1900000109'
:param operation_type: 操作类型, 枚举值:'OPEN':表示开通点金计划,'CLOSE':表示关闭点金计划。示例值:'OPEN'
"""
params = {}
if sub_mchid:
params.update({'sub_mchid': sub_mchid})
else:
raise Exception('sub_mchid is not assigned.')
if operation_type:
params.update({'operation_type': operation_type})
else:
raise Exception('operation_type is not assigned.')
path = '/v3/goldplan/merchants/changegoldplanstatus'
return self._core.request(path, method=RequestType.POST, data=params)
def goldplan_custompage_change(self, sub_mchid, operation_type):
"""商家小票管理
:param sub_mchid: 子商户的商户号,由微信支付生成并下发。示例值:'1900000109'
:param operation_type: 操作类型, 枚举值:'OPEN':表示开通商家自定义小票,'CLOSE':表示关闭商家自定义小票。示例值:'OPEN'
"""
params = {}
if sub_mchid:
params.update({'sub_mchid': sub_mchid})
else:
raise Exception('sub_mchid is not assigned.')
if operation_type:
params.update({'operation_type': operation_type})
else:
raise Exception('operation_type is not assigned.')
path = '/v3/goldplan/merchants/changecustompagestatus'
return self._core.request(path, method=RequestType.POST, data=params)
def goldplan_advertising_filter(self, sub_mchid, advertising_industry_filters):
"""同业过滤标签管理
:param sub_mchid: 子商户的商户号,由微信支付生成并下发。示例值:'1900000109'
:param advertising_industry_filters: 同业过滤标签值, 同业过滤标签最少传一个,最多三个。示例值:['SOFTWARE','SECURITY','LOVE_MARRIAGE']
"""
params = {}
if sub_mchid:
params.update({'sub_mchid': sub_mchid})
else:
raise Exception('sub_mchid is not assigned.')
if advertising_industry_filters:
params.update({'advertising_industry_filters': advertising_industry_filters})
else:
raise Exception('advertising_industry_filters is not assigned.')
path = '/v3/goldplan/merchants/set-advertising-industry-filter'
return self._core.request(path, method=RequestType.POST, data=params)
def goldplan_advertising_open(self, sub_mchid, advertising_industry_filters=None):
"""开通广告展示
:param sub_mchid: 子商户的商户号,由微信支付生成并下发。示例值:'1900000109'
:param advertising_industry_filters: 同业过滤标签值, 同业过滤标签最少传一个,最多三个。示例值:['SOFTWARE','SECURITY','LOVE_MARRIAGE']
"""
params = {}
if sub_mchid:
params.update({'sub_mchid': sub_mchid})
else:
raise Exception('sub_mchid is not assigned.')
if advertising_industry_filters:
params.update({'advertising_industry_filters': advertising_industry_filters})
else:
raise Exception('advertising_industry_filters is not assigned.')
path = '/v3/goldplan/merchants/open-advertising-show'
return self._core.request(path, method=RequestType.PATCH, data=params)
def goldplan_advertising_close(self, sub_mchid):
"""关闭广告展示
:param sub_mchid: 子商户的商户号,由微信支付生成并下发。示例值:'1900000109'
"""
params = {}
if sub_mchid:
params.update({'sub_mchid': sub_mchid})
else:
raise Exception('sub_mchid is not assigned.')
path = '/v3/goldplan/merchants/close-advertising-show'
return self._core.request(path, method=RequestType.POST, data=params)