Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
6b194903
"...internal/payment/git@web.lueluesay.top:chenxi/sub2api.git" did not exist on "91ef23046da1ee61ce32d04d3423fba479deaa6f"
Commit
6b194903
authored
Apr 22, 2026
by
IanShaw027
Browse files
fix(ci): align openai account tests and remove dead wxpay const
parent
9de7a72c
Changes
3
Show whitespace changes
Inline
Side-by-side
backend/internal/payment/provider/wxpay.go
View file @
6b194903
...
@@ -60,11 +60,6 @@ const (
...
@@ -60,11 +60,6 @@ const (
wxpayEventTransactionSuccess
=
"TRANSACTION.SUCCESS"
wxpayEventTransactionSuccess
=
"TRANSACTION.SUCCESS"
)
)
// WeChat Pay error codes.
const
(
wxpayErrNoAuth
=
"NO_AUTH"
)
var
(
var
(
wxpayNativePrepay
=
func
(
ctx
context
.
Context
,
svc
native
.
NativeApiService
,
req
native
.
PrepayRequest
)
(
*
native
.
PrepayResponse
,
*
core
.
APIResult
,
error
)
{
wxpayNativePrepay
=
func
(
ctx
context
.
Context
,
svc
native
.
NativeApiService
,
req
native
.
PrepayRequest
)
(
*
native
.
PrepayResponse
,
*
core
.
APIResult
,
error
)
{
return
svc
.
Prepay
(
ctx
,
req
)
return
svc
.
Prepay
(
ctx
,
req
)
...
...
backend/internal/service/account_test_service.go
View file @
6b194903
...
@@ -170,7 +170,7 @@ func (s *AccountTestService) TestAccountConnection(c *gin.Context, accountID int
...
@@ -170,7 +170,7 @@ func (s *AccountTestService) TestAccountConnection(c *gin.Context, accountID int
// Route to platform-specific test method
// Route to platform-specific test method
if
account
.
IsOpenAI
()
{
if
account
.
IsOpenAI
()
{
return
s
.
testOpenAIAccountConnection
(
c
,
account
,
modelID
)
return
s
.
testOpenAIAccountConnection
(
c
,
account
,
modelID
,
prompt
)
}
}
if
account
.
IsGemini
()
{
if
account
.
IsGemini
()
{
...
@@ -410,8 +410,9 @@ func (s *AccountTestService) testBedrockAccountConnection(c *gin.Context, ctx co
...
@@ -410,8 +410,9 @@ func (s *AccountTestService) testBedrockAccountConnection(c *gin.Context, ctx co
}
}
// testOpenAIAccountConnection tests an OpenAI account's connection
// testOpenAIAccountConnection tests an OpenAI account's connection
func
(
s
*
AccountTestService
)
testOpenAIAccountConnection
(
c
*
gin
.
Context
,
account
*
Account
,
modelID
string
)
error
{
func
(
s
*
AccountTestService
)
testOpenAIAccountConnection
(
c
*
gin
.
Context
,
account
*
Account
,
modelID
string
,
prompt
string
)
error
{
ctx
:=
c
.
Request
.
Context
()
ctx
:=
c
.
Request
.
Context
()
_
=
prompt
// Default to openai.DefaultTestModel for OpenAI testing
// Default to openai.DefaultTestModel for OpenAI testing
testModelID
:=
modelID
testModelID
:=
modelID
...
...
backend/internal/service/account_test_service_openai_test.go
View file @
6b194903
...
@@ -103,7 +103,7 @@ func TestAccountTestService_OpenAISuccessPersistsSnapshotFromHeaders(t *testing.
...
@@ -103,7 +103,7 @@ func TestAccountTestService_OpenAISuccessPersistsSnapshotFromHeaders(t *testing.
Credentials
:
map
[
string
]
any
{
"access_token"
:
"test-token"
},
Credentials
:
map
[
string
]
any
{
"access_token"
:
"test-token"
},
}
}
err
:=
svc
.
testOpenAIAccountConnection
(
ctx
,
account
,
"gpt-5.4"
)
err
:=
svc
.
testOpenAIAccountConnection
(
ctx
,
account
,
"gpt-5.4"
,
""
)
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
require
.
NotEmpty
(
t
,
repo
.
updatedExtra
)
require
.
NotEmpty
(
t
,
repo
.
updatedExtra
)
require
.
Equal
(
t
,
42.0
,
repo
.
updatedExtra
[
"codex_5h_used_percent"
])
require
.
Equal
(
t
,
42.0
,
repo
.
updatedExtra
[
"codex_5h_used_percent"
])
...
@@ -134,7 +134,7 @@ func TestAccountTestService_OpenAI429PersistsSnapshotWithoutRateLimit(t *testing
...
@@ -134,7 +134,7 @@ func TestAccountTestService_OpenAI429PersistsSnapshotWithoutRateLimit(t *testing
Credentials
:
map
[
string
]
any
{
"access_token"
:
"test-token"
},
Credentials
:
map
[
string
]
any
{
"access_token"
:
"test-token"
},
}
}
err
:=
svc
.
testOpenAIAccountConnection
(
ctx
,
account
,
"gpt-5.4"
)
err
:=
svc
.
testOpenAIAccountConnection
(
ctx
,
account
,
"gpt-5.4"
,
""
)
require
.
Error
(
t
,
err
)
require
.
Error
(
t
,
err
)
require
.
NotEmpty
(
t
,
repo
.
updatedExtra
)
require
.
NotEmpty
(
t
,
repo
.
updatedExtra
)
require
.
Equal
(
t
,
100.0
,
repo
.
updatedExtra
[
"codex_5h_used_percent"
])
require
.
Equal
(
t
,
100.0
,
repo
.
updatedExtra
[
"codex_5h_used_percent"
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment