refactor(payment): 支付插件 - 宿主仅通过 RPC 包加载并保护订单版本

This commit is contained in:
ddCat
2026-09-02 16:15:57 +08:00
parent d6bbdbe27b
commit 38e715ea3f
45 changed files with 1584 additions and 203 deletions

View File

@@ -5,6 +5,15 @@ root_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
node "$root_dir/embed-documentation.mjs"
# Payment backends are executable plugin payloads. They are compiled outside
# the host binary and then included under backend/provider in the package.
repo_dir=$(CDPATH= cd -- "$root_dir/.." && pwd)
for payment_plugin in official-payment-wechat-native official-payment-alipay-page; do
mkdir -p "$root_dir/$payment_plugin/backend"
done
(cd "$repo_dir/backend" && go build -trimpath -ldflags='-s -w' -o "$root_dir/official-payment-wechat-native/backend/provider" ./cmd/payment-wechat)
(cd "$repo_dir/backend" && go build -trimpath -ldflags='-s -w' -o "$root_dir/official-payment-alipay-page/backend/provider" ./cmd/payment-alipay)
for manifest in "$root_dir"/*/manifest.json; do
package_dir=${manifest%/manifest.json}
package_id=${package_dir##*/}
@@ -13,7 +22,7 @@ for manifest in "$root_dir"/*/manifest.json; do
rm -f "$temporary_file"
(
cd "$package_dir"
find manifest.json README.md docs assets web LICENSE -type f 2>/dev/null | LC_ALL=C sort | zip -X -q "$temporary_file" -@
find manifest.json README.md docs assets web backend LICENSE -type f 2>/dev/null | LC_ALL=C sort | zip -X -q "$temporary_file" -@
)
mv "$temporary_file" "$output_file"
done