feat: 分俱乐部付呗收款通道,默认仍走微信直连
小程序前端仍传 wechat;后台可切换 wechat/fubei,支持配置多套付呗并退款按原通道路由。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -232,6 +232,21 @@ class ShangjiaChongzhi(APIView):
|
||||
else:
|
||||
raise Exception('未知的支付类型')
|
||||
|
||||
from jituan.constants import FUBEI_BIZ_CZJILU
|
||||
from jituan.services.mini_pay_router import maybe_create_fubei_jsapi_params
|
||||
_club = resolve_club_id_for_write(self.request, self.request.user)
|
||||
fb_params = maybe_create_fubei_jsapi_params(
|
||||
club_id=_club,
|
||||
out_trade_no=dingdanid,
|
||||
amount_yuan=jine,
|
||||
body=PAY_DESCRIPTION,
|
||||
openid=openid,
|
||||
notify_url=NOTIFY_URL,
|
||||
biz_type=FUBEI_BIZ_CZJILU,
|
||||
)
|
||||
if fb_params is not None:
|
||||
return fb_params
|
||||
|
||||
# 生成随机字符串
|
||||
nonce_str = ''.join(random.choices(string.ascii_letters + string.digits, k=32))
|
||||
|
||||
|
||||
@@ -270,6 +270,20 @@ class HuiyuanGoumai(APIView):
|
||||
else:
|
||||
raise Exception('未知的支付类型')
|
||||
|
||||
from jituan.constants import FUBEI_BIZ_CZJILU
|
||||
from jituan.services.mini_pay_router import maybe_create_fubei_jsapi_params
|
||||
fb_params = maybe_create_fubei_jsapi_params(
|
||||
club_id=pay_club,
|
||||
out_trade_no=dingdanid,
|
||||
amount_yuan=jine,
|
||||
body=PAY_DESCRIPTION,
|
||||
openid=openid,
|
||||
notify_url=NOTIFY_URL,
|
||||
biz_type=FUBEI_BIZ_CZJILU,
|
||||
)
|
||||
if fb_params is not None:
|
||||
return fb_params
|
||||
|
||||
# 生成随机字符串
|
||||
nonce_str = ''.join(random.choices(string.ascii_letters + string.digits, k=32))
|
||||
|
||||
|
||||
@@ -213,6 +213,21 @@ class JifenBuchong(APIView):
|
||||
else:
|
||||
raise Exception('未知的支付类型')
|
||||
|
||||
from jituan.constants import FUBEI_BIZ_CZJILU
|
||||
from jituan.services.mini_pay_router import maybe_create_fubei_jsapi_params
|
||||
_club = resolve_club_id_for_write(self.request, self.request.user)
|
||||
fb_params = maybe_create_fubei_jsapi_params(
|
||||
club_id=_club,
|
||||
out_trade_no=dingdanid,
|
||||
amount_yuan=jine,
|
||||
body=PAY_DESCRIPTION,
|
||||
openid=openid,
|
||||
notify_url=NOTIFY_URL,
|
||||
biz_type=FUBEI_BIZ_CZJILU,
|
||||
)
|
||||
if fb_params is not None:
|
||||
return fb_params
|
||||
|
||||
# 生成随机字符串
|
||||
nonce_str = ''.join(random.choices(string.ascii_letters + string.digits, k=32))
|
||||
|
||||
|
||||
@@ -227,6 +227,21 @@ class YajinGoumai(APIView):
|
||||
else:
|
||||
raise Exception('未知的支付类型')
|
||||
|
||||
from jituan.constants import FUBEI_BIZ_CZJILU
|
||||
from jituan.services.mini_pay_router import maybe_create_fubei_jsapi_params
|
||||
_club = resolve_club_id_for_write(self.request, self.request.user)
|
||||
fb_params = maybe_create_fubei_jsapi_params(
|
||||
club_id=_club,
|
||||
out_trade_no=dingdanid,
|
||||
amount_yuan=jine,
|
||||
body=PAY_DESCRIPTION,
|
||||
openid=openid,
|
||||
notify_url=NOTIFY_URL,
|
||||
biz_type=FUBEI_BIZ_CZJILU,
|
||||
)
|
||||
if fb_params is not None:
|
||||
return fb_params
|
||||
|
||||
# 生成随机字符串
|
||||
nonce_str = ''.join(random.choices(string.ascii_letters + string.digits, k=32))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user