优化结构
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"encoding/base64"
|
||||
"kra/internal/biz/system"
|
||||
bizpayment "kra/internal/biz/payment"
|
||||
"net/url"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -94,7 +94,7 @@ func TestAlipaySignContentSortedAndExcludesSign(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAlipayBreakdownWithPointPayment(t *testing.T) {
|
||||
result := &system.PaymentResult{Status: "success", Amount: 1000}
|
||||
result := &bizpayment.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",
|
||||
})
|
||||
@@ -107,7 +107,7 @@ func TestAlipayBreakdownWithPointPayment(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWechatV2BreakdownWithCoupon(t *testing.T) {
|
||||
result := &system.PaymentResult{Status: "success", Amount: 1000}
|
||||
result := &bizpayment.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)
|
||||
@@ -118,7 +118,7 @@ func TestWechatV2BreakdownWithCoupon(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWechatV3BreakdownWithPromotion(t *testing.T) {
|
||||
result := &system.PaymentResult{Status: "success", Amount: 1000}
|
||||
result := &bizpayment.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)}},
|
||||
@@ -132,7 +132,7 @@ func TestWechatV3BreakdownWithPromotion(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestVendorBreakdownUsesConfiguredUnits(t *testing.T) {
|
||||
result := &system.PaymentResult{Status: "success", Amount: 1000, Currency: "CNY"}
|
||||
result := &bizpayment.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",
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user