-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Description
Feature Proposal Description
I am using go-pay is to realize the business of the payment function, found that go-pay only support to receive http.Request, I have to manually do the conversion again, most of the libraries may only implement the http.Request, maybe we can support a way to facilitate the user more simple to switch.
Feature Examples
body := c.Body()
httpReq := &http.Request{
Method: string(c.Method()),
URL: &url.URL{Path: c.Path()},
Body: io.NopCloser(bytes.NewReader(body)),
Header: make(http.Header),
}
// Copy headers
c.Request().Header.VisitAll(func(key, value []byte) {
httpReq.Header.Set(string(key), string(value))
})
logger.Z().Info("copy headers success")
notifyReq, err := wechat.V3ParseNotify(httpReq)
if err != nil {
logger.Z().Error("Failed to parse callback notification",
zap.String(common.X_REQUEST_ID, requestId),
zap.Error(err))
return c.Status(400).JSON(fiber.Map{
"code": "FAIL",
"message": "失败",
})
}Checklist:
- I agree to follow Fiber's Code of Conduct.
- I have searched for existing issues that describe my proposal before opening this one.
- I understand that a proposal that does not meet these guidelines may be closed without explanation.
Reactions are currently unavailable