diff --git a/README.md b/README.md
index c2fe13bb..8dec75c8 100644
--- a/README.md
+++ b/README.md
@@ -49,21 +49,21 @@ Source: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-s
## Supported API's
This library currently supports the following API's:
-- Payments API
+- Payment API
- PaymentMethod API
- PaymentLink API
-- Customers API
-- Mandates API
-- Subscriptions API
+- Customer API
+- Mandate API
+- Subscription API
- Refund API
- Connect API
-- Chargebacks API
-- Invoices API
+- Chargeback API
+- Invoice API
- Permissions API
-- Profiles API
+- Profile API
- Organizations API
- Order API
-- Captures API
+- Capture API
- Onboarding API
- Balances API
- Terminal API
diff --git a/src/Mollie.Api/Client/Abstract/IBalanceClient.cs b/src/Mollie.Api/Client/Abstract/IBalanceClient.cs
index 2b5d7539..6df4ec69 100644
--- a/src/Mollie.Api/Client/Abstract/IBalanceClient.cs
+++ b/src/Mollie.Api/Client/Abstract/IBalanceClient.cs
@@ -38,14 +38,14 @@ public interface IBalanceClient : IBaseMollieClient {
/// Currency filter that will make it so only balances in given currency are returned.
/// For example EUR.
///
- Task> ListBalancesAsync(string? from = null, int? limit = null, string? currency = null);
+ Task> GetBalanceListAsync(string? from = null, int? limit = null, string? currency = null);
///
/// Retrieve all the organization’s balances by URL
///
/// The URL of the balance objects
///
- Task> ListBalancesAsync(UrlObjectLink> url);
+ Task> GetBalanceListAsync(UrlObjectLink> url);
///
/// With the Get balance report endpoint you can retrieve a summarized report for all movements on a given
@@ -87,7 +87,7 @@ public interface IBalanceClient : IBaseMollieClient {
/// with this ID is included in the result set as well.
/// The number of balance transactions to return (with a maximum of 250).
///
- Task ListBalanceTransactionsAsync(string balanceId, string? from = null, int? limit = null);
+ Task GetBalanceTransactionListAsync(string balanceId, string? from = null, int? limit = null);
///
/// With the List primary balance transactions endpoint you can retrieve a list of all the movements on your
@@ -97,6 +97,6 @@ public interface IBalanceClient : IBaseMollieClient {
/// with this ID is included in the result set as well.
/// The number of balance transactions to return (with a maximum of 250).
///
- Task ListPrimaryBalanceTransactionsAsync(string? from = null, int? limit = null);
+ Task GetPrimaryBalanceTransactionListAsync(string? from = null, int? limit = null);
}
}
diff --git a/src/Mollie.Api/Client/Abstract/ICaptureClient.cs b/src/Mollie.Api/Client/Abstract/ICaptureClient.cs
index d62a4e63..da0623a0 100644
--- a/src/Mollie.Api/Client/Abstract/ICaptureClient.cs
+++ b/src/Mollie.Api/Client/Abstract/ICaptureClient.cs
@@ -8,8 +8,8 @@ namespace Mollie.Api.Client.Abstract {
public interface ICaptureClient : IBaseMollieClient {
Task GetCaptureAsync(string paymentId, string captureId, bool testmode = false);
Task GetCaptureAsync(UrlObjectLink url);
- Task> GetCapturesListAsync(string paymentId, bool testmode = false);
- Task> GetCapturesListAsync(UrlObjectLink> url);
+ Task> GetCaptureListAsync(string paymentId, bool testmode = false);
+ Task> GetCaptureListAsync(UrlObjectLink> url);
Task CreateCapture(string paymentId, CaptureRequest captureRequest, bool testmode = false);
}
}
diff --git a/src/Mollie.Api/Client/Abstract/IChargebackClient.cs b/src/Mollie.Api/Client/Abstract/IChargebackClient.cs
new file mode 100644
index 00000000..12111f09
--- /dev/null
+++ b/src/Mollie.Api/Client/Abstract/IChargebackClient.cs
@@ -0,0 +1,13 @@
+using System.Threading.Tasks;
+using Mollie.Api.Models.Chargeback.Response;
+using Mollie.Api.Models.List.Response;
+using Mollie.Api.Models.Url;
+
+namespace Mollie.Api.Client.Abstract {
+ public interface IChargebackClient : IBaseMollieClient {
+ Task GetChargebackAsync(string paymentId, string chargebackId, bool testmode = false);
+ Task> GetChargebackListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false);
+ Task> GetChargebackListAsync(string? profileId = null, bool testmode = false);
+ Task> GetChargebackListAsync(UrlObjectLink> url);
+ }
+}
diff --git a/src/Mollie.Api/Client/Abstract/IChargebacksClient.cs b/src/Mollie.Api/Client/Abstract/IChargebacksClient.cs
deleted file mode 100644
index 7f14b1f1..00000000
--- a/src/Mollie.Api/Client/Abstract/IChargebacksClient.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System.Threading.Tasks;
-using Mollie.Api.Models.Chargeback.Response;
-using Mollie.Api.Models.List.Response;
-using Mollie.Api.Models.Url;
-
-namespace Mollie.Api.Client.Abstract {
- public interface IChargebacksClient : IBaseMollieClient {
- Task GetChargebackAsync(string paymentId, string chargebackId, bool testmode = false);
- Task> GetChargebacksListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false);
- Task> GetChargebacksListAsync(string? profileId = null, bool testmode = false);
- Task> GetChargebacksListAsync(UrlObjectLink> url);
- }
-}
diff --git a/src/Mollie.Api/Client/Abstract/IInvoicesClient.cs b/src/Mollie.Api/Client/Abstract/IInvoiceClient.cs
similarity index 91%
rename from src/Mollie.Api/Client/Abstract/IInvoicesClient.cs
rename to src/Mollie.Api/Client/Abstract/IInvoiceClient.cs
index 3d6d487d..72d9ab80 100644
--- a/src/Mollie.Api/Client/Abstract/IInvoicesClient.cs
+++ b/src/Mollie.Api/Client/Abstract/IInvoiceClient.cs
@@ -4,7 +4,7 @@
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client.Abstract {
- public interface IInvoicesClient : IBaseMollieClient {
+ public interface IInvoiceClient : IBaseMollieClient {
Task GetInvoiceAsync(string invoiceId);
Task GetInvoiceAsync(UrlObjectLink url);
Task> GetInvoiceListAsync(
diff --git a/src/Mollie.Api/Client/Abstract/IOrderClient.cs b/src/Mollie.Api/Client/Abstract/IOrderClient.cs
index c5c3f9a6..c2f730c0 100644
--- a/src/Mollie.Api/Client/Abstract/IOrderClient.cs
+++ b/src/Mollie.Api/Client/Abstract/IOrderClient.cs
@@ -5,7 +5,6 @@
using Mollie.Api.Models.Order.Request.ManageOrderLines;
using Mollie.Api.Models.Order.Response;
using Mollie.Api.Models.Payment.Response;
-using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client.Abstract {
@@ -22,8 +21,5 @@ Task> GetOrderListAsync(
Task> GetOrderListAsync(UrlObjectLink> url);
Task CancelOrderLinesAsync(string orderId, OrderLineCancellationRequest cancelationRequest);
Task CreateOrderPaymentAsync(string orderId, OrderPaymentRequest createOrderPaymentRequest);
- Task CreateOrderRefundAsync(string orderId, OrderRefundRequest createOrderRefundRequest);
- Task> GetOrderRefundListAsync(
- string orderId, string? from = null, int? limit = null, bool testmode = false);
}
}
diff --git a/src/Mollie.Api/Client/Abstract/IOrganizationsClient.cs b/src/Mollie.Api/Client/Abstract/IOrganizationClient.cs
similarity index 75%
rename from src/Mollie.Api/Client/Abstract/IOrganizationsClient.cs
rename to src/Mollie.Api/Client/Abstract/IOrganizationClient.cs
index 7d23efd4..07c8baaf 100644
--- a/src/Mollie.Api/Client/Abstract/IOrganizationsClient.cs
+++ b/src/Mollie.Api/Client/Abstract/IOrganizationClient.cs
@@ -4,11 +4,11 @@
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client.Abstract {
- public interface IOrganizationsClient : IBaseMollieClient {
+ public interface IOrganizationClient : IBaseMollieClient {
Task GetCurrentOrganizationAsync();
Task GetOrganizationAsync(string organizationId);
- Task> GetOrganizationsListAsync(string? from = null, int? limit = null);
- Task> GetOrganizationsListAsync(UrlObjectLink> url);
+ Task> GetOrganizationListAsync(string? from = null, int? limit = null);
+ Task> GetOrganizationListAsync(UrlObjectLink> url);
Task GetOrganizationAsync(UrlObjectLink url);
}
}
diff --git a/src/Mollie.Api/Client/Abstract/IPaymentClient.cs b/src/Mollie.Api/Client/Abstract/IPaymentClient.cs
index 07fea5d7..484cc7be 100644
--- a/src/Mollie.Api/Client/Abstract/IPaymentClient.cs
+++ b/src/Mollie.Api/Client/Abstract/IPaymentClient.cs
@@ -38,7 +38,7 @@ Task GetPaymentAsync(
///
/// Oauth - Optional – Set this to true to cancel a test mode payment.
///
- Task DeletePaymentAsync(string paymentId, bool testmode = false);
+ Task CancelPaymentAsync(string paymentId, bool testmode = false);
///
/// Retrieve all payments created with the current payment profile, ordered from newest to oldest.
diff --git a/src/Mollie.Api/Client/Abstract/IPermissionsClient.cs b/src/Mollie.Api/Client/Abstract/IPermissionClient.cs
similarity index 87%
rename from src/Mollie.Api/Client/Abstract/IPermissionsClient.cs
rename to src/Mollie.Api/Client/Abstract/IPermissionClient.cs
index 10129161..3869a16b 100644
--- a/src/Mollie.Api/Client/Abstract/IPermissionsClient.cs
+++ b/src/Mollie.Api/Client/Abstract/IPermissionClient.cs
@@ -4,7 +4,7 @@
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client.Abstract {
- public interface IPermissionsClient : IBaseMollieClient {
+ public interface IPermissionClient : IBaseMollieClient {
Task GetPermissionAsync(string permissionId);
Task GetPermissionAsync(UrlObjectLink url);
Task> GetPermissionListAsync();
diff --git a/src/Mollie.Api/Client/Abstract/IRefundClient.cs b/src/Mollie.Api/Client/Abstract/IRefundClient.cs
index 0e629262..56ca98ec 100644
--- a/src/Mollie.Api/Client/Abstract/IRefundClient.cs
+++ b/src/Mollie.Api/Client/Abstract/IRefundClient.cs
@@ -1,15 +1,19 @@
using System.Threading.Tasks;
using Mollie.Api.Models.List.Response;
+using Mollie.Api.Models.Order.Request;
+using Mollie.Api.Models.Order.Response;
using Mollie.Api.Models.Refund.Request;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client.Abstract {
public interface IRefundClient : IBaseMollieClient {
- Task CancelRefundAsync(string paymentId, string refundId, bool testmode = false);
- Task CreateRefundAsync(string paymentId, RefundRequest refundRequest);
- Task GetRefundAsync(string paymentId, string refundId, bool testmode = false);
- Task> GetRefundListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false);
+ Task CreatePaymentRefundAsync(string paymentId, RefundRequest refundRequest);
+ Task GetPaymentRefundAsync(string paymentId, string refundId, bool testmode = false);
+ Task CancelPaymentRefundAsync(string paymentId, string refundId, bool testmode = false);
+ Task> GetPaymentRefundListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false);
+ Task CreateOrderRefundAsync(string orderId, OrderRefundRequest createOrderRefundRequest);
+ Task> GetOrderRefundListAsync(string orderId, string? from = null, int? limit = null, bool testmode = false);
Task> GetRefundListAsync(UrlObjectLink> url);
Task GetRefundAsync(UrlObjectLink url);
}
diff --git a/src/Mollie.Api/Client/Abstract/ISettlementClient.cs b/src/Mollie.Api/Client/Abstract/ISettlementClient.cs
new file mode 100644
index 00000000..80f6d48a
--- /dev/null
+++ b/src/Mollie.Api/Client/Abstract/ISettlementClient.cs
@@ -0,0 +1,27 @@
+using System.Threading.Tasks;
+using Mollie.Api.Models.Capture.Response;
+using Mollie.Api.Models.Chargeback.Response;
+using Mollie.Api.Models.List.Response;
+using Mollie.Api.Models.Payment.Response;
+using Mollie.Api.Models.Refund.Response;
+using Mollie.Api.Models.Settlement.Response;
+using Mollie.Api.Models.Url;
+
+namespace Mollie.Api.Client.Abstract {
+ public interface ISettlementClient : IBaseMollieClient {
+ Task GetSettlementAsync(string settlementId);
+ Task GetNextSettlement();
+ Task GetOpenSettlement();
+ Task> GetSettlementListAsync(string? reference = null, string? from = null, int? limit = null);
+ Task> GetSettlementListAsync(UrlObjectLink> url);
+ Task> GetSettlementPaymentListAsync(string settlementId, string? from = null, int? limit = null);
+ Task> GetSettlementPaymentListAsync(UrlObjectLink> url);
+ Task> GetSettlementRefundListAsync(string settlementId, string? from = null, int? limit = null);
+ Task> GetSettlementRefundListAsync(UrlObjectLink> url);
+ Task> GetSettlementChargebackListAsync(string settlementId, string? from = null, int? limit = null);
+ Task> GetSettlementChargebackListAsync(UrlObjectLink> url);
+ Task> GetSettlementCaptureListAsync(string settlementId, string? offset = null, int? count = null);
+ Task> GetSettlementCaptureListAsync(UrlObjectLink> url);
+ Task GetSettlementAsync(UrlObjectLink url);
+ }
+}
diff --git a/src/Mollie.Api/Client/Abstract/ISettlementsClient.cs b/src/Mollie.Api/Client/Abstract/ISettlementsClient.cs
deleted file mode 100644
index cb44bffa..00000000
--- a/src/Mollie.Api/Client/Abstract/ISettlementsClient.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using System.Threading.Tasks;
-using Mollie.Api.Models.Capture.Response;
-using Mollie.Api.Models.Chargeback.Response;
-using Mollie.Api.Models.List.Response;
-using Mollie.Api.Models.Payment.Response;
-using Mollie.Api.Models.Refund.Response;
-using Mollie.Api.Models.Settlement.Response;
-using Mollie.Api.Models.Url;
-
-namespace Mollie.Api.Client.Abstract {
- public interface ISettlementsClient : IBaseMollieClient {
- Task GetSettlementAsync(string settlementId);
- Task GetNextSettlement();
- Task GetOpenSettlement();
- Task> GetSettlementsListAsync(string? reference = null, string? from = null, int? limit = null);
- Task> GetSettlementsListAsync(UrlObjectLink> url);
- Task> GetSettlementPaymentsListAsync(string settlementId, string? from = null, int? limit = null);
- Task> GetSettlementPaymentsListAsync(UrlObjectLink> url);
- Task> GetSettlementRefundsListAsync(string settlementId, string? from = null, int? limit = null);
- Task> GetSettlementRefundsListAsync(UrlObjectLink> url);
- Task> GetSettlementChargebacksListAsync(string settlementId, string? from = null, int? limit = null);
- Task> GetSettlementChargebacksListAsync(UrlObjectLink> url);
- Task> GetSettlementCapturesListAsync(string settlementId, string? offset = null, int? count = null);
- Task> GetSettlementCapturesListAsync(UrlObjectLink> url);
- Task GetSettlementAsync(UrlObjectLink url);
-
- [Obsolete("Use GetSettlementCapturesListAsync instead")]
- Task> ListSettlementCapturesAsync(string settlementId);
- }
-}
diff --git a/src/Mollie.Api/Client/Abstract/IShipmentClient.cs b/src/Mollie.Api/Client/Abstract/IShipmentClient.cs
index 9df71ab5..1af15f99 100644
--- a/src/Mollie.Api/Client/Abstract/IShipmentClient.cs
+++ b/src/Mollie.Api/Client/Abstract/IShipmentClient.cs
@@ -9,8 +9,8 @@ public interface IShipmentClient : IBaseMollieClient {
Task CreateShipmentAsync(string orderId, ShipmentRequest shipmentRequest);
Task GetShipmentAsync(string orderId, string shipmentId, bool testmode = false);
Task GetShipmentAsync(UrlObjectLink url);
- Task> GetShipmentsListAsync(string orderId, bool testmode = false);
- Task> GetShipmentsListAsync(UrlObjectLink> url);
+ Task> GetShipmentListAsync(string orderId, bool testmode = false);
+ Task> GetShipmentListAsync(UrlObjectLink> url);
Task UpdateShipmentAsync(string orderId, string shipmentId, ShipmentUpdateRequest shipmentUpdateRequest);
}
}
diff --git a/src/Mollie.Api/Client/BalanceClient.cs b/src/Mollie.Api/Client/BalanceClient.cs
index f9a98406..791b42d3 100644
--- a/src/Mollie.Api/Client/BalanceClient.cs
+++ b/src/Mollie.Api/Client/BalanceClient.cs
@@ -29,12 +29,12 @@ public async Task GetPrimaryBalanceAsync() {
return await GetAsync("balances/primary").ConfigureAwait(false);
}
- public async Task> ListBalancesAsync(string? from = null, int? limit = null, string? currency = null) {
+ public async Task> GetBalanceListAsync(string? from = null, int? limit = null, string? currency = null) {
var queryParameters = BuildListBalanceQueryParameters(currency);
return await GetListAsync>($"balances", from, limit, queryParameters).ConfigureAwait(false);
}
- public async Task> ListBalancesAsync(UrlObjectLink> url) {
+ public async Task> GetBalanceListAsync(UrlObjectLink> url) {
return await GetAsync(url).ConfigureAwait(false);
}
@@ -49,13 +49,13 @@ public async Task GetPrimaryBalanceReportAsync(DateTime f
return await GetAsync($"balances/primary/report{queryParameters.ToQueryString()}").ConfigureAwait(false);
}
- public async Task ListBalanceTransactionsAsync(string balanceId, string? from = null, int? limit = null) {
+ public async Task GetBalanceTransactionListAsync(string balanceId, string? from = null, int? limit = null) {
ValidateRequiredUrlParameter(nameof(balanceId), balanceId);
var queryParameters = BuildListBalanceTransactionsQueryParameters(from, limit);
return await GetAsync($"balances/{balanceId}/transactions{queryParameters.ToQueryString()}").ConfigureAwait(false);
}
- public async Task ListPrimaryBalanceTransactionsAsync(string? from = null, int? limit = null) {
+ public async Task GetPrimaryBalanceTransactionListAsync(string? from = null, int? limit = null) {
var queryParameters = BuildListBalanceTransactionsQueryParameters(from, limit);
return await GetAsync($"balances/primary/transactions{queryParameters.ToQueryString()}").ConfigureAwait(false);
}
diff --git a/src/Mollie.Api/Client/CaptureClient.cs b/src/Mollie.Api/Client/CaptureClient.cs
index c1cfecf3..bfcb5fb1 100644
--- a/src/Mollie.Api/Client/CaptureClient.cs
+++ b/src/Mollie.Api/Client/CaptureClient.cs
@@ -26,14 +26,14 @@ public async Task GetCaptureAsync(UrlObjectLink> GetCapturesListAsync(string paymentId, bool testmode = false) {
+ public async Task> GetCaptureListAsync(string paymentId, bool testmode = false) {
ValidateRequiredUrlParameter(nameof(paymentId), paymentId);
var queryParameters = BuildQueryParameters(testmode);
return await GetAsync>($"payments/{paymentId}/captures{queryParameters.ToQueryString()}")
.ConfigureAwait(false);
}
- public async Task> GetCapturesListAsync(UrlObjectLink> url) {
+ public async Task> GetCaptureListAsync(UrlObjectLink> url) {
return await GetAsync(url).ConfigureAwait(false);
}
diff --git a/src/Mollie.Api/Client/ChargebacksClient.cs b/src/Mollie.Api/Client/ChargebackClient.cs
similarity index 83%
rename from src/Mollie.Api/Client/ChargebacksClient.cs
rename to src/Mollie.Api/Client/ChargebackClient.cs
index d7c5d052..1e3ea12a 100644
--- a/src/Mollie.Api/Client/ChargebacksClient.cs
+++ b/src/Mollie.Api/Client/ChargebackClient.cs
@@ -8,8 +8,8 @@
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client {
- public class ChargebacksClient : BaseMollieClient, IChargebacksClient {
- public ChargebacksClient(string apiKey, HttpClient? httpClient = null) : base(apiKey, httpClient) {
+ public class ChargebackClient : BaseMollieClient, IChargebackClient {
+ public ChargebackClient(string apiKey, HttpClient? httpClient = null) : base(apiKey, httpClient) {
}
public async Task GetChargebackAsync(string paymentId, string chargebackId, bool testmode = false) {
@@ -20,7 +20,7 @@ public async Task GetChargebackAsync(string paymentId, strin
.ConfigureAwait(false);
}
- public async Task> GetChargebacksListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false) {
+ public async Task> GetChargebackListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false) {
ValidateRequiredUrlParameter(nameof(paymentId), paymentId);
var queryParameters = BuildQueryParameters(testmode);
return await this
@@ -28,12 +28,12 @@ public async Task> GetChargebacksListAsync(stri
.ConfigureAwait(false);
}
- public async Task> GetChargebacksListAsync(string? profileId = null, bool testmode = false) {
+ public async Task> GetChargebackListAsync(string? profileId = null, bool testmode = false) {
var queryParameters = BuildQueryParameters(profileId, testmode);
return await GetListAsync>($"chargebacks", null, null, queryParameters).ConfigureAwait(false);
}
- public async Task> GetChargebacksListAsync(UrlObjectLink> url) {
+ public async Task> GetChargebackListAsync(UrlObjectLink> url) {
return await GetAsync(url).ConfigureAwait(false);
}
diff --git a/src/Mollie.Api/Client/InvoicesClient.cs b/src/Mollie.Api/Client/InvoiceClient.cs
similarity index 88%
rename from src/Mollie.Api/Client/InvoicesClient.cs
rename to src/Mollie.Api/Client/InvoiceClient.cs
index ad560769..8284e62e 100644
--- a/src/Mollie.Api/Client/InvoicesClient.cs
+++ b/src/Mollie.Api/Client/InvoiceClient.cs
@@ -9,8 +9,8 @@
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client {
- public class InvoicesClient : OauthBaseMollieClient, IInvoicesClient {
- public InvoicesClient(string oauthAccessToken, HttpClient? httpClient = null) : base(oauthAccessToken, httpClient) {
+ public class InvoiceClient : OauthBaseMollieClient, IInvoiceClient {
+ public InvoiceClient(string oauthAccessToken, HttpClient? httpClient = null) : base(oauthAccessToken, httpClient) {
}
public async Task GetInvoiceAsync(string invoiceId) {
diff --git a/src/Mollie.Api/Client/OrderClient.cs b/src/Mollie.Api/Client/OrderClient.cs
index 9ba3db38..97566c3d 100644
--- a/src/Mollie.Api/Client/OrderClient.cs
+++ b/src/Mollie.Api/Client/OrderClient.cs
@@ -9,7 +9,6 @@
using Mollie.Api.Models.Order.Request.ManageOrderLines;
using Mollie.Api.Models.Order.Response;
using Mollie.Api.Models.Payment.Response;
-using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client {
@@ -69,17 +68,6 @@ public async Task CreateOrderPaymentAsync(string orderId, Order
return await PostAsync($"orders/{orderId}/payments", createOrderPaymentRequest).ConfigureAwait(false);
}
- public async Task CreateOrderRefundAsync(string orderId, OrderRefundRequest createOrderRefundRequest) {
- ValidateRequiredUrlParameter(nameof(orderId), orderId);
- return await PostAsync($"orders/{orderId}/refunds", createOrderRefundRequest);
- }
-
- public async Task> GetOrderRefundListAsync(string orderId, string? from = null, int? limit = null, bool testmode = false) {
- ValidateRequiredUrlParameter(nameof(orderId), orderId);
- var queryParameters = BuildQueryParameters(null, testmode);
- return await GetListAsync>($"orders/{orderId}/refunds", from, limit, queryParameters).ConfigureAwait(false);
- }
-
private Dictionary BuildQueryParameters(string? profileId = null, bool testmode = false, SortDirection? sort = null) {
var result = new Dictionary();
result.AddValueIfNotNullOrEmpty(nameof(profileId), profileId);
diff --git a/src/Mollie.Api/Client/OrganizationsClient.cs b/src/Mollie.Api/Client/OrganizationClient.cs
similarity index 77%
rename from src/Mollie.Api/Client/OrganizationsClient.cs
rename to src/Mollie.Api/Client/OrganizationClient.cs
index 75a25e8b..f9e86853 100644
--- a/src/Mollie.Api/Client/OrganizationsClient.cs
+++ b/src/Mollie.Api/Client/OrganizationClient.cs
@@ -6,8 +6,8 @@
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client {
- public class OrganizationsClient : OauthBaseMollieClient, IOrganizationsClient {
- public OrganizationsClient(string oauthAccessToken, HttpClient? httpClient = null) : base(oauthAccessToken, httpClient) {
+ public class OrganizationClient : OauthBaseMollieClient, IOrganizationClient {
+ public OrganizationClient(string oauthAccessToken, HttpClient? httpClient = null) : base(oauthAccessToken, httpClient) {
}
public async Task GetCurrentOrganizationAsync() {
@@ -23,11 +23,11 @@ public async Task GetOrganizationAsync(UrlObjectLink> GetOrganizationsListAsync(string? from = null, int? limit = null) {
+ public async Task> GetOrganizationListAsync(string? from = null, int? limit = null) {
return await GetListAsync>("organizations", from, limit).ConfigureAwait(false);
}
- public async Task> GetOrganizationsListAsync(UrlObjectLink> url) {
+ public async Task> GetOrganizationListAsync(UrlObjectLink> url) {
return await GetAsync(url).ConfigureAwait(false);
}
}
diff --git a/src/Mollie.Api/Client/PaymentClient.cs b/src/Mollie.Api/Client/PaymentClient.cs
index 492c52d1..2f13e526 100644
--- a/src/Mollie.Api/Client/PaymentClient.cs
+++ b/src/Mollie.Api/Client/PaymentClient.cs
@@ -49,7 +49,7 @@ public async Task GetPaymentAsync(
return await GetAsync($"payments/{paymentId}{queryParameters.ToQueryString()}").ConfigureAwait(false);
}
- public async Task DeletePaymentAsync(string paymentId, bool testmode = false) {
+ public async Task CancelPaymentAsync(string paymentId, bool testmode = false) {
ValidateRequiredUrlParameter(nameof(paymentId), paymentId);
var data = TestmodeModel.Create(testmode);
diff --git a/src/Mollie.Api/Client/PermissionsClient.cs b/src/Mollie.Api/Client/PermissionClient.cs
similarity index 81%
rename from src/Mollie.Api/Client/PermissionsClient.cs
rename to src/Mollie.Api/Client/PermissionClient.cs
index 9f871a4d..7034dede 100644
--- a/src/Mollie.Api/Client/PermissionsClient.cs
+++ b/src/Mollie.Api/Client/PermissionClient.cs
@@ -6,8 +6,8 @@
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client {
- public class PermissionsClient : OauthBaseMollieClient, IPermissionsClient {
- public PermissionsClient(string oauthAccessToken, HttpClient? httpClient = null) : base(oauthAccessToken, httpClient) {
+ public class PermissionClient : OauthBaseMollieClient, IPermissionClient {
+ public PermissionClient(string oauthAccessToken, HttpClient? httpClient = null) : base(oauthAccessToken, httpClient) {
}
public async Task GetPermissionAsync(string permissionId) {
diff --git a/src/Mollie.Api/Client/RefundClient.cs b/src/Mollie.Api/Client/RefundClient.cs
index b771ffd0..cf23b322 100644
--- a/src/Mollie.Api/Client/RefundClient.cs
+++ b/src/Mollie.Api/Client/RefundClient.cs
@@ -4,6 +4,8 @@
using Mollie.Api.Client.Abstract;
using Mollie.Api.Extensions;
using Mollie.Api.Models.List.Response;
+using Mollie.Api.Models.Order.Request;
+using Mollie.Api.Models.Order.Response;
using Mollie.Api.Models.Refund.Request;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Url;
@@ -13,7 +15,7 @@ public class RefundClient : BaseMollieClient, IRefundClient {
public RefundClient(string apiKey, HttpClient? httpClient = null) : base(apiKey, httpClient) {
}
- public async Task CreateRefundAsync(string paymentId, RefundRequest refundRequest) {
+ public async Task CreatePaymentRefundAsync(string paymentId, RefundRequest refundRequest) {
ValidateRequiredUrlParameter(nameof(paymentId), paymentId);
if (refundRequest.Testmode.HasValue)
@@ -30,7 +32,7 @@ public async Task> GetRefundListAsync(string? from
return await GetListAsync>($"refunds", from, limit, queryParameters).ConfigureAwait(false);
}
- public async Task> GetRefundListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false) {
+ public async Task> GetPaymentRefundListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false) {
ValidateRequiredUrlParameter(nameof(paymentId), paymentId);
var queryParameters = BuildQueryParameters(testmode: testmode);
@@ -46,20 +48,31 @@ public async Task GetRefundAsync(UrlObjectLink u
return await GetAsync(url).ConfigureAwait(false);
}
- public async Task GetRefundAsync(string paymentId, string refundId, bool testmode = false) {
+ public async Task GetPaymentRefundAsync(string paymentId, string refundId, bool testmode = false) {
ValidateRequiredUrlParameter(nameof(paymentId), paymentId);
ValidateRequiredUrlParameter(nameof(refundId), refundId);
var queryParameters = BuildQueryParameters(testmode: testmode);
return await GetAsync($"payments/{paymentId}/refunds/{refundId}{queryParameters.ToQueryString()}").ConfigureAwait(false);
}
- public async Task CancelRefundAsync(string paymentId, string refundId, bool testmode = default) {
+ public async Task CancelPaymentRefundAsync(string paymentId, string refundId, bool testmode = default) {
ValidateRequiredUrlParameter(nameof(paymentId), paymentId);
ValidateRequiredUrlParameter(nameof(refundId), refundId);
var queryParameters = BuildQueryParameters(testmode: testmode);
await DeleteAsync($"payments/{paymentId}/refunds/{refundId}{queryParameters.ToQueryString()}").ConfigureAwait(false);
}
+ public async Task CreateOrderRefundAsync(string orderId, OrderRefundRequest createOrderRefundRequest) {
+ ValidateRequiredUrlParameter(nameof(orderId), orderId);
+ return await PostAsync($"orders/{orderId}/refunds", createOrderRefundRequest);
+ }
+
+ public async Task> GetOrderRefundListAsync(string orderId, string? from = null, int? limit = null, bool testmode = false) {
+ ValidateRequiredUrlParameter(nameof(orderId), orderId);
+ var queryParameters = BuildQueryParameters(testmode);
+ return await GetListAsync>($"orders/{orderId}/refunds", from, limit, queryParameters).ConfigureAwait(false);
+ }
+
private Dictionary BuildQueryParameters(bool testmode = false) {
var result = new Dictionary();
result.AddValueIfTrue(nameof(testmode), testmode);
diff --git a/src/Mollie.Api/Client/SettlementsClient.cs b/src/Mollie.Api/Client/SettlementClient.cs
similarity index 77%
rename from src/Mollie.Api/Client/SettlementsClient.cs
rename to src/Mollie.Api/Client/SettlementClient.cs
index 022cff0a..c8a60555 100644
--- a/src/Mollie.Api/Client/SettlementsClient.cs
+++ b/src/Mollie.Api/Client/SettlementClient.cs
@@ -10,8 +10,8 @@
using Mollie.Api.Models.Url;
namespace Mollie.Api.Client {
- public class SettlementsClient : BaseMollieClient, ISettlementsClient {
- public SettlementsClient(string oauthAccessToken, HttpClient? httpClient = null) : base(oauthAccessToken, httpClient) {
+ public class SettlementClient : BaseMollieClient, ISettlementClient {
+ public SettlementClient(string oauthAccessToken, HttpClient? httpClient = null) : base(oauthAccessToken, httpClient) {
}
public async Task GetSettlementAsync(string settlementId) {
@@ -27,53 +27,53 @@ public async Task GetOpenSettlement() {
return await GetAsync($"settlements/open").ConfigureAwait(false);
}
- public async Task> GetSettlementsListAsync(string? reference = null, string? offset = null, int? count = null) {
+ public async Task> GetSettlementListAsync(string? reference = null, string? offset = null, int? count = null) {
var queryString = !string.IsNullOrWhiteSpace(reference) ? $"?reference={reference}" : string.Empty;
return await GetListAsync>($"settlements{queryString}", offset, count).ConfigureAwait(false);
}
- public async Task> GetSettlementsListAsync(UrlObjectLink> url)
+ public async Task> GetSettlementListAsync(UrlObjectLink> url)
{
return await GetAsync(url).ConfigureAwait(false);
}
- public async Task> GetSettlementPaymentsListAsync(string settlementId, string? offset = null, int? count = null) {
+ public async Task> GetSettlementPaymentListAsync(string settlementId, string? offset = null, int? count = null) {
ValidateRequiredUrlParameter(nameof(settlementId), settlementId);
return await GetListAsync>($"settlements/{settlementId}/payments", offset, count).ConfigureAwait(false);
}
- public async Task> GetSettlementPaymentsListAsync(UrlObjectLink> url)
+ public async Task> GetSettlementPaymentListAsync(UrlObjectLink> url)
{
return await GetAsync(url).ConfigureAwait(false);
}
- public async Task> GetSettlementRefundsListAsync(string settlementId, string? offset = null, int? count = null) {
+ public async Task> GetSettlementRefundListAsync(string settlementId, string? offset = null, int? count = null) {
ValidateRequiredUrlParameter(nameof(settlementId), settlementId);
return await GetListAsync>($"settlements/{settlementId}/refunds", offset, count).ConfigureAwait(false);
}
- public async Task> GetSettlementRefundsListAsync(UrlObjectLink> url)
+ public async Task> GetSettlementRefundListAsync(UrlObjectLink> url)
{
return await GetAsync(url).ConfigureAwait(false);
}
- public async Task> GetSettlementChargebacksListAsync(string settlementId, string? offset = null, int? count = null) {
+ public async Task> GetSettlementChargebackListAsync(string settlementId, string? offset = null, int? count = null) {
ValidateRequiredUrlParameter(nameof(settlementId), settlementId);
return await GetListAsync>($"settlements/{settlementId}/chargebacks", offset, count).ConfigureAwait(false);
}
- public async Task> GetSettlementChargebacksListAsync(UrlObjectLink> url)
+ public async Task> GetSettlementChargebackListAsync(UrlObjectLink> url)
{
return await GetAsync(url).ConfigureAwait(false);
}
- public async Task> GetSettlementCapturesListAsync(string settlementId, string? offset = null, int? count = null)
+ public async Task> GetSettlementCaptureListAsync(string settlementId, string? offset = null, int? count = null)
{
ValidateRequiredUrlParameter(nameof(settlementId), settlementId);
return await GetListAsync>($"settlements/{settlementId}/captures", offset, count).ConfigureAwait(false);
}
- public async Task> GetSettlementCapturesListAsync(UrlObjectLink> url)
+ public async Task> GetSettlementCaptureListAsync(UrlObjectLink> url)
{
return await GetAsync(url).ConfigureAwait(false);
}
@@ -84,7 +84,7 @@ public async Task GetSettlementAsync(UrlObjectLink> ListSettlementCapturesAsync(string settlementId)
{
- return await GetSettlementCapturesListAsync(settlementId);
+ return await GetSettlementCaptureListAsync(settlementId);
}
}
}
diff --git a/src/Mollie.Api/Client/ShipmentClient.cs b/src/Mollie.Api/Client/ShipmentClient.cs
index e3146c16..d8551c09 100644
--- a/src/Mollie.Api/Client/ShipmentClient.cs
+++ b/src/Mollie.Api/Client/ShipmentClient.cs
@@ -32,14 +32,14 @@ public async Task GetShipmentAsync(UrlObjectLink> GetShipmentsListAsync(string orderId, bool testmode = false) {
+ public async Task> GetShipmentListAsync(string orderId, bool testmode = false) {
ValidateRequiredUrlParameter(nameof(orderId), orderId);
var queryParameters = BuildQueryParameters(testmode);
return await GetAsync>($"orders/{orderId}/shipments{queryParameters.ToQueryString()}")
.ConfigureAwait(false);
}
- public async Task> GetShipmentsListAsync(UrlObjectLink> url) {
+ public async Task> GetShipmentListAsync(UrlObjectLink> url) {
return await GetAsync(url).ConfigureAwait(false);
}
diff --git a/src/Mollie.Api/DependencyInjection.cs b/src/Mollie.Api/DependencyInjection.cs
index d1a815aa..91665c8d 100644
--- a/src/Mollie.Api/DependencyInjection.cs
+++ b/src/Mollie.Api/DependencyInjection.cs
@@ -19,36 +19,36 @@ public static IServiceCollection AddMollieApi(
new BalanceClient(mollieOptions.ApiKey, httpClient), mollieOptions.RetryPolicy);
RegisterMollieApiClient(services, httpClient =>
new CaptureClient(mollieOptions.ApiKey, httpClient), mollieOptions.RetryPolicy);
- RegisterMollieApiClient(services, httpClient =>
- new ChargebacksClient(mollieOptions.ApiKey, httpClient), mollieOptions.RetryPolicy);
+ RegisterMollieApiClient(services, httpClient =>
+ new ChargebackClient(mollieOptions.ApiKey, httpClient), mollieOptions.RetryPolicy);
RegisterMollieApiClient(services, httpClient =>
new ConnectClient(mollieOptions.ClientId, mollieOptions.ClientSecret, httpClient), mollieOptions.RetryPolicy);
RegisterMollieApiClient(services, httpClient =>
new CustomerClient(mollieOptions.ApiKey, httpClient), mollieOptions.RetryPolicy);
- RegisterMollieApiClient(services, httpClient =>
- new InvoicesClient(mollieOptions.ApiKey, httpClient), mollieOptions.RetryPolicy);
+ RegisterMollieApiClient(services, httpClient =>
+ new InvoiceClient(mollieOptions.ApiKey, httpClient), mollieOptions.RetryPolicy);
RegisterMollieApiClient(services, httpClient =>
new MandateClient(mollieOptions.ApiKey, httpClient), mollieOptions.RetryPolicy);
RegisterMollieApiClient(services, httpClient =>
new OnboardingClient(mollieOptions.ApiKey, httpClient), mollieOptions.RetryPolicy);
RegisterMollieApiClient