From 33cb7cd1bee88e6b4047eb923bbbada602da900c Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Wed, 21 Feb 2024 11:20:40 +0800 Subject: [PATCH] update --- app/customer/hdl/hdl_demo.go | 24 +++++++++++++++++++++++- app/customer/svc/svc_curl_smart_pay.go | 8 ++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/app/customer/hdl/hdl_demo.go b/app/customer/hdl/hdl_demo.go index 09d3e70..a2036b9 100644 --- a/app/customer/hdl/hdl_demo.go +++ b/app/customer/hdl/hdl_demo.go @@ -152,7 +152,29 @@ func Demo(c *gin.Context) { sysCfgDb := db.SysCfgDb{} sysCfgDb.Set() sysCfg := sysCfgDb.SysCfgFindWithDb(enum.OpenAppletAppid, enum.OpenAppletAppPrivateKey, enum.OpenAppletPublicKey) - err, info := svc.CurlEducateSceneTokenQueryV2(md.CurlEducateSceneTokenReq{ + + err, info := svc.CurlEducateFacepayApply(md.CurlEducateFacepayApplyReq{ + Config: struct { + AliAppId string `json:"ali_app_id" label:"支付宝开放平台-小程序-appid"` + AliPrivateKey string `json:"ali_private_key" label:"支付宝开放平台-小程序-应用私钥"` + AliPublicKey string `json:"ali_public_key" label:"支付宝开放平台-小程序-支付宝公钥"` + }{ + AliAppId: sysCfg[enum.OpenAppletAppid], + AliPrivateKey: sysCfg[enum.OpenAppletAppPrivateKey], + AliPublicKey: sysCfg[enum.OpenAppletPublicKey], + }, + FaceUid: "2088930289907324", + FaceOpenId: "", + SchoolStdCode: "3144003844", + }) + if err != nil { + e.OutErr(c, e.ERR, err.Error()) + return + } + e.OutSuc(c, info, nil) + return + + err, info = svc.CurlEducateSceneTokenQueryV2(md.CurlEducateSceneTokenReq{ Config: struct { AliAppId string `json:"ali_app_id" label:"支付宝开放平台-小程序-appid"` AliPrivateKey string `json:"ali_private_key" label:"支付宝开放平台-小程序-应用私钥"` diff --git a/app/customer/svc/svc_curl_smart_pay.go b/app/customer/svc/svc_curl_smart_pay.go index 4c182f6..8c6be1a 100644 --- a/app/customer/svc/svc_curl_smart_pay.go +++ b/app/customer/svc/svc_curl_smart_pay.go @@ -680,9 +680,6 @@ func CurlEducateSceneTokenCreateForConcentratedCollectApplet(args md.CurlEducate } func CurlEducateFacepayApply(args md.CurlEducateFacepayApplyReq) (err error, resp interface{}) { - utils.FilePutContents("CurlEducateFacepayApply", utils.SerializeStr(map[string]interface{}{ - "args": args, - })) //1、TODO::alipay.commerce.educate.facepay.apply(人脸开通支付申请) url := cfg.SmartCanteenPay + "/alipay/faceScanPay/educateFacepayApply" @@ -704,11 +701,14 @@ func CurlEducateFacepayApply(args md.CurlEducateFacepayApplyReq) (err error, res Msg string `json:"msg"` Data interface{} `json:"data"` } - utils.FilePutContents("CurlEducateFacepayApply", utils.SerializeStr(result)) err = json.Unmarshal(bytes, &result) if err != nil { return } + utils.FilePutContents("CurlEducateFacepayApply", utils.SerializeStr(map[string]interface{}{ + "args": args, + "result": result, + })) if result.Code != 0 { if result.Msg != "" { err = errors.New(result.Msg)