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)