-
-
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.
Merge branch 'master' of https://github.com/Viincenttt/MollieApi
- Loading branch information
Showing
15 changed files
with
265 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
using System.Threading.Tasks; | ||
using Mollie.Api.Models.List; | ||
using Mollie.Api.Models.Organization; | ||
using Mollie.Api.Models.Url; | ||
|
||
namespace Mollie.Api.Client.Abstract { | ||
public interface IOrganizationsClient { | ||
public interface IOrganizationsClient | ||
{ | ||
Task<OrganizationResponse> GetCurrentOrganizationAsync(); | ||
Task<OrganizationResponse> GetOrganizationAsync(string organizationId); | ||
Task<ListResponse<OrganizationResponse>> GetOrganizationsListAsync(string from = null, int? limit = null); | ||
Task<OrganizationResponse> GetOrganizationAsync(UrlObjectLink<OrganizationResponse> url); | ||
} | ||
} |
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,15 +1,15 @@ | ||
using System.Threading.Tasks; | ||
using Mollie.Api.Models; | ||
using Mollie.Api.Models.List; | ||
|
||
using Mollie.Api.Models.Payment; | ||
using Mollie.Api.Models.PaymentMethod; | ||
using Mollie.Api.Models.Url; | ||
|
||
namespace Mollie.Api.Client.Abstract { | ||
public interface IPaymentMethodClient { | ||
Task<PaymentMethodResponse> GetPaymentMethodAsync(PaymentMethod paymentMethod, bool? includeIssuers = null, string locale = null); | ||
Task<ListResponse<PaymentMethodResponse>> GetPaymentMethodListAsync(SequenceType? sequenceType = null, string locale = null, Amount amount = null); | ||
Task<PaymentMethodResponse> GetPaymentMethodAsync(PaymentMethod paymentMethod, bool? includeIssuers = null, string locale = null, bool? includePricing = null, string profileId = null, bool? testmode = null); | ||
Task<ListResponse<PaymentMethodResponse>> GetAllPaymentMethodListAsync(string locale = null, bool? includeIssuers = null, bool? includePricing = null); | ||
Task<ListResponse<PaymentMethodResponse>> GetPaymentMethodListAsync(SequenceType? sequenceType = null, string locale = null, Amount amount = null, bool? includeIssuers = null, bool? includePricing = null, string profileId = null, bool? testmode = null); | ||
Task<PaymentMethodResponse> GetPaymentMethodAsync(UrlObjectLink<PaymentMethodResponse> url); | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
Mollie.Api/Models/Payment/Request/Przelewy24PaymentRequest.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Mollie.Api.Models.Payment.Request | ||
{ | ||
public class Przelewy24PaymentRequest : PaymentRequest | ||
{ | ||
public Przelewy24PaymentRequest() | ||
{ | ||
this.Method = PaymentMethod.Przelewy24; | ||
} | ||
|
||
/// <summary> | ||
/// Consumer’s email address, this is required for Przelewy24 payments. | ||
/// </summary> | ||
public string BillingEmail { 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
14 changes: 14 additions & 0 deletions
14
Mollie.Api/Models/PaymentMethod/Pricing/FixedPricingResponse.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Mollie.Api.Models.PaymentMethod.Pricing | ||
{ | ||
public class FixedPricingResponse : IResponseObject { | ||
/// <summary> | ||
/// The ISO 4217 currency code. | ||
/// </summary> | ||
public string Currency { get; set; } | ||
|
||
/// <summary> | ||
/// A string containing the exact amount in the given currency. | ||
/// </summary> | ||
public decimal Value { get; set; } | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
Mollie.Api/Models/PaymentMethod/Pricing/PricingResponse.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace Mollie.Api.Models.PaymentMethod.Pricing | ||
{ | ||
public class PricingResponse : IResponseObject { | ||
/// <summary> | ||
/// The area or product-type where the pricing is applied for, translated in the optional locale passed. | ||
/// </summary> | ||
public string Description { get; set; } | ||
|
||
/// <summary> | ||
/// The fixed price per transaction | ||
/// </summary> | ||
public FixedPricingResponse Fixed { get; set; } | ||
|
||
/// <summary> | ||
/// A string containing the percentage what will be charged over the payment amount besides the fixed price. | ||
/// </summary> | ||
public decimal Variable { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ | |
|
||
namespace Mollie.Tests.Integration.Api { | ||
using System.Linq; | ||
|
||
using Mollie.Api.Models.Customer; | ||
using Mollie.Api.Models.Mandate; | ||
|
||
|
@@ -115,6 +114,7 @@ public async Task CanCreateDefaultPaymentWithAllFields() { | |
[TestCase(typeof(PaymentRequest), PaymentMethod.Belfius, typeof(BelfiusPaymentResponse))] | ||
[TestCase(typeof(KbcPaymentRequest), PaymentMethod.Kbc, typeof(KbcPaymentResponse))] | ||
[TestCase(typeof(PaymentRequest), null, typeof(PaymentResponse))] | ||
//[TestCase(typeof(Przelewy24PaymentRequest), PaymentMethod.Przelewy24, typeof(PaymentResponse))] // Payment option is not enabled in website profile | ||
public async Task CanCreateSpecificPaymentType(Type paymentType, PaymentMethod? paymentMethod, Type expectedResponseType) { | ||
// If: we create a specific payment type with some bank transfer specific values | ||
PaymentRequest paymentRequest = (PaymentRequest) Activator.CreateInstance(paymentType); | ||
|
@@ -123,6 +123,12 @@ public async Task CanCreateSpecificPaymentType(Type paymentType, PaymentMethod? | |
paymentRequest.RedirectUrl = this.DefaultRedirectUrl; | ||
paymentRequest.Method = paymentMethod; | ||
|
||
// Set required billing email for Przelewy24 | ||
if (paymentRequest is Przelewy24PaymentRequest request) | ||
{ | ||
request.BillingEmail = "[email protected]"; | ||
} | ||
|
||
// When: We send the payment request to Mollie | ||
PaymentResponse result = await this._paymentClient.CreatePaymentAsync(paymentRequest); | ||
|
||
|
Oops, something went wrong.