Skip to content

Commit

Permalink
Merge pull request #10 from sherweb/FailureEvent
Browse files Browse the repository at this point in the history
Webhook associated to failure event
  • Loading branch information
asantossheweb authored Nov 18, 2024
2 parents 415c84d + 054c196 commit 85456cb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Xtkl.NceTransferWebhooks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
using Xtkl.NceTransferWebhooks.DTOs;
using Xtkl.NceTransferWebhooks.Model;

const string EVENT_COMPLETE_TRANSFER = "complete-transfer";
const string EVENT_FAIL_TRANSFER = "fail-transfer";

var builder = WebApplication.CreateBuilder(args);

builder.Logging.ClearProviders();
Expand Down Expand Up @@ -208,6 +205,12 @@ IAggregatePartner GetPartnerCredentials(TenantRegion region, IConfiguration conf

async Task<IResult> SendToCumulus(Transfer transfer, IConfiguration configuration)
{
if (!transfer.status.Equals(TransferStatus.Complete.ToString(), StringComparison.OrdinalIgnoreCase) &&
!transfer.status.Equals(TransferStatus.Expired.ToString(), StringComparison.OrdinalIgnoreCase))
{
return Results.Conflict("The transfer is not in 'Complete' or 'Expired' status and cannot be processed.");
}

var httpClient = new HttpClient();

var jsonContent = new StringContent(JsonSerializer.Serialize(transfer), Encoding.UTF8, "application/json");
Expand Down

0 comments on commit 85456cb

Please sign in to comment.