Skip to content

Commit

Permalink
docs: 补充文档
Browse files Browse the repository at this point in the history
  • Loading branch information
mingzaily committed May 16, 2024
1 parent 648ff54 commit e4971cf
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,27 @@ var result map[string]interface{}
var err = client.Request(p, &result)
```

## 链路跟踪

```go
// HTTP客户端
httpClient := &http.Client{
Timeout: 30 * time.Second,
Transport: otelhttp.NewTransport(
http.DefaultTransport,
otelhttp.WithSpanNameFormatter(func(operation string, r *http.Request) string {
return r.Method + " " + r.URL.Path
}),
),
}

// 初始化支付宝客户端
client, err := alipay.New(appId, privateKey, false, alipay.WithHTTPClient(httpClient))
if err != nil {
fmt.Println(err)
}
```

## 示例

[网页支付](https://github.com/smartwalle/alipay/blob/master/examples/main.go)
Expand Down

0 comments on commit e4971cf

Please sign in to comment.