feat: UFO H5 服务号 OAuth 登录与同商户公众号 JSAPI 支付
This commit is contained in:
@@ -288,7 +288,7 @@ class ZhuanpanGoumai(APIView):
|
||||
ZhuanpanJihui.query.filter(czjilu_dingdan_id=dingdanid).delete()
|
||||
return Response({
|
||||
'code': 400,
|
||||
'message': '当前小程序未绑定微信openid,请重新登录',
|
||||
'message': '当前端未绑定微信openid,请重新登录',
|
||||
}, status=400)
|
||||
pay_params = self._wechat_pay_params(request, dingdanid, jine, pay_openid, club_id)
|
||||
|
||||
@@ -307,23 +307,27 @@ class ZhuanpanGoumai(APIView):
|
||||
from jituan.services.wechat_pay import get_wechat_v2_config
|
||||
from jituan.constants import FUBEI_BIZ_CZJILU
|
||||
from jituan.services.mini_pay_router import maybe_create_fubei_jsapi_params
|
||||
from jituan.services.club_user import get_pay_app_source
|
||||
|
||||
PAY_DESCRIPTION = getattr(settings, 'ZHUANPAN_PAY_DESCRIPTION', '转盘购票')
|
||||
NOTIFY_URL = getattr(settings, 'ZHUANPAN_PAY_NOTIFY_URL', '')
|
||||
app_source = get_pay_app_source(request)
|
||||
|
||||
fb_params = maybe_create_fubei_jsapi_params(
|
||||
club_id=club_id,
|
||||
out_trade_no=dingdanid,
|
||||
amount_yuan=jine,
|
||||
body=PAY_DESCRIPTION,
|
||||
openid=openid,
|
||||
notify_url=NOTIFY_URL,
|
||||
biz_type=FUBEI_BIZ_CZJILU,
|
||||
)
|
||||
fb_params = None
|
||||
if app_source not in ('official', 'h5', 'oa'):
|
||||
fb_params = maybe_create_fubei_jsapi_params(
|
||||
club_id=club_id,
|
||||
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
|
||||
|
||||
pay_cfg = get_wechat_v2_config(club_id)
|
||||
pay_cfg = get_wechat_v2_config(club_id, app_source=app_source)
|
||||
APPID = pay_cfg['appid']
|
||||
MCHID = pay_cfg['mch_id']
|
||||
KEY = pay_cfg['key']
|
||||
|
||||
Reference in New Issue
Block a user