Skip to content

Commit

Permalink
Release 0.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jul 1, 2024
1 parent 90558ff commit fd91796
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 27 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", "{67C0D593-904A-4386-B4BB-82E8CBCB10BC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client", "Mercoa.Client\Mercoa.Client.csproj", "{BE8670D2-2CF2-4965-93ED-046949573437}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client.Test", "Mercoa.Client.Test\Mercoa.Client.Test.csproj", "{206F048D-00B8-494A-8C03-8C6CD9482A28}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercoa.Client.Test", "Mercoa.Client.Test\Mercoa.Client.Test.csproj", "{32AB4319-46E4-472F-9F93-41785194F553}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -16,13 +16,13 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{67C0D593-904A-4386-B4BB-82E8CBCB10BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{67C0D593-904A-4386-B4BB-82E8CBCB10BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{67C0D593-904A-4386-B4BB-82E8CBCB10BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{67C0D593-904A-4386-B4BB-82E8CBCB10BC}.Release|Any CPU.Build.0 = Release|Any CPU
{206F048D-00B8-494A-8C03-8C6CD9482A28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{206F048D-00B8-494A-8C03-8C6CD9482A28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{206F048D-00B8-494A-8C03-8C6CD9482A28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{206F048D-00B8-494A-8C03-8C6CD9482A28}.Release|Any CPU.Build.0 = Release|Any CPU
{BE8670D2-2CF2-4965-93ED-046949573437}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE8670D2-2CF2-4965-93ED-046949573437}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE8670D2-2CF2-4965-93ED-046949573437}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE8670D2-2CF2-4965-93ED-046949573437}.Release|Any CPU.Build.0 = Release|Any CPU
{32AB4319-46E4-472F-9F93-41785194F553}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32AB4319-46E4-472F-9F93-41785194F553}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32AB4319-46E4-472F-9F93-41785194F553}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32AB4319-46E4-472F-9F93-41785194F553}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ CompleteMicroDepositsRequest request
}

/// <summary>
/// Get the available balance of a payment method. Only bank accounts added with Plaid are supported. This endpoint will return a cached value and will refresh the balance when called.
/// Deprecated. Get the available balance of a payment method. Only bank accounts added with Plaid are supported. This endpoint will return a cached value and will refresh the balance when called.
/// </summary>
public async Task<PaymentMethodBalanceResponse> GetBalanceAsync(string paymentMethodId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class InvoiceCreationRequest
public DateTime? InvoiceDate { get; init; }

/// <summary>
/// Date when funds will be deducted from payer's account.
/// Date when funds are scheduled to be deducted from payer's account.
/// </summary>
[JsonPropertyName("deductionDate")]
public DateTime? DeductionDate { get; init; }
Expand Down Expand Up @@ -129,4 +129,10 @@ public class InvoiceCreationRequest
/// </summary>
[JsonPropertyName("creatorUserId")]
public string? CreatorUserId { get; init; }

/// <summary>
/// If the invoice failed to be paid, indicate the failure reason. Only applicable for invoices with custom payment methods.
/// </summary>
[JsonPropertyName("failureType")]
public InvoiceFailureType? FailureType { get; init; }
}
8 changes: 7 additions & 1 deletion src/Mercoa.Client/InvoiceTypes/Types/InvoiceRequestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class InvoiceRequestBase
public DateTime? InvoiceDate { get; init; }

/// <summary>
/// Date when funds will be deducted from payer's account.
/// Date when funds are scheduled to be deducted from payer's account.
/// </summary>
[JsonPropertyName("deductionDate")]
public DateTime? DeductionDate { get; init; }
Expand Down Expand Up @@ -123,4 +123,10 @@ public class InvoiceRequestBase
/// </summary>
[JsonPropertyName("creatorUserId")]
public string? CreatorUserId { get; init; }

/// <summary>
/// If the invoice failed to be paid, indicate the failure reason. Only applicable for invoices with custom payment methods.
/// </summary>
[JsonPropertyName("failureType")]
public InvoiceFailureType? FailureType { get; init; }
}
11 changes: 7 additions & 4 deletions src/Mercoa.Client/InvoiceTypes/Types/InvoiceResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ public class InvoiceResponse
public DateTime? InvoiceDate { get; init; }

/// <summary>
/// Date when funds will be deducted from payer's account.
/// Date when funds are scheduled to be deducted from payer's account. The actual deduction date may differ from this date, and will be reflected in the processedAt field.
/// </summary>
[JsonPropertyName("deductionDate")]
public DateTime? DeductionDate { get; init; }

/// <summary>
/// Date when the invoice payment was processed.
/// </summary>
[JsonPropertyName("processedAt")]
public DateTime? ProcessedAt { get; init; }

/// <summary>
/// Date of funds settlement.
/// </summary>
Expand Down Expand Up @@ -142,9 +148,6 @@ public class InvoiceResponse
[JsonPropertyName("failureType")]
public InvoiceFailureType? FailureType { get; init; }

[JsonPropertyName("processedAt")]
public DateTime? ProcessedAt { get; init; }

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

Expand Down
8 changes: 7 additions & 1 deletion src/Mercoa.Client/InvoiceTypes/Types/InvoiceUpdateRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class InvoiceUpdateRequest
public DateTime? InvoiceDate { get; init; }

