Skip to content

Commit

Permalink
GET external_subscription by external_id
Browse files Browse the repository at this point in the history
Added new method to get external_subscription by external_id.
  • Loading branch information
paulorbpinho-fullstacklabs committed Jun 12, 2024
1 parent 351dc00 commit 69dcc8d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Library/ExternalSubscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,20 @@ public static ExternalSubscription Get(string uuid)

return statusCode == HttpStatusCode.NotFound ? null : externalSubscription;
}

public static ExternalSubscription GetByExternalId(string externalId)
{
if (string.IsNullOrWhiteSpace(externalId))
{
return null;
}
var externalSubscription = new ExternalSubscription();
var statusCode = Client.Instance.PerformRequest(Client.HttpRequestMethod.Get,
ExternalSubscription.UrlPrefix + Uri.EscapeDataString("external-id-"+externalId),
externalSubscription.ReadXml);

return statusCode == HttpStatusCode.NotFound ? null : externalSubscription;
}
/// <summary>
/// Returns a list of external_invoices for this external subscription
/// </summary>
Expand Down

0 comments on commit 69dcc8d

Please sign in to comment.