Skip to content

Commit

Permalink
Standardize client and method names (#359)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Viincenttt authored May 16, 2024
1 parent 104e560 commit 0eb334b
Show file tree
Hide file tree
Showing 41 changed files with 391 additions and 380 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/Mollie.Api/Client/Abstract/IBalanceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ public interface IBalanceClient : IBaseMollieClient {
/// <param name="currency">Currency filter that will make it so only balances in given currency are returned.
/// For example EUR.</param>
/// <returns></returns>
Task<ListResponse<BalanceResponse>> ListBalancesAsync(string? from = null, int? limit = null, string? currency = null);
Task<ListResponse<BalanceResponse>> GetBalanceListAsync(string? from = null, int? limit = null, string? currency = null);

/// <summary>
/// Retrieve all the organization’s balances by URL
/// </summary>
/// <param name="url">The URL of the balance objects</param>
/// <returns></returns>
Task<ListResponse<BalanceResponse>> ListBalancesAsync(UrlObjectLink<ListResponse<BalanceResponse>> url);
Task<ListResponse<BalanceResponse>> GetBalanceListAsync(UrlObjectLink<ListResponse<BalanceResponse>> url);

/// <summary>
/// With the Get balance report endpoint you can retrieve a summarized report for all movements on a given
Expand Down Expand Up @@ -87,7 +87,7 @@ public interface IBalanceClient : IBaseMollieClient {
/// with this ID is included in the result set as well.</param>
/// <param name="limit">The number of balance transactions to return (with a maximum of 250).</param>
/// <returns></returns>
Task<BalanceTransactionResponse> ListBalanceTransactionsAsync(string balanceId, string? from = null, int? limit = null);
Task<BalanceTransactionResponse> GetBalanceTransactionListAsync(string balanceId, string? from = null, int? limit = null);

/// <summary>
/// With the List primary balance transactions endpoint you can retrieve a list of all the movements on your
Expand All @@ -97,6 +97,6 @@ public interface IBalanceClient : IBaseMollieClient {
/// with this ID is included in the result set as well.</param>
/// <param name="limit">The number of balance transactions to return (with a maximum of 250).</param>
/// <returns></returns>
Task<BalanceTransactionResponse> ListPrimaryBalanceTransactionsAsync(string? from = null, int? limit = null);
Task<BalanceTransactionResponse> GetPrimaryBalanceTransactionListAsync(string? from = null, int? limit = null);
}
}
4 changes: 2 additions & 2 deletions src/Mollie.Api/Client/Abstract/ICaptureClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace Mollie.Api.Client.Abstract {
public interface ICaptureClient : IBaseMollieClient {
Task<CaptureResponse> GetCaptureAsync(string paymentId, string captureId, bool testmode = false);
Task<CaptureResponse> GetCaptureAsync(UrlObjectLink<CaptureResponse> url);
Task<ListResponse<CaptureResponse>> GetCapturesListAsync(string paymentId, bool testmode = false);
Task<ListResponse<CaptureResponse>> GetCapturesListAsync(UrlObjectLink<ListResponse<CaptureResponse>> url);
Task<ListResponse<CaptureResponse>> GetCaptureListAsync(string paymentId, bool testmode = false);
Task<ListResponse<CaptureResponse>> GetCaptureListAsync(UrlObjectLink<ListResponse<CaptureResponse>> url);
Task<CaptureResponse> CreateCapture(string paymentId, CaptureRequest captureRequest, bool testmode = false);
}
}
13 changes: 13 additions & 0 deletions src/Mollie.Api/Client/Abstract/IChargebackClient.cs
Original file line number Diff line number Diff line change
@@ -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<ChargebackResponse> GetChargebackAsync(string paymentId, string chargebackId, bool testmode = false);
Task<ListResponse<ChargebackResponse>> GetChargebackListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false);
Task<ListResponse<ChargebackResponse>> GetChargebackListAsync(string? profileId = null, bool testmode = false);
Task<ListResponse<ChargebackResponse>> GetChargebackListAsync(UrlObjectLink<ListResponse<ChargebackResponse>> url);
}
}
13 changes: 0 additions & 13 deletions src/Mollie.Api/Client/Abstract/IChargebacksClient.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client.Abstract {
public interface IInvoicesClient : IBaseMollieClient {
public interface IInvoiceClient : IBaseMollieClient {
Task<InvoiceResponse> GetInvoiceAsync(string invoiceId);
Task<InvoiceResponse> GetInvoiceAsync(UrlObjectLink<InvoiceResponse> url);
Task<ListResponse<InvoiceResponse>> GetInvoiceListAsync(
Expand Down
4 changes: 0 additions & 4 deletions src/Mollie.Api/Client/Abstract/IOrderClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -22,8 +21,5 @@ Task<ListResponse<OrderResponse>> GetOrderListAsync(
Task<ListResponse<OrderResponse>> GetOrderListAsync(UrlObjectLink<ListResponse<OrderResponse>> url);
Task CancelOrderLinesAsync(string orderId, OrderLineCancellationRequest cancelationRequest);
Task<PaymentResponse> CreateOrderPaymentAsync(string orderId, OrderPaymentRequest createOrderPaymentRequest);
Task<OrderRefundResponse> CreateOrderRefundAsync(string orderId, OrderRefundRequest createOrderRefundRequest);
Task<ListResponse<RefundResponse>> GetOrderRefundListAsync(
string orderId, string? from = null, int? limit = null, bool testmode = false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client.Abstract {
public interface IOrganizationsClient : IBaseMollieClient {
public interface IOrganizationClient : IBaseMollieClient {
Task<OrganizationResponse> GetCurrentOrganizationAsync();
Task<OrganizationResponse> GetOrganizationAsync(string organizationId);
Task<ListResponse<OrganizationResponse>> GetOrganizationsListAsync(string? from = null, int? limit = null);
Task<ListResponse<OrganizationResponse>> GetOrganizationsListAsync(UrlObjectLink<ListResponse<OrganizationResponse>> url);
Task<ListResponse<OrganizationResponse>> GetOrganizationListAsync(string? from = null, int? limit = null);
Task<ListResponse<OrganizationResponse>> GetOrganizationListAsync(UrlObjectLink<ListResponse<OrganizationResponse>> url);
Task<OrganizationResponse> GetOrganizationAsync(UrlObjectLink<OrganizationResponse> url);
}
}
2 changes: 1 addition & 1 deletion src/Mollie.Api/Client/Abstract/IPaymentClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Task<PaymentResponse> GetPaymentAsync(
/// <param name="paymentId"></param>
/// <param name="testmode">Oauth - Optional – Set this to true to cancel a test mode payment.</param>
/// <returns></returns>
Task DeletePaymentAsync(string paymentId, bool testmode = false);
Task CancelPaymentAsync(string paymentId, bool testmode = false);

/// <summary>
/// Retrieve all payments created with the current payment profile, ordered from newest to oldest.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client.Abstract {
public interface IPermissionsClient : IBaseMollieClient {
public interface IPermissionClient : IBaseMollieClient {
Task<PermissionResponse> GetPermissionAsync(string permissionId);
Task<PermissionResponse> GetPermissionAsync(UrlObjectLink<PermissionResponse> url);
Task<ListResponse<PermissionResponse>> GetPermissionListAsync();
Expand Down
12 changes: 8 additions & 4 deletions src/Mollie.Api/Client/Abstract/IRefundClient.cs
Original file line number Diff line number Diff line change
@@ -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<RefundResponse> CreateRefundAsync(string paymentId, RefundRequest refundRequest);
Task<RefundResponse> GetRefundAsync(string paymentId, string refundId, bool testmode = false);
Task<ListResponse<RefundResponse>> GetRefundListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false);
Task<RefundResponse> CreatePaymentRefundAsync(string paymentId, RefundRequest refundRequest);
Task<RefundResponse> GetPaymentRefundAsync(string paymentId, string refundId, bool testmode = false);
Task CancelPaymentRefundAsync(string paymentId, string refundId, bool testmode = false);
Task<ListResponse<RefundResponse>> GetPaymentRefundListAsync(string paymentId, string? from = null, int? limit = null, bool testmode = false);
Task<OrderRefundResponse> CreateOrderRefundAsync(string orderId, OrderRefundRequest createOrderRefundRequest);
Task<ListResponse<RefundResponse>> GetOrderRefundListAsync(string orderId, string? from = null, int? limit = null, bool testmode = false);
Task<ListResponse<RefundResponse>> GetRefundListAsync(UrlObjectLink<ListResponse<RefundResponse>> url);
Task<RefundResponse> GetRefundAsync(UrlObjectLink<RefundResponse> url);
}
Expand Down
27 changes: 27 additions & 0 deletions src/Mollie.Api/Client/Abstract/ISettlementClient.cs
Original file line number Diff line number Diff line change
@@ -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<SettlementResponse> GetSettlementAsync(string settlementId);
Task<SettlementResponse> GetNextSettlement();
Task<SettlementResponse> GetOpenSettlement();
Task<ListResponse<SettlementResponse>> GetSettlementListAsync(string? reference = null, string? from = null, int? limit = null);
Task<ListResponse<SettlementResponse>> GetSettlementListAsync(UrlObjectLink<ListResponse<SettlementResponse>> url);
Task<ListResponse<PaymentResponse>> GetSettlementPaymentListAsync(string settlementId, string? from = null, int? limit = null);
Task<ListResponse<PaymentResponse>> GetSettlementPaymentListAsync(UrlObjectLink<ListResponse<PaymentResponse>> url);
Task<ListResponse<RefundResponse>> GetSettlementRefundListAsync(string settlementId, string? from = null, int? limit = null);
Task<ListResponse<RefundResponse>> GetSettlementRefundListAsync(UrlObjectLink<ListResponse<RefundResponse>> url);
Task<ListResponse<ChargebackResponse>> GetSettlementChargebackListAsync(string settlementId, string? from = null, int? limit = null);
Task<ListResponse<ChargebackResponse>> GetSettlementChargebackListAsync(UrlObjectLink<ListResponse<ChargebackResponse>> url);
Task<ListResponse<CaptureResponse>> GetSettlementCaptureListAsync(string settlementId, string? offset = null, int? count = null);
Task<ListResponse<CaptureResponse>> GetSettlementCaptureListAsync(UrlObjectLink<ListResponse<CaptureResponse>> url);
Task<SettlementResponse> GetSettlementAsync(UrlObjectLink<SettlementResponse> url);
}
}
31 changes: 0 additions & 31 deletions src/Mollie.Api/Client/Abstract/ISettlementsClient.cs

This file was deleted.

4 changes: 2 additions & 2 deletions src/Mollie.Api/Client/Abstract/IShipmentClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public interface IShipmentClient : IBaseMollieClient {
Task<ShipmentResponse> CreateShipmentAsync(string orderId, ShipmentRequest shipmentRequest);
Task<ShipmentResponse> GetShipmentAsync(string orderId, string shipmentId, bool testmode = false);
Task<ShipmentResponse> GetShipmentAsync(UrlObjectLink<ShipmentResponse> url);
Task<ListResponse<ShipmentResponse>> GetShipmentsListAsync(string orderId, bool testmode = false);
Task<ListResponse<ShipmentResponse>> GetShipmentsListAsync(UrlObjectLink<ListResponse<ShipmentResponse>> url);
Task<ListResponse<ShipmentResponse>> GetShipmentListAsync(string orderId, bool testmode = false);
Task<ListResponse<ShipmentResponse>> GetShipmentListAsync(UrlObjectLink<ListResponse<ShipmentResponse>> url);
Task<ShipmentResponse> UpdateShipmentAsync(string orderId, string shipmentId, ShipmentUpdateRequest shipmentUpdateRequest);
}
}
8 changes: 4 additions & 4 deletions src/Mollie.Api/Client/BalanceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public async Task<BalanceResponse> GetPrimaryBalanceAsync() {
return await GetAsync<BalanceResponse>("balances/primary").ConfigureAwait(false);
}

public async Task<ListResponse<BalanceResponse>> ListBalancesAsync(string? from = null, int? limit = null, string? currency = null) {
public async Task<ListResponse<BalanceResponse>> GetBalanceListAsync(string? from = null, int? limit = null, string? currency = null) {
var queryParameters = BuildListBalanceQueryParameters(currency);
return await GetListAsync<ListResponse<BalanceResponse>>($"balances", from, limit, queryParameters).ConfigureAwait(false);
}

public async Task<ListResponse<BalanceResponse>> ListBalancesAsync(UrlObjectLink<ListResponse<BalanceResponse>> url) {
public async Task<ListResponse<BalanceResponse>> GetBalanceListAsync(UrlObjectLink<ListResponse<BalanceResponse>> url) {
return await GetAsync(url).ConfigureAwait(false);
}

Expand All @@ -49,13 +49,13 @@ public async Task<BalanceReportResponse> GetPrimaryBalanceReportAsync(DateTime f
return await GetAsync<BalanceReportResponse>($"balances/primary/report{queryParameters.ToQueryString()}").ConfigureAwait(false);
}

public async Task<BalanceTransactionResponse> ListBalanceTransactionsAsync(string balanceId, string? from = null, int? limit = null) {
public async Task<BalanceTransactionResponse> GetBalanceTransactionListAsync(string balanceId, string? from = null, int? limit = null) {
ValidateRequiredUrlParameter(nameof(balanceId), balanceId);
var queryParameters = BuildListBalanceTransactionsQueryParameters(from, limit);
return await GetAsync<BalanceTransactionResponse>($"balances/{balanceId}/transactions{queryParameters.ToQueryString()}").ConfigureAwait(false);
}

public async Task<BalanceTransactionResponse> ListPrimaryBalanceTransactionsAsync(string? from = null, int? limit = null) {
public async Task<BalanceTransactionResponse> GetPrimaryBalanceTransactionListAsync(string? from = null, int? limit = null) {
var queryParameters = BuildListBalanceTransactionsQueryParameters(from, limit);
return await GetAsync<BalanceTransactionResponse>($"balances/primary/transactions{queryParameters.ToQueryString()}").ConfigureAwait(false);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Mollie.Api/Client/CaptureClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public async Task<CaptureResponse> GetCaptureAsync(UrlObjectLink<CaptureResponse
return await GetAsync(url).ConfigureAwait(false);
}

public async Task<ListResponse<CaptureResponse>> GetCapturesListAsync(string paymentId, bool testmode = false) {
public async Task<ListResponse<CaptureResponse>> GetCaptureListAsync(string paymentId, bool testmode = false) {
ValidateRequiredUrlParameter(nameof(paymentId), paymentId);
var queryParameters = BuildQueryParameters(testmode);
return await GetAsync<ListResponse<CaptureResponse>>($"payments/{paymentId}/captures{queryParameters.ToQueryString()}")
.ConfigureAwait(false);
}

public async Task<ListResponse<CaptureResponse>> GetCapturesListAsync(UrlObjectLink<ListResponse<CaptureResponse>> url) {
public async Task<ListResponse<CaptureResponse>> GetCaptureListAsync(UrlObjectLink<ListResponse<CaptureResponse>> url) {
return await GetAsync(url).ConfigureAwait(false);
}

Expand Down
Loading

0 comments on commit 0eb334b

Please sign in to comment.