fix(payment): remove cid param from EasyPay redirect payments

This commit is contained in:
erio
2026-04-07 15:07:57 +08:00
parent 0a4ea55636
commit 4de9163e55
2 changed files with 1 additions and 30 deletions
+1 -1
View File
@@ -1 +1 @@
0.1.108.74
0.1.108.75
@@ -77,9 +77,6 @@ func (e *EasyPay) createRedirectPayment(req payment.CreatePaymentRequest) (*paym
"return_url": returnURL, "name": req.Subject,
"money": req.Amount,
}
if cid := e.resolveAllCIDs(); cid != "" {
params["cid"] = cid
}
params["sign"] = easyPaySign(params, e.config["pkey"])
params["sign_type"] = "MD5"
@@ -229,32 +226,6 @@ func (e *EasyPay) resolveCID(paymentType string) string {
return e.config["cid"]
}
// resolveAllCIDs collects all configured CIDs (general, alipay, wxpay) and
// returns them as a comma-separated string for the redirect payment page,
// allowing the user to choose among all available channels.
func (e *EasyPay) resolveAllCIDs() string {
seen := make(map[string]struct{})
var cids []string
for _, key := range []string{"cidAlipay", "cidWxpay"} {
v := e.config[key]
if v == "" {
continue
}
for _, c := range strings.Split(v, ",") {
c = strings.TrimSpace(c)
if c == "" {
continue
}
if _, ok := seen[c]; ok {
continue
}
seen[c] = struct{}{}
cids = append(cids, c)
}
}
return strings.Join(cids, ",")
}
func (e *EasyPay) post(ctx context.Context, endpoint string, params map[string]string) ([]byte, error) {
form := url.Values{}
for k, v := range params {