sharee.bike-App/TINKLib/ViewModel/CopriWebView/RegisterPageViewModel.cs
Anja Müller-Meißner 573fe77e12 Version 3.0.337
2022-08-30 15:42:25 +02:00

47 lines
1.6 KiB
C#

using Serilog;
using TINK.Repository.Request;
namespace TINK.ViewModel.CopriWebView
{
public class RegisterPageViewModel
{
/// <summary> Holds the merchant id.</summary>
private string MerchantId { get; }
/// <summary> Holds the name of the host.</summary>
private string HostName { get; }
/// <summary>
/// Holds the current ui two letter ISO language name.
/// </summary>
private string UiIsoLanguageName { get; }
/// <param name="uiIsoLangugageName">Two letter ISO language name.</param>
public RegisterPageViewModel(
string merchantId,
string uiIsoLangugageName,
string hostName)
{
HostName = hostName;
UiIsoLanguageName = uiIsoLangugageName;
MerchantId = merchantId;
}
/// <summary>Get Uri of web view for creating account.</summary>
public string Uri
{
get
{
var sessionIdQueryElement = QueryBuilderHelper.GetSessionIdQueryElement("?", MerchantId);
string GetUriText()
=> !string.IsNullOrEmpty(sessionIdQueryElement)
? $"https://{HostName}/app/Account/1.%20Kundendaten{sessionIdQueryElement}{QueryBuilderHelper.GetLanguageQueryElement("&", UiIsoLanguageName)}"
: $"https://{HostName}/app/Account/1.%20Kundendaten";
Log.ForContext<RegisterPageViewModel>().Debug($"Request to open url {GetUriText()} to get privacy info.");
return GetUriText();
}
}
}
}