接入顺成支付并优化配置列表
This commit is contained in:
@@ -48,6 +48,28 @@ func TestImportCreateRequestPreservesTestingConfig(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateCreateRequestRequiresShunchengSecretID(t *testing.T) {
|
||||
repo := &Repository{}
|
||||
req := CreateRequest{
|
||||
Name: "顺成生产商户",
|
||||
Provider: "shuncheng",
|
||||
MerchantID: "0000000038",
|
||||
GatewayURL: "http://jyzxapi.ydxnhb.com",
|
||||
SignKey: "secret-key",
|
||||
NotifyKey: "notify-key",
|
||||
NotifyURL: "https://example.com/api/payments/shuncheng/notify",
|
||||
PayWay: "ZFBZF",
|
||||
}
|
||||
if err := repo.validateCreateRequest(req); err != ErrSecretIDRequired {
|
||||
t.Fatalf("validateCreateRequest() error = %v, want ErrSecretIDRequired", err)
|
||||
}
|
||||
|
||||
req.ExtraConfig = map[string]any{"secret_id": "SEC-1"}
|
||||
if err := repo.validateCreateRequest(req); err != nil {
|
||||
t.Fatalf("validateCreateRequest() error = %v, want nil", err)
|
||||
}
|
||||
}
|
||||
|
||||
// TestListUsesSuccessfulPaymentStats 验证配置页只统计成功支付,不把打开二维码或取消订单算作成交。
|
||||
func TestListUsesSuccessfulPaymentStats(t *testing.T) {
|
||||
db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{Logger: logger.Default.LogMode(logger.Silent)})
|
||||
|
||||
Reference in New Issue
Block a user