From 3f5e277855a2605f684f06400a2644457e0255dd Mon Sep 17 00:00:00 2001 From: erio Date: Wed, 8 Apr 2026 22:07:42 +0800 Subject: [PATCH] refactor(payment): inline subscription flow and simplify payment modes - EasyPay: remove redirect mode, keep only qrcode and popup - Stripe: remove mode config entirely, always use inline Payment Element - Subscription: replace dialog with inline confirm UI (plan summary + method selector + fee breakdown), same flow as top-up - Move PaymentStatusPanel/StripePaymentInline to shared section for both recharge and subscription payments - Hide tabs and help card during payment/subscription confirm phases --- backend/internal/payment/provider/easypay.go | 4 +- .../payment/PaymentProviderDialog.vue | 17 +- .../src/components/payment/ProviderCard.vue | 3 +- .../src/components/payment/providerConfig.ts | 6 +- frontend/src/views/user/PaymentView.vue | 297 +++++++++++------- 5 files changed, 184 insertions(+), 143 deletions(-) diff --git a/backend/internal/payment/provider/easypay.go b/backend/internal/payment/provider/easypay.go index 5cf42c9eea..ec072fd935 100644 --- a/backend/internal/payment/provider/easypay.go +++ b/backend/internal/payment/provider/easypay.go @@ -57,9 +57,9 @@ func (e *EasyPay) SupportedTypes() []payment.PaymentType { func (e *EasyPay) CreatePayment(ctx context.Context, req payment.CreatePaymentRequest) (*payment.CreatePaymentResponse, error) { // Payment mode determined by instance config, not payment type. - // "redirect"/"popup" → hosted page (submit.php); "qrcode"/default → API call (mapi.php). + // "popup" → hosted page (submit.php); "qrcode"/default → API call (mapi.php). mode := e.config["paymentMode"] - if mode == "redirect" || mode == "popup" { + if mode == "popup" { return e.createRedirectPayment(req) } return e.createAPIPayment(ctx, req) diff --git a/frontend/src/components/payment/PaymentProviderDialog.vue b/frontend/src/components/payment/PaymentProviderDialog.vue index c101b3c7af..2a69491b1b 100644 --- a/frontend/src/components/payment/PaymentProviderDialog.vue +++ b/frontend/src/components/payment/PaymentProviderDialog.vue @@ -37,7 +37,7 @@
-
+
- -
+ +
- -