Skip to content

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

@wsllb8

Description

@wsllb8
// 请求参数
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"

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions