-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9de0c76
commit 02ed9cd
Showing
11 changed files
with
141 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
#nullable enable | ||
|
||
namespace Mercoa.Client; | ||
|
||
public class CounterpartyWebhook | ||
{ | ||
[JsonPropertyName("eventType")] | ||
public string EventType { get; init; } | ||
|
||
[JsonPropertyName("payeeId")] | ||
public string PayeeId { get; init; } | ||
|
||
[JsonPropertyName("payorId")] | ||
public string PayorId { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Text.Json.Serialization; | ||
using Mercoa.Client; | ||
|
||
#nullable enable | ||
|
||
namespace Mercoa.Client; | ||
|
||
public class EntityWebhook | ||
{ | ||
[JsonPropertyName("eventType")] | ||
public string EventType { get; init; } | ||
|
||
[JsonPropertyName("entity")] | ||
public EntityResponse Entity { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Text.Json.Serialization; | ||
using Mercoa.Client; | ||
|
||
#nullable enable | ||
|
||
namespace Mercoa.Client; | ||
|
||
public class InvoiceEmailWebhook | ||
{ | ||
[JsonPropertyName("eventType")] | ||
public string EventType { get; init; } | ||
|
||
/// <summary> | ||
/// If an invoice was created from the email, this will be present. | ||
/// </summary> | ||
[JsonPropertyName("invoice")] | ||
public InvoiceResponse? Invoice { get; init; } | ||
|
||
/// <summary> | ||
/// If an existing invoice already exists for the email, this will be present. | ||
/// </summary> | ||
[JsonPropertyName("existingInvoiceId")] | ||
public string? ExistingInvoiceId { get; init; } | ||
} |
21 changes: 21 additions & 0 deletions
21
src/Mercoa.Client/Webhooks/Types/InvoiceStatusChangedWebhook.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Text.Json.Serialization; | ||
using Mercoa.Client; | ||
|
||
#nullable enable | ||
|
||
namespace Mercoa.Client; | ||
|
||
public class InvoiceStatusChangedWebhook | ||
{ | ||
[JsonPropertyName("newStatus")] | ||
public string NewStatus { get; init; } | ||
|
||
[JsonPropertyName("previousStatus")] | ||
public string PreviousStatus { get; init; } | ||
|
||
[JsonPropertyName("eventType")] | ||
public string EventType { get; init; } | ||
|
||
[JsonPropertyName("invoice")] | ||
public InvoiceResponse Invoice { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Text.Json.Serialization; | ||
using Mercoa.Client; | ||
|
||
#nullable enable | ||
|
||
namespace Mercoa.Client; | ||
|
||
public class InvoiceWebhook | ||
{ | ||
[JsonPropertyName("eventType")] | ||
public string EventType { get; init; } | ||
|
||
[JsonPropertyName("invoice")] | ||
public InvoiceResponse Invoice { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Text.Json.Serialization; | ||
using Mercoa.Client; | ||
|
||
#nullable enable | ||
|
||
namespace Mercoa.Client; | ||
|
||
public class PaymentMethodWebhook | ||
{ | ||
[JsonPropertyName("eventType")] | ||
public string EventType { get; init; } | ||
|
||
[JsonPropertyName("entityId")] | ||
public string EntityId { get; init; } | ||
|
||
[JsonPropertyName("paymentMethod")] | ||
public PaymentMethodResponse PaymentMethod { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Mercoa.Client; | ||
|
||
#nullable enable | ||
|
||
namespace Mercoa.Client; | ||
|
||
public class WebhooksClient | ||
{ | ||
private RawClient _client; | ||
|
||
public WebhooksClient(RawClient client) | ||
{ | ||
_client = client; | ||
} | ||
} |