Skip to content

Commit

Permalink
Add support for new profile properties (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt authored Mar 10, 2024
1 parent a30cb7e commit f8e4124
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Mollie.Api/Models/Profile/Request/ProfileRequest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;

namespace Mollie.Api.Models.Profile.Request {
public class ProfileRequest {
Expand All @@ -21,6 +22,16 @@ public class ProfileRequest {
/// The phone number associated with the profile's tradename or brand.
/// </summary>
public string Phone { get; set; }

/// <summary>
/// The products or services that the profile’s website offers.
/// </summary>
public string Description { get; set; }

/// <summary>
/// The list of countries where you expect that the majority of the profile’s customers will live, in ISO 3166-1 alpha-2 format.
/// </summary>
public IEnumerable<string> CountriesOfActivity { get; set; }

/// <summary>
/// The industry associated with the profile’s trade name or brand. Please refer to the documentation of the business category
Expand Down
11 changes: 11 additions & 0 deletions src/Mollie.Api/Models/Profile/Response/ProfileResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Mollie.Api.Models.Profile.Response {
Expand Down Expand Up @@ -29,6 +30,16 @@ public class ProfileResponse : IResponseObject {
/// The URL to the profile's website or application.
/// </summary>
public string Website { get; set; }

/// <summary>
/// The products or services that the profile’s website offers.
/// </summary>
public string Description { get; set; }

/// <summary>
/// The list of countries where you expect that the majority of the profile’s customers will live, in ISO 3166-1 alpha-2 format.
/// </summary>
public IEnumerable<string> CountriesOfActivity { get; set; }

/// <summary>
/// The email address associated with the profile's tradename or brand.
Expand Down
7 changes: 7 additions & 0 deletions tests/Mollie.Tests.Unit/Client/ProfileClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
Expand Down Expand Up @@ -26,6 +27,8 @@ public async Task CreateProfileAsync_WithRequiredParameters_ResponseIsDeserializ
Mode = Mode.Test,
Phone = "+31208202070",
Website = "https://www.mywebsite.com",
Description = "Description",
CountriesOfActivity = new List<string>() { "NL" },
BusinessCategory = "OTHER_MERCHANDISE"
};
var mockHttp = new MockHttpMessageHandler();
Expand All @@ -41,6 +44,8 @@ public async Task CreateProfileAsync_WithRequiredParameters_ResponseIsDeserializ
// Assert
mockHttp.VerifyNoOutstandingRequest();
AssertDefaultProfileResponse(result);
result.Description.Should().Be(profileRequest.Description);
result.CountriesOfActivity.Should().Equal(profileRequest.CountriesOfActivity);
}

[Fact]
Expand Down Expand Up @@ -419,6 +424,8 @@ private void AssertDefaultProfileResponse(ProfileResponse result)
""website"": ""https://www.mywebsite.com"",
""email"": ""[email protected]"",
""phone"": ""+31208202070"",
""description"": ""Description"",
""countriesOfActivity"": [""NL""],
""businessCategory"": ""OTHER_MERCHANDISE"",
""categoryCode"": 5399,
""status"": ""unverified"",
Expand Down

0 comments on commit f8e4124

Please sign in to comment.