Skip to content

Commit 09c81fc

Browse files
committed
加/sandbox/
1 parent d793997 commit 09c81fc

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
4+
## 1.2.13 - 2025-07-02
5+
* [#15](https://github.com/alipay/global-open-sdk-go/pull/15) feature-250702
6+
- 沙箱接口需要带/sandbox/路径
7+
38
## 1.2.12 - 2025-04-10
49
* [#14](https://github.com/alipay/global-open-sdk-go/pull/14) feature-250410
510
- Antom 印度渠道接入AMS拒付相关接口的标准变更

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```
22
Language:GO
33
GO version:1.22.5+
4-
Tags:v1.2.12
4+
Tags:v1.2.13
55
Copyright:Ant financial services group
66
```
77

com/alipay/api/defaultAlipayClient.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ func (alipayClient *DefaultAlipayClient) Execute(alipayRequest *request.AlipayRe
119119
if err != nil {
120120
return nil, &exception.AlipayLibraryError{Message: "json.Marshal is fail " + err.Error()}
121121
}
122+
AdjustSandboxUrl(alipayClient.IsSandboxMode, alipayRequest)
122123
path := alipayRequest.Path
123124
httpMethod := alipayRequest.HttpMethod
124125
reqTime := strconv.FormatInt(time.Now().UnixNano(), 10)
@@ -159,4 +160,12 @@ func buildBaseHeader(reqTime string, clientId string, keyVersion string, signatu
159160
"Key-Version": keyVersion,
160161
"Signature": signatureValue,
161162
}
163+
164+
}
165+
166+
func AdjustSandboxUrl(isSandboxMode bool, req *request.AlipayRequest) {
167+
if isSandboxMode {
168+
// 替换第一个"/ams/api"为"/ams/sandbox/api"
169+
req.Path = strings.Replace(req.Path, "/ams/api", "/ams/sandbox/api", 1)
170+
}
162171
}

0 commit comments

Comments
 (0)