Skip to content

Commit

Permalink
Release 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jun 14, 2024
1 parent 6617bc0 commit 9de0c76
Show file tree
Hide file tree
Showing 20 changed files with 149 additions and 19 deletions.
20 changes: 10 additions & 10 deletions src/Mercoa.Client.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client", "Mercoa.Client\Mercoa.Client.csproj", "{7C9210B3-D407-49E2-A975-4D0F81660364}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client", "Mercoa.Client\Mercoa.Client.csproj", "{758C2339-4466-42A3-B3D9-2821FD9F84AC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client.Test", "Mercoa.Client.Test\Mercoa.Client.Test.csproj", "{A93E5378-6554-488E-A24C-906EEC952AF9}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client.Test", "Mercoa.Client.Test\Mercoa.Client.Test.csproj", "{F2BBED25-0EE5-4D4C-9807-170C23BB66BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -16,13 +16,13 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7C9210B3-D407-49E2-A975-4D0F81660364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7C9210B3-D407-49E2-A975-4D0F81660364}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C9210B3-D407-49E2-A975-4D0F81660364}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7C9210B3-D407-49E2-A975-4D0F81660364}.Release|Any CPU.Build.0 = Release|Any CPU
{A93E5378-6554-488E-A24C-906EEC952AF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A93E5378-6554-488E-A24C-906EEC952AF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A93E5378-6554-488E-A24C-906EEC952AF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A93E5378-6554-488E-A24C-906EEC952AF9}.Release|Any CPU.Build.0 = Release|Any CPU
{758C2339-4466-42A3-B3D9-2821FD9F84AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{758C2339-4466-42A3-B3D9-2821FD9F84AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{758C2339-4466-42A3-B3D9-2821FD9F84AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{758C2339-4466-42A3-B3D9-2821FD9F84AC}.Release|Any CPU.Build.0 = Release|Any CPU
{F2BBED25-0EE5-4D4C-9807-170C23BB66BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2BBED25-0EE5-4D4C-9807-170C23BB66BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2BBED25-0EE5-4D4C-9807-170C23BB66BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2BBED25-0EE5-4D4C-9807-170C23BB66BE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
8 changes: 8 additions & 0 deletions src/Mercoa.Client/Entity/Counterparty/CounterpartyClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ FindPayeeCounterpartiesRequest request
{
_query["invoiceMetrics"] = request.InvoiceMetrics;
}
if (request.Logo != null)
{
_query["logo"] = request.Logo;
}
if (request.CounterpartyId != null)
{
_query["counterpartyId"] = request.CounterpartyId;
Expand Down Expand Up @@ -91,6 +95,10 @@ FindPayorCounterpartiesRequest request
{
_query["invoiceMetrics"] = request.InvoiceMetrics;
}
if (request.Logo != null)
{
_query["logo"] = request.Logo;
}
if (request.CounterpartyId != null)
{
_query["counterpartyId"] = request.CounterpartyId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public class FindPayeeCounterpartiesRequest
/// </summary>
public bool? InvoiceMetrics { get; init; }

/// <summary>
/// If true, will include counterparty logo as part of the response
/// </summary>
public bool? Logo { get; init; }

/// <summary>
/// Filter by counterparty ids
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public class FindPayorCounterpartiesRequest
/// </summary>
public bool? InvoiceMetrics { get; init; }

/// <summary>
/// If true, will include counterparty logo as part of the response
/// </summary>
public bool? Logo { get; init; }

/// <summary>
/// Filter by counterparty ids
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions src/Mercoa.Client/Entity/EntityClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ public async Task<EntityResponse> UpdateAsync(string entityId, EntityUpdateReque
throw new Exception(responseBody);
}

/// <summary>
/// Will archive the entity. This action cannot be undone, and the entity will no longer be available for use.
/// </summary>
public async void DeleteAsync(string entityId)
{
var response = await _client.MakeRequestAsync(
Expand Down
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 CounterpartyCustomizationRequest
{
[JsonPropertyName("counterpartyId")]
public string CounterpartyId { get; init; }

/// <summary>
/// The ID the counterparty has assigned to this account.
/// </summary>
[JsonPropertyName("accountId")]
public string? AccountId { get; init; }
}
28 changes: 26 additions & 2 deletions src/Mercoa.Client/EntityTypes/Types/CounterpartyResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@ namespace Mercoa.Client;

public class CounterpartyResponse
{
/// <summary>
/// If the entity searching for counterparties has an Account ID configured in the Payee/Payor relationship, it will be returned
/// </summary>
[JsonPropertyName("accountId")]
public string? AccountId { get; init; }

/// <summary>
/// URL to the entity logo
/// </summary>
[JsonPropertyName("logo")]
public string? Logo { get; init; }

[JsonPropertyName("paymentMethods")]
public IEnumerable<PaymentMethodResponse> PaymentMethods { get; init; }
public IEnumerable<PaymentMethodResponse>? PaymentMethods { get; init; }

[JsonPropertyName("counterpartyType")]
public IEnumerable<CounterpartyNetworkType> CounterpartyType { get; init; }
public IEnumerable<CounterpartyNetworkType>? CounterpartyType { get; init; }

[JsonPropertyName("invoiceMetrics")]
public CounterpartyInvoiceMetricsResponse? InvoiceMetrics { get; init; }
Expand Down Expand Up @@ -76,6 +88,18 @@ public class CounterpartyResponse
[JsonPropertyName("isPayee")]
public bool IsPayee { get; init; }

/// <summary>
/// True if this entity is available as a payor to any entity on your platform. Otherwise this entity will only be available as a payor to entities that have a direct relationship with this entity.
/// </summary>
[JsonPropertyName("isNetworkPayor")]
public bool IsNetworkPayor { get; init; }

/// <summary>
/// True if this entity is available as a payee to any entity on your platform. Otherwise this entity will only be available as a payee to entities that have a direct relationship with this entity.
/// </summary>
[JsonPropertyName("isNetworkPayee")]
public bool IsNetworkPayee { get; init; }

[JsonPropertyName("createdAt")]
public DateTime CreatedAt { get; init; }

Expand Down
7 changes: 7 additions & 0 deletions src/Mercoa.Client/EntityTypes/Types/EntityAddPayeesRequest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
using Mercoa.Client;

#nullable enable

Expand All @@ -11,4 +12,10 @@ public class EntityAddPayeesRequest
/// </summary>
[JsonPropertyName("payees")]
public IEnumerable<string> Payees { get; init; }

/// <summary>
/// List of customizations to apply to the payees. If the payee is not currently a counterparty of the entity, the counterparty will be created with the provided customizations.
/// </summary>
[JsonPropertyName("customizations")]
public IEnumerable<CounterpartyCustomizationRequest>? Customizations { get; init; }
}
7 changes: 7 additions & 0 deletions src/Mercoa.Client/EntityTypes/Types/EntityAddPayorsRequest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
using Mercoa.Client;

#nullable enable

Expand All @@ -11,4 +12,10 @@ public class EntityAddPayorsRequest
/// </summary>
[JsonPropertyName("payors")]
public IEnumerable<string> Payors { get; init; }

/// <summary>
/// List of customizations to apply to the payors. If the payor is not currently a counterparty of the entity, the counterparty will be created with the provided customizations.
/// </summary>
[JsonPropertyName("customizations")]
public IEnumerable<CounterpartyCustomizationRequest>? Customizations { get; init; }
}
12 changes: 12 additions & 0 deletions src/Mercoa.Client/EntityTypes/Types/EntityRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ public class EntityRequest
[JsonPropertyName("isPayee")]
public bool IsPayee { get; init; }

/// <summary>
/// Control if this entity should be available as a payor to any entity on your platform. If set to false, this entity will only be available as a payor to entities that have a direct relationship with this entity. Defaults to false.
/// </summary>
[JsonPropertyName("isNetworkPayor")]
public bool? IsNetworkPayor { get; init; }

/// <summary>
/// Control if this entity should be available as a payee to any entity on your platform. If set to false, this entity will only be available as a payee to entities that have a direct relationship with this entity. Defaults to false.
/// </summary>
[JsonPropertyName("isNetworkPayee")]
public bool? IsNetworkPayee { get; init; }

/// <summary>
/// Base64 encoded PNG image data for the entity logo.
/// </summary>
Expand Down
12 changes: 12 additions & 0 deletions src/Mercoa.Client/EntityTypes/Types/EntityResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ public class EntityResponse
[JsonPropertyName("isPayee")]
public bool IsPayee { get; init; }

/// <summary>
/// True if this entity is available as a payor to any entity on your platform. Otherwise this entity will only be available as a payor to entities that have a direct relationship with this entity.
/// </summary>
[JsonPropertyName("isNetworkPayor")]
public bool IsNetworkPayor { get; init; }

/// <summary>
/// True if this entity is available as a payee to any entity on your platform. Otherwise this entity will only be available as a payee to entities that have a direct relationship with this entity.
/// </summary>
[JsonPropertyName("isNetworkPayee")]
public bool IsNetworkPayee { get; init; }

[JsonPropertyName("createdAt")]
public DateTime CreatedAt { get; init; }

Expand Down
12 changes: 12 additions & 0 deletions src/Mercoa.Client/EntityTypes/Types/EntityUpdateRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ public class EntityUpdateRequest
[JsonPropertyName("isPayee")]
public bool? IsPayee { get; init; }

/// <summary>
/// Control if this entity should be available as a payor to any entity on your platform. If set to false, this entity will only be available as a payor to entities that have a direct relationship with this entity. Defaults to false.
/// </summary>
[JsonPropertyName("isNetworkPayor")]
public bool? IsNetworkPayor { get; init; }

/// <summary>
/// Control if this entity should be available as a payee to any entity on your platform. If set to false, this entity will only be available as a payee to entities that have a direct relationship with this entity. Defaults to false.
/// </summary>
[JsonPropertyName("isNetworkPayee")]
public bool? IsNetworkPayee { get; init; }

/// <summary>
/// Base64 encoded PNG image data for the entity logo.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ public class EntityWithPaymentMethodResponse
[JsonPropertyName("isPayee")]
public bool IsPayee { get; init; }

/// <summary>
/// True if this entity is available as a payor to any entity on your platform. Otherwise this entity will only be available as a payor to entities that have a direct relationship with this entity.
/// </summary>
[JsonPropertyName("isNetworkPayor")]
public bool IsNetworkPayor { get; init; }

/// <summary>
/// True if this entity is available as a payee to any entity on your platform. Otherwise this entity will only be available as a payee to entities that have a direct relationship with this entity.
/// </summary>
[JsonPropertyName("isNetworkPayee")]
public bool IsNetworkPayee { get; init; }

[JsonPropertyName("createdAt")]
public DateTime CreatedAt { get; init; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class BankAccountPaymentDestinationOptions
public BankDeliveryMethod? Delivery { get; init; }

/// <summary>
/// ACH Statement Description. By default, this will be 'AP' followed by the first 8 characters of the invoice ID. Must be at least 4 characters and no more than 10 characters, and follow this regex pattern ^[a-zA-Z0-9\-#.$&*]{4,10}$
/// ACH Statement Description. By default, this will be 'AP' followed by the first 8 characters of the invoice ID. Must be at least 4 characters and no more than 10 characters, and follow this regex pattern ^[a-zA-Z0-9\-#.$&* ]{4,10}$
/// </summary>
[JsonPropertyName("description")]
public string? Description { get; init; }
Expand Down
4 changes: 2 additions & 2 deletions src/Mercoa.Client/InvoiceTypes/Types/InvoiceResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class InvoiceResponse
public string? PayerId { get; init; }

[JsonPropertyName("payer")]
public EntityResponse? Payer { get; init; }
public CounterpartyResponse? Payer { get; init; }

[JsonPropertyName("paymentSource")]
public PaymentMethodResponse? PaymentSource { get; init; }
Expand All @@ -77,7 +77,7 @@ public class InvoiceResponse
public string? VendorId { get; init; }

[JsonPropertyName("vendor")]
public EntityResponse? Vendor { get; init; }
public CounterpartyResponse? Vendor { get; init; }

[JsonPropertyName("paymentDestination")]
public PaymentMethodResponse? PaymentDestination { get; init; }
Expand Down
4 changes: 2 additions & 2 deletions src/Mercoa.Client/Mercoa.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;net4.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<NuGetAudit>false</NuGetAudit>
<Version>v0.3.39</Version>
<Version>0.4.0</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/mercoa-finance/csharp</PackageProjectUrl>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Mercoa.Client/Mercoa.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public Mercoa(string token = null, ClientOptions clientOptions = null)
{ "Authorization", $"Bearer {token}" },
{ "X-Fern-Language", "C#" },
{ "X-Fern-SDK-Name", "Mercoa.Client" },
{ "X-Fern-SDK-Version", "v0.3.39" },
{ "X-Fern-SDK-Version", "0.4.0" },
},
clientOptions ?? new ClientOptions()
);
Expand Down
2 changes: 1 addition & 1 deletion src/Mercoa.Client/Ocr/Types/OcrResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class OcrResponse
public InvoiceResponse Invoice { get; init; }

[JsonPropertyName("vendor")]
public EntityResponse Vendor { get; init; }
public CounterpartyResponse Vendor { get; init; }

[JsonPropertyName("check")]
public CheckResponse? Check { get; init; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ public class ColorSchemeRequest

[JsonPropertyName("logoBackgroundColor")]
public string? LogoBackgroundColor { get; init; }

[JsonPropertyName("roundedCorners")]
public int? RoundedCorners { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ public class ColorSchemeResponse

[JsonPropertyName("logoBackgroundColor")]
public string? LogoBackgroundColor { get; init; }

[JsonPropertyName("roundedCorners")]
public int? RoundedCorners { get; init; }
}

0 comments on commit 9de0c76

Please sign in to comment.