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

支付宝v3如何为单次的支付请求设置app_auth_token #469

Open
wsllb8 opened this issue Mar 6, 2025 · 0 comments
Open

支付宝v3如何为单次的支付请求设置app_auth_token #469

wsllb8 opened this issue Mar 6, 2025 · 0 comments

Comments

@wsllb8
Copy link

wsllb8 commented Mar 6, 2025

// 请求参数
bm := make(gopay.BodyMap)
bm.Set("subject", "预创建创建订单").
	Set("out_trade_no", util.RandomString(32)).
	Set("total_amount", "0.01").
	Set("scene", "bar_code").
	Set("auth_code", "11111111111").
	Set("app_auth_token", "202503020220")
// 创建订单
res, err := client.TradePay(c, bm)
if err != nil {
	xlog.Errorf("client.TradePrecreate(), err:%v", err)
	return
}

这样设置好像没有添加到公共参数中, 比如要设置

client.AppAuthToken = "202503020220"

这样设置才能添加到公共参数, 然后发送正确的请求

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

1 participant