From 75a90f71657e4db148f71d9a7e48315b59d0625e Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 11 Apr 2023 19:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pay/alipay.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pay/alipay.go b/pay/alipay.go index 8ee0ea6..cdab74c 100644 --- a/pay/alipay.go +++ b/pay/alipay.go @@ -56,6 +56,7 @@ func Comm(args map[string]string) *alipay.Client { client.SetAliPayRootCertSN(aliPayRootCertSN) client.SetAliPayPublicCertSN(paySet.PayAlipayrsaPublicKey) } + client.IsProd = true fmt.Println(client) return client @@ -76,6 +77,18 @@ func OpenAuthTokenApp(args map[string]string) (*alipay.SystemOauthTokenResponse, } return payParam, nil } +func UserInfoShare(args map[string]string) (*alipay.UserInfoShareResponse, error) { + client := Comm(args) + client.AuthToken = args["auth_token"] + if client == nil { + return nil, errors.New("获取失败") + } + payParam, err := client.UserInfoShare() + if err != nil { + return nil, err + } + return payParam, nil +} func CreditagreementSign(args map[string]string) (string, error) { client := Comm(args)