Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SystemOauthToken 接口报错 invalid certificate #192

Open
changcz opened this issue Jan 24, 2024 · 10 comments
Open

SystemOauthToken 接口报错 invalid certificate #192

changcz opened this issue Jan 24, 2024 · 10 comments

Comments

@changcz
Copy link

changcz commented Jan 24, 2024

调用 PublicAppAuthorize 接口 接受回调 auth_code

@changcz
Copy link
Author

changcz commented Jan 24, 2024

client, err := alipay.New(appid,秘钥,true)

@changcz
Copy link
Author

changcz commented Jan 24, 2024

var p = alipay.SystemOauthToken{}
p.GrantType = "authorization_code"
p.Code = authCode
token, err := client.SystemOauthToken(p)   

@changcz
Copy link
Author

changcz commented Jan 24, 2024

咨询过支付宝技术服务中心 提供了 appid 帮我查了之后 说调用alipay.system.oauth.token是成功的

Repository owner deleted a comment from elton Feb 20, 2024
Repository owner deleted a comment from mkproject-admin Feb 21, 2024
@heiwa9
Copy link

heiwa9 commented Apr 18, 2024

我也是,这个有问题

@taisoulx
Copy link

咨询过支付宝技术服务中心 提供了 appid 帮我查了之后 说调用alipay.system.oauth.token是成功的

需要在调用前加载支付宝公钥
aliPayKey :="------------"
client.LoadAliPayPublicKey(aliPayKey)
然后再:
client.SystemOauthToken(alipay.SystemOauthToken)
就ok了

@heiwa9
Copy link

heiwa9 commented May 9, 2024

client.LoadAliPayPublicKey(aliPayKey)
这个我确定是加载过了的,但是还是不行

@heiwa9
Copy link

heiwa9 commented May 9, 2024

runtime error: invalid memory address or nil pointer dereference
/usr/Local/go/src/runtime/panic.go:261 (0x10e8ca8b7)
panicmem: panic (memoryError)
/usr/local/go/src/runtime/signal_unix.go:881 (0x10e8ca885)
sigpanic: panicmemo
/Users/song/go/pkg/mod/github.com/smartwalle/alipay/v30v3.2.19/alipay.go:378 (0x10f8493df)
(*Client). doRequest: var req = ngx.NewRequest(method, c.host, ngx. WithClient(c.Client))
/Users/song/go/pkg/mod/github.com/smartwalle/alipay/v30v3.2.19/authorize.go:32 (0x10f97c624)
(*Client). System0authToken: err = c. doRequest("POST", param, &result)
/Users/song/XDSK/weblink/service/biz/biz_alipay_applet.go:34 (0x10f97c58a)
(*AliAppletService).AlipayAuth: res0, err := a.cli.System0authToken(alipay.System0authTokent
/Users/song/DSK/weblink/api/v1/biz/biz_alipay_applet.go:30 (0x10fddd0c8)
(*AlipayAppletApi) AlipayAuthorization: auth, err := aliAppletService.AlipayAuth(info.AuthToken)
/Users/song/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x10f43668a)
(*Context) Next: c.handlersc.index
/Users/song/XDSK/weblink/middleware/cors.go:26 (0x10fe9c86e)
Routers.Cors.func3: c.Next
/Users/song/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x10f43668a)

@smartwalle
Copy link
Owner

aliPayKey

你的 aliPayKey 是哪里来的

@smartwalle
Copy link
Owner

咨询过支付宝技术服务中心 提供了 appid 帮我查了之后 说调用alipay.system.oauth.token是成功的

需要在调用前加载支付宝公钥 aliPayKey :="------------" client.LoadAliPayPublicKey(aliPayKey) 然后再: client.SystemOauthToken(alipay.SystemOauthToken) 就ok了

哥们,你有用这个接口吗?是否有问题?

@heiwa9
Copy link

heiwa9 commented May 10, 2024

aliPayKey

你的 aliPayKey 是哪里来的

已经解决了,是我自己的代码问题,导致没有初始化就用它了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants