Giter Club home page Giter Club logo

Comments (5)

Matrix-X avatar Matrix-X commented on August 17, 2024 1

是的,官网返回的code,正常应该是0

from powerwechat.

Matrix-X avatar Matrix-X commented on August 17, 2024

你这个不能判断error为依据,因为请求没有出错。

这里的err是请求过程中异常报错。

而微信返回的内容是正常的,给了业务code的错误信息, 你要通过判断code如果不等于0的情况,然后做相应处理

from powerwechat.

lisgroup avatar lisgroup commented on August 17, 2024

你这个不能判断error为依据,因为请求没有出错。

这里的err是请求过程中异常报错。

而微信返回的内容是正常的,给了业务code的错误信息, 你要通过判断code如果不等于0的情况,然后做相应处理

要加上这样处理吗:

response, err := payment.Order.JSAPITransaction(ctx, options)

if err != nil {
    return nil, err
}
if response.Code != "" {
   return nil, errors.New(response.Message)
}

from powerwechat.

lisgroup avatar lisgroup commented on August 17, 2024

我看请求的 src/payment/kernel/baseClient.go 295行代码:

returnResponse, err := df.Request()
	if err != nil {
		return returnResponse, err
	}

发送http请求后,没有找到close的地方,这个会导致内存泄漏吗?

from powerwechat.

Matrix-X avatar Matrix-X commented on August 17, 2024

这个封装的层,还在看底层的请求层
你也可以内存工具看看。

from powerwechat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.