mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-23 05:51:40 +00:00
fix(payment): remove cid param from EasyPay redirect payments
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user