feat(payment): 虎皮椒聚合支付 - 官方插件与跨平台可执行文件
新增 xunhupay 官方包,支付 RPC 与宿主只保留订单和验签边界;官方支付包同时带上各系统 provider,避免把 Linux ELF 当成本机入口。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e5a5f0ccc8
commit
a23df0cb32
63 files changed
+2070
-128
No files matched your search
@@ -4,6 +4,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"infinite-canvas/backend/internal/model"
|
||||
"infinite-canvas/backend/internal/protocol"
|
||||
"infinite-canvas/backend/internal/repository"
|
||||
|
||||
"gorm.io/driver/sqlite"
|
||||
@@ -70,6 +71,22 @@ func TestUploadedManifestCannotClaimUserActivationScope(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPaymentContributionInfersPaymentManagementKind(t *testing.T) {
|
||||
plugin := PluginView{
|
||||
Source: PluginOriginOfficial,
|
||||
Manifest: PluginManifestView{
|
||||
ID: "official-payment-xunhupay",
|
||||
Contributes: protocol.ManifestContributions{PaymentProviders: []protocol.ManifestPaymentProvider{{
|
||||
ID: "xunhupay-aggregate", Label: "虎皮椒聚合支付", Icon: "assets/icon.svg", CheckoutMode: "qr_code",
|
||||
}}},
|
||||
},
|
||||
}
|
||||
policy := pluginManagementFromView(plugin)
|
||||
if policy.Kind != PluginKindPayment || policy.Origin != PluginOriginOfficial || policy.ActivationScope != PluginScopeSystem {
|
||||
t.Fatalf("inferred payment policy = %#v", policy)
|
||||
}
|
||||
}
|
||||
|
||||
func TestArtCritiqueIsUserToggleableApplication(t *testing.T) {
|
||||
policy := pluginManagement(PluginAIArtCritique, "bundled")
|
||||
if policy.Origin != PluginOriginOfficial || policy.Kind != PluginKindApplication || policy.ActivationScope != PluginScopeUser || policy.ConfigurationScope != PluginConfigurationNone {
|
||||
|
||||
Reference in new issue
Block a user