更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -15,18 +15,6 @@ import (
|
||||
"github.com/plutov/paypal/v4"
|
||||
)
|
||||
|
||||
// PayPalChannel PayPal(Checkout v2 + Webhook)
|
||||
//
|
||||
// 渠道参数(config_json):
|
||||
//
|
||||
// client_id REST App Client ID
|
||||
// client_secret REST App Secret
|
||||
// webhook_id Webhook ID(用于验签)
|
||||
// currency 币种,默认 USD
|
||||
//
|
||||
// 扩展(extra_json):
|
||||
//
|
||||
// env sandbox / live
|
||||
type PayPalChannel struct{}
|
||||
|
||||
func (c *PayPalChannel) Code() string { return ChannelPayPal }
|
||||
@@ -81,7 +69,6 @@ func (c *PayPalChannel) Prepay(ctx context.Context, order *models.PlatformPaymen
|
||||
return nil, fmt.Errorf("PayPal 下单失败: %w", err)
|
||||
}
|
||||
|
||||
// v2 的跳转链接 rel 为 payer-action(旧版为 approve)
|
||||
approve := ""
|
||||
for _, l := range payOrder.Links {
|
||||
if l.Rel == "approve" || l.Rel == "payer-action" {
|
||||
@@ -96,7 +83,7 @@ func (c *PayPalChannel) Prepay(ctx context.Context, order *models.PlatformPaymen
|
||||
Channel: ChannelPayPal,
|
||||
PayType: PayTypeWeb,
|
||||
RedirectURL: approve,
|
||||
ChannelTradeNo: payOrder.ID, // PayPal 订单号,回调后替换为 capture id
|
||||
ChannelTradeNo: payOrder.ID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -121,7 +108,6 @@ func (c *PayPalChannel) Query(ctx context.Context, order *models.PlatformPayment
|
||||
case "VOIDED":
|
||||
state.TradeState = StateClosed
|
||||
case "APPROVED":
|
||||
// 用户已批准但未捕获,等待 webhook 或人工捕获
|
||||
state.TradeState = StatePending
|
||||
default:
|
||||
state.TradeState = StatePending
|
||||
@@ -161,7 +147,6 @@ func (c *PayPalChannel) ParseNotify(ctx context.Context, r *http.Request, cfg *C
|
||||
return nil, fmt.Errorf("PayPal 参数不完整:需要 webhook_id")
|
||||
}
|
||||
|
||||
// VerifyWebhookSignature 会读取请求体,先读出来再回填,供后面解析事件内容
|
||||
raw, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("读取 PayPal 通知失败: %w", err)
|
||||
|
||||
Reference in new issue
Block a user