-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove the optional retryPolicy parameter from AddMollieApi (#356) * Enable nullable references in Mollie.Api project (#346) * Upgrade language version to 12 * Enable nullable references * Add PolySharp so we can use required and init keyword * Change all models from class to record * Increase version number to 4.0.0 * Remove empty IResponseObject interface, as we don't need it * Fix editorconfig warnings (#358) * Fix editorconfig errors * Fix build warnings * Remove "this." from codebase * Fixing build editor suggestions * Enable nullable references in Blazor project * Fix more editor config issues * WIP: Use ModelName -> Request/Response namespaces everywhere * Use ModelName -> Request/Response namespaces everywhere * Remove unused using statements * Fix null reference issues * 11 warnings to go * Add more XML comments and fix all editorconfig warnings * Fix unit test * Standardize client and method names (#359) * Rename DeletePayment to CancelPayment in PaymentClient * Move the "Create order refund" method and the "List order refunds" methods from the OrderClient to the RefundClient * Rename GetChargebacksListAsync to GetChargebackListAsync for consistency * Rename GetCapturesListAsync to GetCaptureListAsync * Rename GetShipmentsListAsync to GetShipmentListAsync * Rename GetOrganizationsListAsync to GetOrganizationListAsync * Rename ListBalanceTransactionsAsync to GetBalanceTransactionListAsync Rename ListPrimaryBalanceTransactionsAsync to GetPrimaryBalanceTransactionListAsync Rename ListBalancesAsync to GetBalanceListAsync * Standardize method names in ISettlementsClient * Standardize client names, all clientnames are now singular * Standardize API names in readme * Allow null values for the Amount property in PaymentLinkRequest (#360) * Replace init with set in all models (#363) * Use { get; set; } everywhere instead of { get; init; } so we can continue to support lower C# language versions * Create payment specific mandate response types (#364) * Add payment specific response methods in mandate api * Create Json converter to parse mandate payment specific responses * Generate a new PaypalBillingAgreementId every time the CanCreatePayPalMandate integration test runs * Remove PayPal integration test, it is not supported on our account * Update GetBalanceTransactionListAsync and GetPrimaryBalanceTransactionListAsync methods to use a ListResponse instead of a custom type (#365) * #362 Update GetBalanceTransactionListAsync and GetPrimaryBalanceTransactionListAsync methods to use a ListResponse instead of a custom type * #362 Add GetBalanceTransactionListAsync method to retrieve a list of balance transactions by URL * Fix CanCreateSpecificPaymentType integration test * Fix issue where Links property of PaymentResponse would be null for BankTransferPaymentResponse --------- Co-authored-by: Gerard Gunnewijk <[email protected]>
- Loading branch information
1 parent
25d4459
commit 2417d09
Showing
350 changed files
with
4,554 additions
and
4,226 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
10 changes: 6 additions & 4 deletions
10
samples/Mollie.WebApplication.Blazor/Framework/StaticStringListBuilder.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 |
---|---|---|
@@ -1,12 +1,14 @@ | ||
using System.Reflection; | ||
|
||
namespace Mollie.WebApplication.Blazor.Framework; | ||
namespace Mollie.WebApplication.Blazor.Framework; | ||
|
||
public static class StaticStringListBuilder { | ||
public static IEnumerable<string> GetStaticStringList(Type type) { | ||
foreach (FieldInfo fieldInfo in type.GetFields(BindingFlags.Static | BindingFlags.Public)) { | ||
string value = fieldInfo.GetValue(null).ToString(); | ||
yield return value; | ||
string? value = fieldInfo.GetValue(null)?.ToString(); | ||
if (value != null) { | ||
yield return value; | ||
} | ||
} | ||
} | ||
} | ||
} |
18 changes: 11 additions & 7 deletions
18
samples/Mollie.WebApplication.Blazor/Framework/Validators/DecimalPlacesAttribute.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
12 changes: 6 additions & 6 deletions
12
samples/Mollie.WebApplication.Blazor/Framework/Validators/StaticStringListAttribute.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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Reflection; | ||
|
||
namespace Mollie.WebApplication.Blazor.Framework.Validators; | ||
namespace Mollie.WebApplication.Blazor.Framework.Validators; | ||
|
||
public class StaticStringListAttribute : ValidationAttribute { | ||
private readonly Type _staticClass; | ||
|
||
public StaticStringListAttribute(Type staticClass) { | ||
this._staticClass = staticClass; | ||
_staticClass = staticClass; | ||
} | ||
|
||
protected override ValidationResult IsValid(object value, ValidationContext validationContext) { | ||
IEnumerable<string> validValues = this._staticClass | ||
protected override ValidationResult? IsValid(object? value, ValidationContext validationContext) { | ||
IEnumerable<string?> validValues = _staticClass | ||
.GetFields(BindingFlags.Static | BindingFlags.Public) | ||
.Select(x => x.GetValue(null).ToString()); | ||
.Select(x => x.GetValue(null)?.ToString()); | ||
|
||
if (validValues.Contains(value)) { | ||
return ValidationResult.Success; | ||
} | ||
|
||
return new ValidationResult($"The value \"{value}\" is invalid"); | ||
} | ||
} |
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
10 changes: 5 additions & 5 deletions
10
samples/Mollie.WebApplication.Blazor/Models/Mandate/CreateMandateModel.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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Mollie.WebApplication.Blazor.Models.Mandate; | ||
namespace Mollie.WebApplication.Blazor.Models.Mandate; | ||
|
||
public class CreateMandateModel { | ||
[Required] | ||
public string ConsumerName { get; set; } | ||
public required string ConsumerName { get; set; } | ||
|
||
[Required] | ||
public string ConsumerAccount { get; set; } | ||
} | ||
public required string ConsumerAccount { get; set; } | ||
} |
30 changes: 15 additions & 15 deletions
30
samples/Mollie.WebApplication.Blazor/Models/Order/CreateOrderBillingAddressModel.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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Mollie.WebApplication.Blazor.Models.Order; | ||
namespace Mollie.WebApplication.Blazor.Models.Order; | ||
|
||
public class CreateOrderBillingAddressModel { | ||
[Required] | ||
public string GivenName { get; set; } | ||
public required string GivenName { get; set; } | ||
|
||
[Required] | ||
public string FamilyName { get; set; } | ||
public required string FamilyName { get; set; } | ||
|
||
[Required] | ||
[EmailAddress] | ||
public string Email { get; set; } | ||
public required string Email { get; set; } | ||
|
||
[Required] | ||
public string StreetAndNumber { get; set; } | ||
public required string StreetAndNumber { get; set; } | ||
|
||
[Required] | ||
public string City { get; set; } | ||
public required string City { get; set; } | ||
|
||
[Required] | ||
[MaxLength(2)] | ||
public string Country { get; set; } | ||
public required string Country { get; set; } | ||
|
||
[Required] | ||
public string PostalCode { get; set; } | ||
} | ||
public required string PostalCode { get; set; } | ||
} |
12 changes: 6 additions & 6 deletions
12
samples/Mollie.WebApplication.Blazor/Models/Order/CreateOrderLineModel.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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using Mollie.WebApplication.Blazor.Framework.Validators; | ||
|
||
namespace Mollie.WebApplication.Blazor.Models.Order; | ||
namespace Mollie.WebApplication.Blazor.Models.Order; | ||
|
||
public class CreateOrderLineModel { | ||
[Required] | ||
public string Name { get; set; } | ||
public string Name { get; set; } = string.Empty; | ||
|
||
[Required] | ||
[Range(1, 100, ErrorMessage = "Please enter a quantity between 0.01 and 1000")] | ||
public int Quantity { get; set; } | ||
|
||
[Required] | ||
[Range(0.01, 10000, ErrorMessage = "Please enter a unit price between 0.01 and 10000")] | ||
[DecimalPlaces(2)] | ||
public decimal UnitPrice { get; set; } | ||
|
||
public decimal TotalAmount { get; set; } | ||
|
||
[Range(0.01, 100, ErrorMessage = "Please enter a vat rate between 0.01 and 100")] | ||
[DecimalPlaces(2)] | ||
public decimal VatRate { get; set; } | ||
public decimal VatAmount { get; set; } | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
@using Mollie.WebApplication.Blazor.Models.Customer | ||
@using Mollie.Api.Client | ||
@using Mollie.Api.Models.Customer.Request | ||
|
||
@inject ICustomerClient CustomerClient | ||
@inject NavigationManager NavigationManager | ||
|
@@ -36,17 +37,17 @@ | |
</EditForm> | ||
|
||
@code { | ||
private MollieApiException _apiException = null; | ||
private MollieApiException? _apiException; | ||
|
||
private CreateCustomerModel _customer = new() { | ||
Name = "Customer name", | ||
Email = "[email protected]" | ||
}; | ||
|
||
private async Task OnSave() { | ||
try { | ||
_apiException = null; | ||
|
||
await CustomerClient.CreateCustomerAsync(new CustomerRequest() { | ||
Name = _customer.Name, | ||
Email = _customer.Email | ||
|
@@ -58,4 +59,4 @@ | |
_apiException = e; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.