优化结构

This commit is contained in:
Yvan
2026-08-22 12:13:16 +08:00
parent d987244d0e
commit b27a66e9d3
200 changed files with 1794 additions and 1715 deletions
+5 -6
View File
@@ -4,11 +4,10 @@ import (
"crypto/aes"
"crypto/cipher"
"encoding/base64"
"kra/internal/biz/system"
"net/url"
"strings"
"testing"
"kra/internal/biz"
)
func TestWechatV2SignOfficialStyle(t *testing.T) {
@@ -95,7 +94,7 @@ func TestAlipaySignContentSortedAndExcludesSign(t *testing.T) {
}
func TestAlipayBreakdownWithPointPayment(t *testing.T) {
result := &biz.PaymentResult{Status: "success", Amount: 1000}
result := &system.PaymentResult{Status: "success", Amount: 1000}
err := populateAlipayBreakdown(result, map[string]any{
"total_amount": "10.00", "buyer_pay_amount": "8.00", "point_amount": "2.00", "receipt_amount": "8.00",
})
@@ -108,7 +107,7 @@ func TestAlipayBreakdownWithPointPayment(t *testing.T) {
}
func TestWechatV2BreakdownWithCoupon(t *testing.T) {
result := &biz.PaymentResult{Status: "success", Amount: 1000}
result := &system.PaymentResult{Status: "success", Amount: 1000}
err := populateWechatV2Breakdown(result, map[string]string{"cash_fee": "900", "coupon_fee": "100", "settlement_total_fee": "950"})
if err != nil {
t.Fatal(err)
@@ -119,7 +118,7 @@ func TestWechatV2BreakdownWithCoupon(t *testing.T) {
}
func TestWechatV3BreakdownWithPromotion(t *testing.T) {
result := &biz.PaymentResult{Status: "success", Amount: 1000}
result := &system.PaymentResult{Status: "success", Amount: 1000}
err := populateWechatV3Breakdown(result, map[string]any{
"amount": map[string]any{"payer_total": float64(800), "settlement_amount": float64(780)},
"promotion_detail": []any{map[string]any{"amount": float64(200)}},
@@ -133,7 +132,7 @@ func TestWechatV3BreakdownWithPromotion(t *testing.T) {
}
func TestVendorBreakdownUsesConfiguredUnits(t *testing.T) {
result := &biz.PaymentResult{Status: "success", Amount: 1000, Currency: "CNY"}
result := &system.PaymentResult{Status: "success", Amount: 1000, Currency: "CNY"}
object := map[string]any{"data": map[string]any{
"payer": "8.00", "cash": "6.00", "points": "2.00", "discount": "2.00", "settlement": "7.80",
}}