Compare commits

...

3 Commits

Author SHA1 Message Date
khwezi db0715ceca Merge pull request 'payments' (#5) from payments into master
Reviewed-on: #5
2026-06-02 08:11:34 +02:00
Khwezi Mngoma fc2f457add Refactored endpoint
continuous-integration/drone/pr Build is passing
2026-06-02 08:10:30 +02:00
Khwezi Mngoma 60e916d972 Updated endpoint
added .http file
2026-06-02 08:10:17 +02:00
4 changed files with 12 additions and 3 deletions
+2 -1
View File
@@ -360,4 +360,5 @@ MigrationBackup/
.ionide/ .ionide/
# Fody - auto-generated XML schema # Fody - auto-generated XML schema
FodyWeavers.xsd FodyWeavers.xsd
/MidrandBooksApi/http/http-client.env.json
@@ -12,7 +12,7 @@ public sealed class ConfirmationEndpoint : IEndpoint
public void Map(IEndpointRouteBuilder builder) public void Map(IEndpointRouteBuilder builder)
{ {
builder.MapPost("payments/confirm", async (HttpRequest request, HashService hashService, builder.MapPost("payments/payfast/confirm", async (HttpRequest request, HashService hashService,
IJobOrchestrator jobOrchestrator, CancellationToken cancellationToken) => IJobOrchestrator jobOrchestrator, CancellationToken cancellationToken) =>
{ {
using Activity? activity = PaymentActivitySource.StartActivity("ReceivePayfastWebhook", ActivityKind.Server); using Activity? activity = PaymentActivitySource.StartActivity("ReceivePayfastWebhook", ActivityKind.Server);
@@ -13,7 +13,7 @@
"https": { "https": {
"commandName": "Project", "commandName": "Project",
"dotnetRunMessages": true, "dotnetRunMessages": true,
"launchBrowser": false, "launchBrowser": false,
"applicationUrl": "https://localhost:7196;http://localhost:5159", "applicationUrl": "https://localhost:7196;http://localhost:5159",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
+8
View File
@@ -0,0 +1,8 @@
## Payfast Payment Confirmation
# This endpoint is used by Payfast to confirm the payment status of a transaction.
# It receives a POST request with the payment details and updates the order status accordingly.
POST {{baseUrl}}/v1/payments/payfast/confirm
Content-Type: application/x-www-form-urlencoded
amount={{amount}}&item_name={{item_name}}&m_payment_id={{paymentId}}&signature={{signature}}