From ba6d14ccc5c8675daeaf7c71731dbe588510bbbd Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Fri, 3 May 2024 02:26:48 +0800 Subject: [PATCH 1/2] wechat --- app/mix/conf/cfg.go | 1 + app/mix/service/service.go | 2 +- etc/mix/mix-prod.yaml | 9 ++++++ etc/mix/wxpaycert_tfz/apiclient_cert.p12 | Bin 0 -> 2774 bytes etc/mix/wxpaycert_tfz/apiclient_cert.pem | 25 +++++++++++++++++ etc/mix/wxpaycert_tfz/apiclient_key.pem | 28 +++++++++++++++++++ library/payclients/wxpaycli/client.go | 31 +++++++++++++++++---- library/payclients/wxpaycli/client_test.go | 2 +- 8 files changed, 91 insertions(+), 7 deletions(-) create mode 100644 etc/mix/wxpaycert_tfz/apiclient_cert.p12 create mode 100644 etc/mix/wxpaycert_tfz/apiclient_cert.pem create mode 100644 etc/mix/wxpaycert_tfz/apiclient_key.pem diff --git a/app/mix/conf/cfg.go b/app/mix/conf/cfg.go index 9a97c729..eb67cccd 100644 --- a/app/mix/conf/cfg.go +++ b/app/mix/conf/cfg.go @@ -8,6 +8,7 @@ type ConfigSt struct { MixMysql *configcenter.MysqlConfig `json:"mix_mysql" yaml:"mix_mysql"` // mix mysql Crypto *configcenter.CryptoConfig `json:"crypto" yaml:"crypto"` // 账号相关加密 Wxpay *configcenter.WxpayClientConfig `json:"wxpay" yaml:"wxpay"` // 微信支付 + WxpayTFZ *configcenter.WxpayClientConfig `json:"wxpay_tfz" yaml:"wxpay_tfz"` // 微信支付 Alipay *configcenter.AlipayClientConfig `json:"alipay" yaml:"alipay"` // 支付宝 心意到了 AlipayMYTS *configcenter.AlipayClientConfig `json:"alipay_myts" yaml:"alipay_myts"` // 支付宝 觅缘天使 Apollo *configcenter.ApolloConfig `json:"apollo" yaml:"apollo"` // Apollo diff --git a/app/mix/service/service.go b/app/mix/service/service.go index 5d057837..0bc8a8d8 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -159,7 +159,7 @@ func (s *Service) Init(c any) (err error) { return } - err = wxpaycli.Init(cfg.Wxpay) + err = wxpaycli.InitMulti(cfg.Wxpay, cfg.WxpayTFZ) if err != nil { logger.Error("wxpaycli.Init fail, cfg: %v, err: %v", util.ToJson(cfg.Wxpay), err) return diff --git a/etc/mix/mix-prod.yaml b/etc/mix/mix-prod.yaml index 5274965b..fd8403be 100644 --- a/etc/mix/mix-prod.yaml +++ b/etc/mix/mix-prod.yaml @@ -63,6 +63,15 @@ wxpay: notify_url: "https://api.tiefen.fun/ext/vas/wxpay_callback" app_secret: "ebc325109b91087e22f046bc8ac5c940" +wxpay_tfz: + mchid: "1665016206" + appid: "" + serial_no: "176903F43E78B0BA5AA1F08A3BE852A5F637DC77" + apiv3_key: "5QwY1XMK1HW3JQwGKbA3mfJ5cdsTQGjR" + private_key_path: "/app/wishpal-ironfan/etc/mix/wxpaycert_tfz/apiclient_key.pem" + notify_url: "https://api.tiefen.fun/ext/vas/wxpay_callback" + app_secret: "mot5410nh69k87e22f046bc8anv5xds8" + apollo: app_id: "wishpal_live_service" cluster: "dev" diff --git a/etc/mix/wxpaycert_tfz/apiclient_cert.p12 b/etc/mix/wxpaycert_tfz/apiclient_cert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..c786c5110dbf958fff272e6c285f220a9c79aa73 GIT binary patch literal 2774 zcmY+^byO3M76gPg$EPqP+eopt{zwWD9k9KLpaS058$J^0SycM|mC^ z!UDEzWJ(>3b=Y;c$$O9j()Ql0Y(p)db{8<3Yw)uYJ75P7m4X61UXsUCn45QO0b`{; z(msCZ*ie;sC06vTygp)~j~4@Xh%s+jMkjc1qHIN12Oi&>Fj7lW|JX%5iVWA|B?{W$ zezXzkOB-=eg;n?iGhcO<)Ew?cT6j=^qNz6g`nk!&iQy5Oz0iGGjGi94kw`iGgFXt( z*)?M)c}@QX+aKk1U`t{1ST1~xmZM+{r}!-LEnRc(94}JC-0~Ik{l;+gQN@=dftD!43qKa!5~S>BZYeB6E6ilsLMN1 zP0slhs=q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/apiclient_cert.pem new file mode 100644 index 00000000..a773b4e6 --- /dev/null +++ b/etc/mix/wxpaycert_tfz/apiclient_cert.pem @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIEKDCCAxCgAwIBAgIUF2kD9D54sLpaofCKO+hSpfY33HcwDQYJKoZIhvcNAQEL +BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT +FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg +Q0EwHhcNMjQwNTAyMTc1NzA2WhcNMjkwNTAxMTc1NzA2WjCBgTETMBEGA1UEAwwK +MTY3NTgxMzcyMTEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMS0wKwYDVQQL +DCTmiJDpg73lv4PmhI/liLDkuobnp5HmioDmnInpmZDlhazlj7gxCzAJBgNVBAYT +AkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAOaDpU37roG4zQOok/00vHtgPQdVEy/SgxqdakEEygVFXTiCh/PSmynV +wtAiULYkDor+KdPMAqmTO/wVxlkxVWhh0tq3Wr49MWqmSGAdS749H0CKv/TxrL+y +Bmw5OuKolGV7xYne9wJC28M0wJOJH4XFwUSJnQqOec956KdwnSWuZ/X8uI0d8Cs1 +It/HRX4tJunEDaPFLCnF4ju6wrr+kAjlZb35laDX7zmDg25/yhpxpmgeAeJgSH7K +EJSCYlUWOpspMb4porEG5NIUxu1TfLXO4kkx3j7Diz8szdzZrTGdLcc4FjKNTdIL +jaJxmH8eyYC2Zu2jyuF5F3vSTtACszsCAwEAAaOBuTCBtjAJBgNVHRMEAjAAMAsG +A1UdDwQEAwID+DCBmwYDVR0fBIGTMIGQMIGNoIGKoIGHhoGEaHR0cDovL2V2Y2Eu +aXRydXMuY29tLmNuL3B1YmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRC +MDZBRDM5NzU0OTg0NkMwMUMzRThFQkQyJnNnPUhBQ0M0NzFCNjU0MjJFMTJCMjdB +OUQzM0E4N0FEMUNERjU5MjZFMTQwMzcxMA0GCSqGSIb3DQEBCwUAA4IBAQB8Ze+8 +G5dKUUuAaGlwBQNxwf1YPeZ7LU3lh0OKc+09cQ3yNDJXdYKdgrCI0L2dkZMnk0xo +/gf0lxFfXiRfR5jYCYr3MRU7ooayqXEPpvwoRmTboiE9hVrpPifGeETsKJwQkvE3 +W1kpBYckkNtUBucL6c7W66q7kFtz+8wVP7gPgJ7UFjk8x3r4Zao+A3opPRTBVgls +fxmmCu1Ud3Pf/zHKd1FCBDZepJ2ObOIUYW/0Wc+p2VbqansG1DirQ5jkmaf33mEN +51kDz5Hw07XGz04ZVPAWkpLtjAQFF4bSVfYxTYvhOllTidZXtt2IJNGT/MQyKp98 +ufapZz95Zc/bxQ7U +-----END CERTIFICATE----- diff --git a/etc/mix/wxpaycert_tfz/apiclient_key.pem b/etc/mix/wxpaycert_tfz/apiclient_key.pem new file mode 100644 index 00000000..757be54b --- /dev/null +++ b/etc/mix/wxpaycert_tfz/apiclient_key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDmg6VN+66BuM0D +qJP9NLx7YD0HVRMv0oManWpBBMoFRV04gofz0psp1cLQIlC2JA6K/inTzAKpkzv8 +FcZZMVVoYdLat1q+PTFqpkhgHUu+PR9Air/08ay/sgZsOTriqJRle8WJ3vcCQtvD +NMCTiR+FxcFEiZ0KjnnPeeincJ0lrmf1/LiNHfArNSLfx0V+LSbpxA2jxSwpxeI7 +usK6/pAI5WW9+ZWg1+85g4Nuf8oacaZoHgHiYEh+yhCUgmJVFjqbKTG+KaKxBuTS +FMbtU3y1zuJJMd4+w4s/LM3c2a0xnS3HOBYyjU3SC42icZh/HsmAtmbto8rheRd7 +0k7QArM7AgMBAAECggEAY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EybdjPnxeJn/RN +c3wG97sGG87A6Xo2i42koX1w87LT/f9qJrR/sU6kHw/39E/vx2xkMIs6u7I9lO+d +WsBYbtcp4ZDAI1+NwcDtkd6Q1Kbpti2MxkuC6r+1kteE80DEB4lryJ6r4HAry3k8 +uCJCasc77UvJcfVnZX5QkA== +-----END PRIVATE KEY----- diff --git a/library/payclients/wxpaycli/client.go b/library/payclients/wxpaycli/client.go index 5608b49e..a6d353a2 100644 --- a/library/payclients/wxpaycli/client.go +++ b/library/payclients/wxpaycli/client.go @@ -30,7 +30,16 @@ const ( DefaultOrderTimeoutSeconds = 900 // 默认订单超时时间,单位: s ) -var defaultWxpayClient *WxpayClient +const ( + AppIdXinYiDaoLe = "wxc28fd8aaf31984b6" + AppIdTieFenZone = "" +) + +var allWxpayClients = map[string]*WxpayClient{} + +func GetDefaultWxpayClient() *WxpayClient { + return allWxpayClients[AppIdXinYiDaoLe] +} type WxpayClient struct { clientV3 *wxpayv3.ClientV3 @@ -40,11 +49,23 @@ type WxpayClient struct { PrivateKeyPath string `json:"private_key_path"` } -func GetDefaultWxpayClient() *WxpayClient { - return defaultWxpayClient +func InitMulti(cfgList ...*configcenter.WxpayClientConfig) (err error) { + for _, cfg := range cfgList { + var cli *WxpayClient + cli, err = NewWxpayClient(cfg) + if err != nil { + return + } + if cli == nil { + err = errors.New("NewAlipayClient fail") + return + } + allWxpayClients[cli.AppId] = cli + } + return } -func Init(cfg *configcenter.WxpayClientConfig) (err error) { +func NewWxpayClient(cfg *configcenter.WxpayClientConfig) (ret *WxpayClient, err error) { // private key bs, err := os.ReadFile(cfg.PrivateKeyPath) if err != nil { @@ -59,7 +80,7 @@ func Init(cfg *configcenter.WxpayClientConfig) (err error) { return } - defaultWxpayClient = &WxpayClient{ + ret = &WxpayClient{ clientV3: wxpayCliV3, AppSecret: cfg.AppSecret, AppId: cfg.AppId, diff --git a/library/payclients/wxpaycli/client_test.go b/library/payclients/wxpaycli/client_test.go index cb750834..f0a9ef99 100644 --- a/library/payclients/wxpaycli/client_test.go +++ b/library/payclients/wxpaycli/client_test.go @@ -20,7 +20,7 @@ func TestMain(m *testing.M) { fmt.Printf("%v\n", err) } - err = Init(cfg.Wxpay) + err = InitMulti(cfg.Wxpay) if err != nil { fmt.Println(err) os.Exit(1) From af9aae95514bbd39d87f1eb887d24c50b9b9dfc0 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Tue, 7 May 2024 19:24:47 +0800 Subject: [PATCH 2/2] add tifenzone --- dbstruct/vas.sql | 1 + etc/mix/mix-prod.yaml | 6 +++--- etc/mix/mix-test.yaml | 10 ++++++++++ library/payclients/wxpaycli/client.go | 10 ++++++---- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/dbstruct/vas.sql b/dbstruct/vas.sql index a7f5d9d1..2a0aad65 100644 --- a/dbstruct/vas.sql +++ b/dbstruct/vas.sql @@ -68,6 +68,7 @@ CREATE INDEX ix_orderid ON vas_ch_charge (order_id); CREATE INDEX mid_ct ON vas_ch_income (mid, ct); CREATE INDEX uid_ct ON vas_ch_income (uid, ct); CREATE INDEX ix_orderid ON vas_ch_income (order_id); +CREATE INDEX ix_ct ON vas_ch_income (ct); CREATE INDEX mid_ct ON vas_ch_withdraw (mid, ct); CREATE INDEX uid_ct ON vas_ch_withdraw (uid, ct); CREATE INDEX ix_orderid ON vas_ch_withdraw (order_id); diff --git a/etc/mix/mix-prod.yaml b/etc/mix/mix-prod.yaml index fd8403be..9430d499 100644 --- a/etc/mix/mix-prod.yaml +++ b/etc/mix/mix-prod.yaml @@ -64,13 +64,13 @@ wxpay: app_secret: "ebc325109b91087e22f046bc8ac5c940" wxpay_tfz: - mchid: "1665016206" - appid: "" + mchid: "1675813721" + appid: "wxc28fd8aaf31984b6" serial_no: "176903F43E78B0BA5AA1F08A3BE852A5F637DC77" apiv3_key: "5QwY1XMK1HW3JQwGKbA3mfJ5cdsTQGjR" private_key_path: "/app/wishpal-ironfan/etc/mix/wxpaycert_tfz/apiclient_key.pem" notify_url: "https://api.tiefen.fun/ext/vas/wxpay_callback" - app_secret: "mot5410nh69k87e22f046bc8anv5xds8" + app_secret: "ebc325109b91087e22f046bc8ac5c940" apollo: app_id: "wishpal_live_service" diff --git a/etc/mix/mix-test.yaml b/etc/mix/mix-test.yaml index 8c644edf..9e6c47ed 100644 --- a/etc/mix/mix-test.yaml +++ b/etc/mix/mix-test.yaml @@ -36,6 +36,16 @@ wxpay: notify_url: "https://api.wishpal.cn/ext/vas/wxpay_callback" app_secret: "ebc325109b91087e22f046bc8ac5c940" +wxpay_tfz: + mchid: "1675813721" + appid: "wxc28fd8aaf31984b6" + serial_no: "176903F43E78B0BA5AA1F08A3BE852A5F637DC77" + apiv3_key: "5QwY1XMK1HW3JQwGKbA3mfJ5cdsTQGjR" + private_key_path: "/app/wishpal-ironfan/etc/mix/wxpaycert_tfz/apiclient_key.pem" + notify_url: "https://api.wishpal.cn/ext/vas/wxpay_callback" + app_secret: "ebc325109b91087e22f046bc8ac5c940" + apiv2_key: "mot5410nh69k87e22f046bc8anv5xds8" + crypto: aes: private_key: "Xbz1145141919810" diff --git a/library/payclients/wxpaycli/client.go b/library/payclients/wxpaycli/client.go index a6d353a2..9567722b 100644 --- a/library/payclients/wxpaycli/client.go +++ b/library/payclients/wxpaycli/client.go @@ -31,18 +31,19 @@ const ( ) const ( - AppIdXinYiDaoLe = "wxc28fd8aaf31984b6" - AppIdTieFenZone = "" + AppIdXinYiDaoLe = "1665016206" + AppIdTieFenZone = "1675813721" ) var allWxpayClients = map[string]*WxpayClient{} func GetDefaultWxpayClient() *WxpayClient { - return allWxpayClients[AppIdXinYiDaoLe] + return allWxpayClients[AppIdTieFenZone] } type WxpayClient struct { clientV3 *wxpayv3.ClientV3 + MchId string `json:"mch_id"` AppSecret string `json:"app_secret"` AppId string `json:"app_id"` NotifyUrl string `json:"notify_url"` @@ -60,7 +61,7 @@ func InitMulti(cfgList ...*configcenter.WxpayClientConfig) (err error) { err = errors.New("NewAlipayClient fail") return } - allWxpayClients[cli.AppId] = cli + allWxpayClients[cli.MchId] = cli } return } @@ -82,6 +83,7 @@ func NewWxpayClient(cfg *configcenter.WxpayClientConfig) (ret *WxpayClient, err ret = &WxpayClient{ clientV3: wxpayCliV3, + MchId: cfg.MchId, AppSecret: cfg.AppSecret, AppId: cfg.AppId, NotifyUrl: cfg.NotifyUrl,