Compare commits

...

6 Commits

Author SHA1 Message Date
khwezi 1039f6f2d5 Merge pull request 'Removed ipValidation checks' (#21) from payments into master
Reviewed-on: #21
2026-06-13 12:48:52 +02:00
Khwezi Mngoma 765eee2060 Removed ipValidation checks
continuous-integration/drone/pr Build is passing
2026-06-13 12:48:08 +02:00
khwezi ee250a18f0 Merge pull request 'Refactored valid payfast host list' (#20) from payments into master
Reviewed-on: #20
2026-06-13 12:12:26 +02:00
Khwezi Mngoma 5972f8906b Refactored valid payfast host list
continuous-integration/drone/pr Build is passing
2026-06-13 12:11:44 +02:00
khwezi b90c6381a0 Merge pull request 'Refactored manifest to use correct secrets' (#19) from payments into master
Reviewed-on: #19
2026-06-13 11:27:06 +02:00
Khwezi Mngoma c65398bdf6 Refactored manifest to use correct secrets
continuous-integration/drone/pr Build is passing
2026-06-13 11:26:43 +02:00
2 changed files with 6 additions and 12 deletions
@@ -25,10 +25,6 @@ public sealed class PayfastConfirmationEndpoint : IEndpoint
string? remoteIp = request.HttpContext.Connection.RemoteIpAddress?.ToString(); string? remoteIp = request.HttpContext.Connection.RemoteIpAddress?.ToString();
var ipValidation = await payfastService.ValidateReferrerIpAsync(remoteIp!, !hostEnvironment.IsProduction(), cancellationToken);
if (ipValidation.IsFailed || !ipValidation.Value) return Results.Unauthorized();
var formCollection = await request.ReadFormAsync(cancellationToken); var formCollection = await request.ReadFormAsync(cancellationToken);
if (!formCollection.TryGetValue("signature", out var signatureValues) || string.IsNullOrWhiteSpace(signatureValues.ToString())) if (!formCollection.TryGetValue("signature", out var signatureValues) || string.IsNullOrWhiteSpace(signatureValues.ToString()))
+6 -8
View File
@@ -22,11 +22,9 @@ data:
PayfastSettings__CheckoutUrl: "https://sandbox.payfast.co.za/eng/process" PayfastSettings__CheckoutUrl: "https://sandbox.payfast.co.za/eng/process"
PayfastSettings__ValidHosts__0: "www.payfast.co.za" PayfastSettings__ValidHosts__0: "www.payfast.co.za"
PayfastSettings__ValidHosts__1: "sandbox.payfast.co.za" PayfastSettings__ValidHosts__1: "sandbox.payfast.co.za"
PayfastSettings__ValidHosts__2: "w1w.payfast.co.za" PayfastSettings__ValidHosts__2: "ips.payfast.co.za"
PayfastSettings__ValidHosts__3: "w2w.payfast.co.za" PayfastSettings__ValidHosts__3: "api.payfast.co.za"
PayfastSettings__ValidHosts__4: "ips.payfast.co.za" PayfastSettings__ValidHosts__4: "payment.payfast.io"
PayfastSettings__ValidHosts__5: "api.payfast.co.za"
PayfastSettings__ValidHosts__6: "payment.payfast.io"
LiteCharmsSettings__Authority: "https://sts.security.khongisa.co.za" LiteCharmsSettings__Authority: "https://sts.security.khongisa.co.za"
LiteCharmsSettings__Audience: "midrandbooks-api" LiteCharmsSettings__Audience: "midrandbooks-api"
--- ---
@@ -128,17 +126,17 @@ spec:
- name: PayfastSettings__Passphrase - name: PayfastSettings__Passphrase
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: scheduler-secrets name: midrandbooksapi-secrets
key: payfast-passphrase key: payfast-passphrase
- name: PayfastSettings__MerchantId - name: PayfastSettings__MerchantId
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: scheduler-secrets name: midrandbooksapi-secrets
key: payfast-merchantid key: payfast-merchantid
- name: PayfastSettings__MerchantKey - name: PayfastSettings__MerchantKey
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: scheduler-secrets name: midrandbooksapi-secrets
key: payfast-merchantkey key: payfast-merchantkey
- name: ConnectionStrings__PostgresScheduler - name: ConnectionStrings__PostgresScheduler
valueFrom: valueFrom: