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

JSSDK退款API调用时refund_out_no字段未写入到请求body中 #44

Closed
AlvinQinwen opened this issue Oct 13, 2021 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@AlvinQinwen
Copy link
Contributor

AlvinQinwen commented Oct 13, 2021

  • go version: go1.16.7 darwin/amd64
  • sdk version v1.1.5

调用退款接口

paymentClient, err := utils.NewWXPaymentApp(ctx.Request, params.AppId, NotifyUrl)
	if err != nil {
		panic(err)
	}
	fmt.Println(params.RefundOutNO)
	// 1634095819-969073932
	outRefundNo := fmt.Sprintf("%d-%d", time.Now().Unix(), time.Now().Nanosecond())
	response, err := paymentClient.Refund.Refund("xxxxx", outRefundNo, &power.HashMap{
		"refund":   15,
		"total":    15,
		"currency": "CNY",
	}, &power.HashMap{
		"reason": "技术部退款",
	})

	fmt.Println(response)

根据utils.NewWXPaymentApp()方法中的HttpDebug: true可看到请求参数缺失out_refund_no
image

以及api接口返回信息亦提示
输入源“/body/out_refund_no”映射到字段“商户退款单号”必填性规则校验失败,此字段为必填项
image

@AlvinQinwen AlvinQinwen added the bug Something isn't working label Oct 13, 2021
@Matrix-X
Copy link
Contributor

请升级使用 release 1.1.7,已经完成强类型对象,传参。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants