From 5328593f0ab547831a070981865d9e9c6c6936bf Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 6 Nov 2024 21:15:59 +0800 Subject: [PATCH] 1 --- yibao_pay/api.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/yibao_pay/api.go b/yibao_pay/api.go index 69d1c4d..f9598c8 100644 --- a/yibao_pay/api.go +++ b/yibao_pay/api.go @@ -1,6 +1,7 @@ package yibao_pay import ( + "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/db/offical" zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils" "encoding/json" "errors" @@ -13,6 +14,7 @@ import ( "net/url" "os" "strings" + "xorm.io/xorm" ) func GetSend(method, appId, isvPriKey string, param map[string]string) (*response.YopResponse, error) { @@ -78,3 +80,18 @@ func GetYibao(bodyStr string) (*YibaoJoinCallback, error) { } return &args, nil } +func CommKey(eg *xorm.Engine, Prd bool) map[string]string { + appId := offical.SysCfgByKeyStr(eg, "yibao_appid") + isvPriKey := offical.SysCfgByKeyStr(eg, "yibao_key") + parentMerchantNo := offical.SysCfgByKeyStr(eg, "yibao_merchant_no") + if Prd == false { + appId = offical.SysCfgByKeyStr(eg, "yibao_appid_test") + isvPriKey = offical.SysCfgByKeyStr(eg, "yibao_key_test") + } + res := map[string]string{ + "appId": appId, + "isvPriKey": isvPriKey, + "parentMerchantNo": parentMerchantNo, + } + return res +}