Ver código fonte

update

add_mode
DengBiao 1 ano atrás
pai
commit
380eb13816
3 arquivos alterados com 44 adições e 2 exclusões
  1. +41
    -0
      app/admin/hdl/hdl_demo.go
  2. +2
    -2
      app/customer/hdl/hdl_pay.go
  3. +1
    -0
      app/customer/md/md_curl_smart_pay.go

+ 41
- 0
app/admin/hdl/hdl_demo.go Ver arquivo

@@ -1,8 +1,12 @@
package hdl

import (
"applet/app/customer/md"
"applet/app/customer/svc"
"applet/app/db"
"applet/app/db/model"
"applet/app/e"
"applet/app/enum"
"fmt"
"github.com/gin-gonic/gin"
"time"
@@ -10,6 +14,43 @@ import (

// Demo 测试
func Demo(c *gin.Context) {
var m []model.CentralKitchenForSchoolPackageOrd
sess := db.Db.Desc("id").Where("state =1")
sess.Find(&m)
sysCfgDb := db.SysCfgDb{}
sysCfgDb.Set()
sysCfg := sysCfgDb.SysCfgFindWithDb(enum.JsapiPayAppAutToken, enum.OpenAlipayAppid, enum.OpenAlipayAppPrivateKey, enum.OpenAlipayPublicKey)

centralKitchenForSchoolPackageOrd := db.CentralKitchenForSchoolPackageOrd{}
for _, v := range m {
err2, result := svc.CurlAlipayTradeQuery(md.CurlAlipayTradeQueryReq{
Config: struct {
PayAliAppId string `json:"pay_ali_app_id" label:"支付宝开放平台-第三方应用-appid"`
PayAliPrivateKey string `json:"pay_ali_private_key" label:"支付宝开放平台-第三方应用-接口加签-应用私钥"`
PayAliPublicKey string `json:"pay_ali_public_key" label:"支付宝开放平台-第三方应用-接口加签-支付宝公钥"`
}{
PayAliAppId: sysCfg[enum.OpenAlipayAppid],
PayAliPrivateKey: sysCfg[enum.OpenAlipayAppPrivateKey],
PayAliPublicKey: sysCfg[enum.OpenAlipayPublicKey],
},
OutTradeNo: v.OutTradeNo,
AppAuthToken: sysCfg[enum.JsapiPayAppAutToken],
})
if err2 != nil {
e.OutErr(c, e.ERR, err2.Error())
return
}
centralKitchenForSchoolPackageOrd.Set(v.OutTradeNo)
v.CreateAt = result.Date
update, err := centralKitchenForSchoolPackageOrd.CentralKitchenForSchoolPackageOrdUpdate(&v, "create_at")
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
}

fmt.Println(">>>>>>>>>>>>", v.OutTradeNo, update)
}
return
qrcodeWithBatchRecordsDb := db.AdminDb{}
qrcodeWithBatchRecordsDb.Set()
data, _, err := qrcodeWithBatchRecordsDb.GetAdminRolePermission(1001)


+ 2
- 2
app/customer/hdl/hdl_pay.go Ver arquivo

@@ -56,8 +56,8 @@ func BuyPackageForWx(c *gin.Context) {
}
e.OutSuc(c, map[string]interface{}{
"out_trade_no": outTradeNo,
"prams": resp,
"total": total,
"prams": total,
"total": resp,
}, nil)
return
}


+ 1
- 0
app/customer/md/md_curl_smart_pay.go Ver arquivo

@@ -48,6 +48,7 @@ type CurlAlipayTradeQueryReq struct {

type CurlAlipayTradeQueryResp struct {
Code string `json:"code" label:"响应码"`
Date string `json:"date" label:"下单时间"`
Msg string `json:"msg" label:"响应消息"`
OutTradeNo string `json:"out_trade_no" label:"商户订单号"`
TradeNo string `json:"trade_no" label:"支付宝交易号"`


Carregando…
Cancelar
Salvar