/// <summary>
/// Date when funds will be deducted from payer's account.
/// Date when funds are scheduled to be deducted from payer's account.
/// </summary>
[JsonPropertyName("deductionDate")]
public DateTime? DeductionDate { get; init; }
Expand Down Expand Up @@ -129,4 +129,10 @@ public class InvoiceUpdateRequest
/// </summary>
[JsonPropertyName("creatorUserId")]
public string? CreatorUserId { get; init; }

/// <summary>
/// If the invoice failed to be paid, indicate the failure reason. Only applicable for invoices with custom payment methods.
/// </summary>
[JsonPropertyName("failureType")]
public InvoiceFailureType? FailureType { get; init; }
}
2 changes: 1 addition & 1 deletion src/Mercoa.Client/Mercoa.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;net4.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<NuGetAudit>false</NuGetAudit>
<Version>0.4.2</Version>
<Version>0.4.3</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", "0.4.2" },
{ "X-Fern-SDK-Version", "0.4.3" },
},
clientOptions ?? new ClientOptions()
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;
using Mercoa.Client;
using Mercoa.Client.Core;

#nullable enable

namespace Mercoa.Client;

[JsonConverter(typeof(StringEnumSerializer<CustomPaymentMethodFeeType>))]
public enum CustomPaymentMethodFeeType
{
[EnumMember(Value = "none")]
None,

[EnumMember(Value = "flat")]
Flat,

[EnumMember(Value = "percentage")]
Percentage
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ public class CustomPaymentMethodRequest
[JsonPropertyName("accountNumber")]
public string? AccountNumber { get; init; }

/// <summary>
/// The available balance for this payment method.
/// </summary>
[JsonPropertyName("availableBalance")]
public double? AvailableBalance { get; init; }

/// <summary>
/// Payment method schema used for this payment method. Defines the fields that this payment method contains.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public class CustomPaymentMethodResponse
[JsonPropertyName("accountNumber")]
public string? AccountNumber { get; init; }

/// <summary>
/// The available balance for this payment method.
/// </summary>
[JsonPropertyName("availableBalance")]
public double? AvailableBalance { get; init; }

/// <summary>
/// Payment method schema used for this payment method. Defines the fields that this payment method contains.
/// </summary>
Expand Down
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 CustomPaymentMethodSchemaFee
{
[JsonPropertyName("type")]
public CustomPaymentMethodFeeType Type { get; init; }

/// <summary>
/// If type is 'flat', this is the flat amount that will be charged as a fee. For example, if the fee is $2.50, set this to 2.50. If type is 'percentage', this is the percentage of the payment amount that will be charged as a fee. For example, if the fee is 2.5%, set this to 2.5.
/// </summary>
[JsonPropertyName("amount")]
public double? Amount { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@ public enum CustomPaymentMethodSchemaFieldType
Url,

[EnumMember(Value = "address")]
Address
Address,

[EnumMember(Value = "usBankRoutingNumber")]
UsBankRoutingNumber,

[EnumMember(Value = "usBankAccountNumber")]
UsBankAccountNumber
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ public class CustomPaymentMethodSchemaRequest
[JsonPropertyName("isDestination")]
public bool IsDestination { get; init; }

/// <summary>
/// Estimated time in days for this payment method to process a payments. Set as 0 for same-day payment methods, -1 for unknown processing time.
/// </summary>
[JsonPropertyName("estimatedProcessingTime")]
public int? EstimatedProcessingTime { get; init; }

/// <summary>
/// List of currencies that this payment method supports. If not provided, the payment method will support only USD.
/// </summary>
Expand All @@ -36,4 +30,13 @@ public class CustomPaymentMethodSchemaRequest

[JsonPropertyName("fields")]
public IEnumerable<CustomPaymentMethodSchemaField> Fields { get; init; }

/// <summary>
/// Estimated time in days for this payment method to process a payments. Set as 0 for same-day payment methods, -1 for unknown processing time.
/// </summary>
[JsonPropertyName("estimatedProcessingTime")]
public int? EstimatedProcessingTime { get; init; }

[JsonPropertyName("fees")]
public CustomPaymentMethodSchemaFee? Fees { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public class CustomPaymentMethodSchemaResponse
[JsonPropertyName("estimatedProcessingTime")]
public int EstimatedProcessingTime { get; init; }

[JsonPropertyName("fees")]
public CustomPaymentMethodSchemaFee? Fees { get; init; }

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ public class CustomPaymentMethodUpdateRequest
[JsonPropertyName("accountNumber")]
public string? AccountNumber { get; init; }

/// <summary>
/// The available balance for this payment method.
/// </summary>
[JsonPropertyName("availableBalance")]
public double? AvailableBalance { get; init; }

/// <summary>
/// Payment method schema used for this payment method. Defines the fields that this payment method contains.
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions src/Mercoa.Client/Webhooks/Types/PaymentMethodWebhook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ public class PaymentMethodWebhook

[JsonPropertyName("paymentMethod")]
public PaymentMethodResponse PaymentMethod { get; init; }

[JsonPropertyName("entity")]
public EntityResponse Entity { get; init; }
}

0 comments on commit fd91796

Please sign in to comment.