From 71e605a07a022ddd869e3a0986afb0c9b1ffc5d3 Mon Sep 17 00:00:00 2001 From: Yared Yemane Date: Thu, 28 May 2026 03:16:21 -0700 Subject: [PATCH] Revert "Normalize ArifPay checkout payment URLs before returning." This reverts commit cd4e3b781157fe090c6e74a6b091d2de4e98bd60. --- internal/services/arifpay/service.go | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/internal/services/arifpay/service.go b/internal/services/arifpay/service.go index b953877..5799eec 100644 --- a/internal/services/arifpay/service.go +++ b/internal/services/arifpay/service.go @@ -8,8 +8,6 @@ import ( "fmt" "io" "net/http" - "net/url" - "path" "strings" "time" @@ -169,7 +167,7 @@ func (s *ArifpayService) InitiateSubscriptionPayment(ctx context.Context, userID } sessionID := fmt.Sprintf("%v", data["sessionId"]) - paymentURL := normalizeExternalURL(fmt.Sprintf("%v", data["paymentUrl"])) + paymentURL := fmt.Sprintf("%v", data["paymentUrl"]) // Update payment with session info if err := s.paymentStore.UpdatePaymentSessionID(ctx, payment.ID, sessionID, paymentURL); err != nil { @@ -186,22 +184,6 @@ func (s *ArifpayService) InitiateSubscriptionPayment(ctx context.Context, userID }, nil } -func normalizeExternalURL(raw string) string { - u, err := url.Parse(raw) - if err != nil { - return raw - } - if u.Path == "" { - return raw - } - cleaned := path.Clean(u.Path) - if strings.HasSuffix(u.Path, "/") && !strings.HasSuffix(cleaned, "/") { - cleaned += "/" - } - u.Path = cleaned - return u.String() -} - // ProcessPaymentWebhook handles the webhook callback from ArifPay func (s *ArifpayService) ProcessPaymentWebhook(ctx context.Context, req domain.WebhookRequest) error { // ArifPay verify/webhook payloads are inconsistent: some responses include nonce, others only sessionId.