diff --git a/LiteCharms.Features.MidrandBooks/Payments/PayfastService.cs b/LiteCharms.Features.MidrandBooks/Payments/PayfastService.cs index 8aa1eec..8d440d8 100644 --- a/LiteCharms.Features.MidrandBooks/Payments/PayfastService.cs +++ b/LiteCharms.Features.MidrandBooks/Payments/PayfastService.cs @@ -147,23 +147,56 @@ public sealed partial class PayfastService(IDbContextFactory m.Value.ToUpperInvariant()); - string key = kvp.Key; - - // 1. Payfast requires spaces to be '+' signs. HttpUtility does this perfectly. - string encodedVal = HttpUtility.UrlEncode(kvp.Value.Trim()); - - // 2. Payfast requires all OTHER percent-encoded hex arrays to be UPPERCASE (e.g., %3A instead of %3a) - string val = Regex.Replace(encodedVal, "%[0-9A-Fa-f]{2}", m => m.Value.ToUpperInvariant()); - - pfOutput.Append($"{key}={val}&"); + pfOutput.Append($"{key}={val}&"); + } } string getString = pfOutput.Length > 0 @@ -172,7 +205,6 @@ public sealed partial class PayfastService(IDbContextFactory m.Value.ToUpperInvariant());