diff --git a/src/Mollie.Api/Client/Abstract/IConnectClient.cs b/src/Mollie.Api/Client/Abstract/IConnectClient.cs index 21203b52..c12b9dd2 100644 --- a/src/Mollie.Api/Client/Abstract/IConnectClient.cs +++ b/src/Mollie.Api/Client/Abstract/IConnectClient.cs @@ -4,7 +4,8 @@ using Mollie.Api.Models.Connect; namespace Mollie.Api.Client.Abstract { - public interface IConnectClient : IDisposable { + public interface IConnectClient : IDisposable + { /// /// Constructs the Authorize URL for the Authorize endpoint from the parameters /// @@ -27,9 +28,18 @@ public interface IConnectClient : IDisposable { /// You can provide any ISO 15897 locale, but the authorize flow currently only supports the following languages: /// Possible values: en_US nl_NL nl_BE fr_FR fr_BE de_DE es_ES it_IT /// + /// + /// Allows you to specify if Mollie should show the login or the signup page, when the merchant is not logged in at Mollie. + /// Defaults to the login page. Defaults to login. + /// /// The url to the mollie consent screen. - string GetAuthorizationUrl(string state, List scopes, string redirectUri = null, - bool forceApprovalPrompt = false, string locale = null); + string GetAuthorizationUrl( + string state, + List scopes, + string redirectUri = null, + bool forceApprovalPrompt = false, + string locale = null, + string landingPage = null); /// /// Exchange the auth code received at the Authorize endpoint for an actual access token, with which you can diff --git a/src/Mollie.Api/Client/ConnectClient.cs b/src/Mollie.Api/Client/ConnectClient.cs index d533bde3..5fcd4d3a 100644 --- a/src/Mollie.Api/Client/ConnectClient.cs +++ b/src/Mollie.Api/Client/ConnectClient.cs @@ -28,7 +28,14 @@ public ConnectClient(string clientId, string clientSecret, HttpClient httpClient this._clientId = clientId; } - public string GetAuthorizationUrl(string state, List scopes, string redirectUri = null, bool forceApprovalPrompt = false, string locale = null) { + public string GetAuthorizationUrl( + string state, + List scopes, + string redirectUri = null, + bool forceApprovalPrompt = false, + string locale = null, + string landingPage = null) { + var parameters = new Dictionary { {"client_id", this._clientId}, {"state", state}, @@ -38,6 +45,7 @@ public string GetAuthorizationUrl(string state, List scopes, string redi }; parameters.AddValueIfNotNullOrEmpty("redirect_uri", redirectUri); parameters.AddValueIfNotNullOrEmpty("locale", locale); + parameters.AddValueIfNotNullOrEmpty("landing_page", landingPage); return AuthorizeEndPoint + parameters.ToQueryString(); } diff --git a/src/Mollie.Api/Models/Connect/AuthorizeRequest.cs b/src/Mollie.Api/Models/Connect/AuthorizeRequest.cs deleted file mode 100644 index 4e937f5c..00000000 --- a/src/Mollie.Api/Models/Connect/AuthorizeRequest.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace Mollie.Api.Models.Connect { - public class AuthorizeRequest { - /// - /// The client ID you receive when registering your app. - /// - public string ClientId { get; set; } - - /// - /// Optional – The URL the merchant is sent back to once the request has been authorized. If given, it must match the - /// URL you set when registering your app. - /// - public string RedirectUri { get; set; } - - /// - /// A random string generated by your app to prevent CSRF attacks. - /// - public string State { get; set; } - - /// - /// A space separated list of permissions your app requires. Refer to OAuth: Permissions for more information about the - /// available scopes. - /// - public string Scope { get; set; } - - /// - /// Mollie currently only replies with code responses. - /// Possible values: code - /// - public string ResponseType { get; set; } - - /// - /// This parameter can be set to force, to force showing the consent screen to the merchant, even when it is not - /// necessary. - /// Possible values: auto force - /// - public string ApprovalPrompt { get; set; } - } -} \ No newline at end of file