feat(postit): add native PayPal subscription page

Add bearer-authenticated subscription checkout, reconciliation and cancellation on the authority host, reuse web subscription services, and document the flow with regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paul Schneider 2026-11-10 23:57:26 +00:00
commit 7cda466fa8
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
21 changed files with 774 additions and 28 deletions

View file

@ -0,0 +1,174 @@
using System.Net.Http;
using System.Text.Json;
using System.Globalization;
using Avalonia.Controls;
using Avalonia.Headless.XUnit;
using PostIt.ViewModels;
using PostIt.Views;
using Yavsc.Abstract.Resources;
using Yavsc.Api.Client;
namespace PostIt.Tests;
public sealed class SubscriptionsPageTests
{
[AvaloniaFact]
public async Task Page_binds_server_offers_prices_and_balance()
{
await using var api = new FakeApi();
var model = Model(api);
await model.InitializeAsync();
var page = new SubscriptionsPage { DataContext = model };
Assert.IsType<SubscriptionsPage>(new ViewLocator().Build(model));
var selector = page.FindControl<ComboBox>("OfferSelector")!;
Assert.Equal(2, selector.ItemCount);
Assert.Equal(1.2m, model.SelectedOffer?.PriceIncludingTax);
Assert.Equal($"Prix TTC : {1.2m.ToString("F2", CultureInfo.CurrentCulture)} EUR / mois",
page.FindControl<TextBlock>("OfferPrice")!.Text);
selector.SelectedIndex = 1;
Assert.Equal("Premium", model.SelectedOffer?.Pack);
Assert.Equal($"Prix TTC : {2.4m.ToString("F2", CultureInfo.CurrentCulture)} EUR / mois",
page.FindControl<TextBlock>("OfferPrice")!.Text);
Assert.Equal(45m, model.Usage?.Consumption);
Assert.Null(model.StatusMessage);
Assert.True(model.SubscribeCommand.CanExecute(null));
Assert.False(model.CancelSubscriptionCommand.CanExecute(null));
}
[Fact]
public async Task Checkout_uses_authority_and_selected_pack_without_granting_local_credit()
{
await using var api = new FakeApi();
Uri? opened = null;
var authority = "https://first.example/";
var client = new ResourceSubscriptionsApiClient(api, () => authority);
var model = new SubscriptionsPageViewModel(client, uri => { opened = uri; return Task.FromResult(true); });
await model.InitializeAsync();
authority = "https://second.example/instance";
model.SelectedOffer = model.Offers[1];
await model.SubscribeCommand.ExecuteAsync(null);
Assert.Equal("https://second.example/instance/api/v1/resource-subscriptions", api.LastPath);
Assert.Equal("Premium", Assert.IsType<CreateResourceSubscriptionRequest>(api.LastBody).Pack);
Assert.Equal("www.sandbox.paypal.com", opened?.Host);
Assert.Equal("APPROVAL_PENDING", model.CurrentSubscription?.State);
Assert.Equal(45m, model.Usage?.Consumption);
Assert.False(model.IsBusy);
Assert.Contains("Actualiser", model.StatusMessage);
}
[Theory]
[InlineData("https://attacker.example/approve", true)]
[InlineData("http://www.paypal.com/approve", true)]
[InlineData("https://www.paypal.com@attacker.example/approve", true)]
[InlineData("https://www.paypal.com:444/approve", true)]
[InlineData("https://www.sandbox.paypal.com/approve", false)]
public async Task Invalid_link_or_browser_failure_is_explicit_and_checkout_can_be_resumed(string link, bool launchResult)
{
await using var api = new FakeApi { ApprovalUrl = link };
var launches = 0;
var model = new SubscriptionsPageViewModel(new(api, () => "https://org.example"), _ =>
{
launches++;
return Task.FromResult(launchResult);
});
await model.InitializeAsync();
await model.SubscribeCommand.ExecuteAsync(null);
Assert.Contains("impossible", model.StatusMessage);
Assert.Equal(launchResult ? 0 : 1, launches);
Assert.True(model.SubscribeCommand.CanExecute(null));
Assert.Equal(45m, model.Usage?.Consumption);
}
[Fact]
public async Task Active_subscription_blocks_duplicate_checkout_and_cancel_requires_confirmation()
{
await using var api = new FakeApi { State = "ACTIVE" };
var model = Model(api);
await model.InitializeAsync();
Assert.False(model.SubscribeCommand.CanExecute(null));
await model.CancelSubscriptionCommand.ExecuteAsync(null);
Assert.Contains("confirmation", model.StatusMessage);
Assert.Equal(HttpMethod.Get, api.LastMethod);
model.ConfirmCancellation = true;
await model.CancelSubscriptionCommand.ExecuteAsync(null);
Assert.EndsWith($"/{api.Id}/cancel", api.LastPath);
Assert.Null(model.CurrentSubscription);
Assert.False(model.ConfirmCancellation);
Assert.True(model.SubscribeCommand.CanExecute(null));
}
[Fact]
public async Task Refresh_uses_server_reconciliation_and_reports_failures_without_fake_success()
{
await using var api = new FakeApi();
var model = Model(api);
await model.InitializeAsync();
api.Fail = true;
await model.RefreshCommand.ExecuteAsync(null);
Assert.Contains("offline", model.StatusMessage);
Assert.False(model.IsBusy);
Assert.Equal(45m, model.Usage?.Consumption);
api.Fail = false;
await model.RefreshCommand.ExecuteAsync(null);
Assert.EndsWith("/refresh", api.LastPath);
Assert.Equal(HttpMethod.Post, api.LastMethod);
Assert.Equal(0m, model.Usage?.Consumption);
}
[Fact]
public async Task Unavailable_offers_and_changing_an_existing_pack_cannot_start_checkout()
{
await using var api = new FakeApi { State = "APPROVAL_PENDING" };
var model = Model(api);
await model.InitializeAsync();
Assert.False(model.SubscribeCommand.CanExecute(null));
model.SelectedOffer = model.Offers[1];
Assert.True(model.SubscribeCommand.CanExecute(null));
model.SelectedOffer = model.SelectedOffer with { Available = false };
Assert.False(model.SubscribeCommand.CanExecute(null));
}
private static SubscriptionsPageViewModel Model(FakeApi api)
=> new(new(api, () => "https://org.example"), _ => Task.FromResult(true));
private sealed class FakeApi : IYavscApiClient
{
public HttpClient Http { get; } = new();
public Guid Id { get; } = Guid.NewGuid();
public string? State { get; set; }
public string ApprovalUrl { get; set; } = "https://www.sandbox.paypal.com/approve";
public bool Fail { get; set; }
public HttpMethod? LastMethod { get; private set; }
public string? LastPath { get; private set; }
public object? LastBody { get; private set; }
public Task<T> CallAsync<T>(HttpMethod method, string path, object? body = null, CancellationToken ct = default)
{
LastMethod = method;
LastPath = path;
LastBody = body;
if (Fail) throw new HttpRequestException("offline");
var pack = (body as CreateResourceSubscriptionRequest)?.Pack ?? "Premium";
var subscription = new ResourceSubscriptionResponse(Id, pack, State ?? "APPROVAL_PENDING", 2.4m, 3000m, null);
object result;
if (body is CreateResourceSubscriptionRequest)
result = new ResourceSubscriptionCheckoutResponse(subscription, ApprovalUrl);
else
{
if (path.EndsWith("/cancel")) State = null;
result = new ResourceSubscriptionsResponse(
[new("Discovery", "Découverte", 1m, 20m, 1.2m, 1000m, 2, true),
new("Premium", "Premium", 2m, 20m, 2.4m, 3000m, 5, true)],
State is null ? [] : [subscription],
new ResourceUsageSummary { Consumption = path.EndsWith("/refresh") ? 0m : 45m });
}
return Task.FromResult(JsonSerializer.Deserialize<T>(JsonSerializer.Serialize(result))!);
}
public Task<T> CallAsync<T>(HttpMethod method, string path, Func<HttpContent> factory, CancellationToken ct = default) => throw new NotSupportedException();
public Task CallAsync(HttpMethod method, string path, object? body = null, CancellationToken ct = default) => throw new NotSupportedException();
public Task CallAsync(HttpMethod method, string path, Func<HttpContent> factory, CancellationToken ct = default) => throw new NotSupportedException();
public Task<byte[]> DownloadAsync(HttpMethod method, string path, CancellationToken ct = default) => throw new NotSupportedException();
public ValueTask DisposeAsync() { Http.Dispose(); return ValueTask.CompletedTask; }
}
}

View file

@ -94,6 +94,7 @@ public static class ServiceCollectionHelpers
services.AddTransient<EstimateValidationPage>();
services.AddTransient<MyFilesPage>();
services.AddTransient<UserProfilePage>();
services.AddTransient<SubscriptionsPage>();
services.AddTransient<PerformerConfigurationPage>();
services.AddTransient<AdministrationPage>();
@ -110,6 +111,7 @@ public static class ServiceCollectionHelpers
services.AddSingleton(invoicesClient);
services.AddSingleton(frontClient);
services.AddSingleton(resourceUsageClient);
services.AddSingleton(new ResourceSubscriptionsApiClient(api, () => settings.Authentication.Authority));
services.AddSingleton(administrationClient);
services.AddSingleton(notificationsClient);
services.AddSingleton(podcastClient);
@ -120,6 +122,7 @@ public static class ServiceCollectionHelpers
services.AddSingleton<AboutPageViewModel>();
services.AddSingleton<HomePageViewModel>();
services.AddTransient<UserProfilePageViewModel>();
services.AddTransient<SubscriptionsPageViewModel>();
services.AddTransient<PerformerConfigurationPageViewModel>();
services.AddTransient<AdministrationPageViewModel>();
services.AddSingleton<SignaturePageViewModel>();

View file

@ -63,6 +63,7 @@ public class ViewLocator : IDataTemplate
EstimateValidationPageViewModel => services.GetRequiredService<EstimateValidationPage>(),
MyFilesViewModel => services.GetRequiredService<MyFilesPage>(),
UserProfilePageViewModel => services.GetRequiredService<UserProfilePage>(),
SubscriptionsPageViewModel => services.GetRequiredService<SubscriptionsPage>(),
PerformerConfigurationPageViewModel => services.GetRequiredService<PerformerConfigurationPage>(),
AdministrationPageViewModel => services.GetRequiredService<AdministrationPage>(),
ChatViewModel => services.GetRequiredService<ChatPage>(),

View file

@ -64,7 +64,7 @@ public partial class AboutPageViewModel : ViewModelBase
private Task OpenTerms() => OpenUrlAsync(TermsUri.AbsoluteUri);
[RelayCommand]
private Task OpenSubscriptions() => OpenUrlAsync(SubscriptionsUri.AbsoluteUri);
private Task OpenSubscriptions() => SubscriptionsPageViewModel.OpenAsync();
private async Task OpenUrlAsync(string url)
{

View file

@ -74,6 +74,7 @@ public class HomePageViewModel : ViewModelBase
OpenBlogs = new AsyncRelayCommand(App.PushBlogsPageAsync);
OpenMyFiles = new AsyncRelayCommand(OpenMyFilesAsync);
OpenProfile = new AsyncRelayCommand(OpenProfileAsync);
OpenSubscriptions = new AsyncRelayCommand(SubscriptionsPageViewModel.OpenAsync);
OpenPerformerConfiguration = new AsyncRelayCommand(OpenPerformerConfigurationAsync);
OpenAdministration = new AsyncRelayCommand(OpenAdministrationAsync, () => SessionStatus.IsAdministrator);
OpenChat = new AsyncRelayCommand(OpenChatAsync);
@ -92,6 +93,7 @@ public class HomePageViewModel : ViewModelBase
public bool SupportsPodcasts => Platform.IsPodcastSupported;
public IAsyncRelayCommand OpenBlogs { get; }
public IAsyncRelayCommand OpenProfile { get; }
public IAsyncRelayCommand OpenSubscriptions { get; }
public IAsyncRelayCommand OpenPerformerConfiguration { get; }
public IAsyncRelayCommand OpenAdministration { get; }
public IAsyncRelayCommand OpenActivities { get; }

View file

@ -0,0 +1,133 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using Avalonia.Controls;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.DependencyInjection;
using Yavsc.Abstract.Resources;
using Yavsc.Api.Client;
namespace PostIt.ViewModels;
public partial class SubscriptionsPageViewModel : ViewModelBase
{
private readonly ResourceSubscriptionsApiClient _client;
private readonly Func<Uri, Task<bool>> _launch;
public SubscriptionsPageViewModel(ResourceSubscriptionsApiClient client, Func<Uri, Task<bool>>? launch = null)
{
_client = client;
_launch = launch ?? LaunchAsync;
}
public ObservableCollection<ResourceSubscriptionOfferResponse> Offers { get; } = [];
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(SubscribeCommand))]
[NotifyCanExecuteChangedFor(nameof(CancelSubscriptionCommand))]
[NotifyCanExecuteChangedFor(nameof(RefreshCommand))]
public partial bool IsBusy { get; set; }
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(SubscribeCommand))]
public partial ResourceSubscriptionOfferResponse? SelectedOffer { get; set; }
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(SubscribeCommand))]
[NotifyCanExecuteChangedFor(nameof(CancelSubscriptionCommand))]
public partial ResourceSubscriptionResponse? CurrentSubscription { get; set; }
[ObservableProperty]
public partial ResourceUsageSummary? Usage { get; set; }
[ObservableProperty]
public partial string? StatusMessage { get; set; }
[ObservableProperty]
public partial bool ConfirmCancellation { get; set; }
public override bool CanNavigateNext { get => false; protected set { } }
public override bool CanNavigatePrevious { get => true; protected set { } }
public Task InitializeAsync() => RunAsync(async () => Apply(await _client.GetAsync()));
private bool CanRefresh() => !IsBusy;
[RelayCommand(CanExecute = nameof(CanRefresh))]
private Task RefreshAsync() => RunAsync(async () =>
{
Apply(await _client.RefreshAsync());
StatusMessage = "État et paiements vérifiés auprès de PayPal.";
});
private bool CanSubscribe() => !IsBusy && SelectedOffer is { Available: true }
&& (CurrentSubscription is null || (CurrentSubscription.Pack == SelectedOffer.Pack
&& CurrentSubscription.State is "CREATING" or "APPROVAL_PENDING"));
[RelayCommand(CanExecute = nameof(CanSubscribe))]
private Task SubscribeAsync() => RunAsync(async () =>
{
var checkout = await _client.CreateAsync(SelectedOffer!.Pack);
CurrentSubscription = checkout.Subscription;
if (checkout.ApprovalUrl is null)
{
Apply(await _client.GetAsync());
StatusMessage = "Abonnement rapproché. Seuls les paiements confirmés accordent des crédits.";
return;
}
if (!Uri.TryCreate(checkout.ApprovalUrl, UriKind.Absolute, out var uri)
|| uri.Scheme != "https" || !string.IsNullOrEmpty(uri.UserInfo) || !uri.IsDefaultPort
|| uri.Host is not ("www.paypal.com" or "www.sandbox.paypal.com"))
throw new InvalidOperationException("Lien d'approbation PayPal invalide.");
if (!await _launch(uri))
throw new InvalidOperationException("Impossible d'ouvrir PayPal. Réessayez pour reprendre l'approbation.");
StatusMessage = "Approuvez l'abonnement mensuel dans PayPal, puis revenez ici et appuyez sur Actualiser. Aucun paiement n'est confirmé par l'ouverture du navigateur.";
});
private bool CanCancelSubscription() => !IsBusy && CurrentSubscription is { State: not "CREATING" };
[RelayCommand(CanExecute = nameof(CanCancelSubscription))]
private Task CancelSubscriptionAsync() => RunAsync(async () =>
{
if (!ConfirmCancellation)
throw new InvalidOperationException("Cochez la confirmation de résiliation avant de continuer.");
Apply(await _client.CancelAsync(CurrentSubscription!.Id));
ConfirmCancellation = false;
StatusMessage = "Abonnement résilié. Les droits déjà acquis restent soumis aux périodes payées.";
});
private void Apply(ResourceSubscriptionsResponse response)
{
var pack = SelectedOffer?.Pack;
Offers.Clear();
foreach (var offer in response.Offers) Offers.Add(offer);
SelectedOffer = Offers.FirstOrDefault(o => o.Pack == pack) ?? Offers.FirstOrDefault();
CurrentSubscription = response.Subscriptions.FirstOrDefault(s => s.State is not ("CANCELLED" or "EXPIRED"));
Usage = response.Usage;
}
private async Task RunAsync(Func<Task> action)
{
IsBusy = true;
StatusMessage = null;
try { await action(); }
catch (Exception ex) { StatusMessage = $"Opération d'abonnement impossible : {ex.Message}"; }
finally { IsBusy = false; }
}
private static async Task<bool> LaunchAsync(Uri uri)
{
var topLevel = TopLevel.GetTopLevel((App.Current as App)?.View);
return topLevel is not null && await topLevel.Launcher.LaunchUriAsync(uri);
}
public static async Task OpenAsync()
{
var app = App.Current as App ?? throw new InvalidOperationException("Application PostIt indisponible.");
var vm = app.ServiceProvider!.GetRequiredService<SubscriptionsPageViewModel>();
await vm.InitializeAsync();
await app.PushPageAsync(vm);
}
}

View file

@ -17,9 +17,7 @@ public partial class UserProfilePageViewModel : ViewModelBase
private readonly YavscApiClient? _api;
private readonly SessionStatusViewModel? _sessionStatus;
private readonly ResourceUsageApiClient? _usageClient;
private readonly AboutPageViewModel _subscriptionLinks;
public IAsyncRelayCommand OpenSubscriptionsCommand => _subscriptionLinks.OpenSubscriptionsCommand;
public string? SubscriptionLinkError => _subscriptionLinks.StatusMessage;
public IAsyncRelayCommand OpenSubscriptionsCommand { get; } = new AsyncRelayCommand(SubscriptionsPageViewModel.OpenAsync);
[ObservableProperty]
public partial ResourceUsageSummary? ResourceUsage { get; set; }
@ -161,8 +159,6 @@ public partial class UserProfilePageViewModel : ViewModelBase
_api = api;
_sessionStatus = sessionStatus;
_usageClient = usageClient;
_subscriptionLinks = new AboutPageViewModel(api?.Settings);
_subscriptionLinks.PropertyChanged += (_, _) => OnPropertyChanged(nameof(SubscriptionLinkError));
}
public UserProfilePageViewModel() : this(null, null) { }

View file

@ -94,6 +94,10 @@
Command="{Binding OpenPerformerConfiguration}"
HorizontalAlignment="Center"
IsEnabled="{Binding SessionStatus.IsLoggedIn}"/>
<Button Content="Mon abonnement PayPal"
Command="{Binding OpenSubscriptions}"
HorizontalAlignment="Center"
IsEnabled="{Binding SessionStatus.IsLoggedIn}"/>
<Button Content="Administration"
Command="{Binding OpenAdministration}"
HorizontalAlignment="Center"

View file

@ -0,0 +1,62 @@
<ContentPage xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:PostIt.ViewModels"
xmlns:resources="using:Yavsc.Abstract.Resources"
x:Class="PostIt.Views.SubscriptionsPage"
x:DataType="vm:SubscriptionsPageViewModel"
Header="Mon abonnement">
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="16" Spacing="12" MaxWidth="720">
<TextBlock Text="Mon abonnement PayPal" FontSize="22" FontWeight="SemiBold"/>
<TextBlock Text="Abonnement mensuel à renouvellement automatique. Choisissez une offre, puis approuvez le paiement sur le site sécurisé de PayPal."
TextWrapping="Wrap"/>
<ProgressBar IsVisible="{Binding IsBusy}" IsIndeterminate="True" Height="4"/>
<TextBlock Text="{Binding StatusMessage}" TextWrapping="Wrap"/>
<Button Command="{Binding RefreshCommand}" HorizontalAlignment="Stretch">
<TextBlock Text="Actualiser les paiements et mon solde" TextWrapping="Wrap"/>
</Button>
<TextBlock Text="Offres de cette instance (EUR par mois)" FontSize="18" FontWeight="SemiBold"/>
<ComboBox x:Name="OfferSelector" ItemsSource="{Binding Offers}" SelectedItem="{Binding SelectedOffer, Mode=TwoWay}"
IsEnabled="{Binding !IsBusy}" HorizontalAlignment="Stretch">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="resources:ResourceSubscriptionOfferResponse">
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<StackPanel DataContext="{Binding SelectedOffer}" Spacing="6">
<TextBlock Text="{Binding PriceExcludingTax, StringFormat='Prix HT : {0:F2} EUR / mois'}"/>
<TextBlock Text="{Binding VatPercent, StringFormat='TVA : {0:F2} %'}"/>
<TextBlock x:Name="OfferPrice" Text="{Binding PriceIncludingTax, StringFormat='Prix TTC : {0:F2} EUR / mois'}" FontWeight="Bold"/>
<TextBlock Text="{Binding MonthlyPoints, StringFormat='Crédit mensuel : {0:F0} points'}"/>
<TextBlock Text="{Binding DiskQuotaMultiplier, StringFormat='Stockage : {0} fois le quota standard pendant les périodes payées'}" TextWrapping="Wrap"/>
<TextBlock Text="Cette offre n'est pas configurée sur cette instance." IsVisible="{Binding !Available}" TextWrapping="Wrap"/>
</StackPanel>
<TextBlock Text="Les paiements mensuels confirmés effacent l'usage dans la limite du crédit de l'offre. Deux tiers du crédit mensuel inutilisé sont reportés sans expiration. Aucun crédit n'est accordé avant vérification du paiement."
TextWrapping="Wrap"/>
<Button Command="{Binding SubscribeCommand}" HorizontalAlignment="Stretch">
<TextBlock Text="Souscrire / reprendre l'approbation PayPal" TextWrapping="Wrap"/>
</Button>
<TextBlock Text="Abonnement en cours" FontSize="18" FontWeight="SemiBold"/>
<TextBlock Text="Aucun abonnement en cours." IsVisible="{Binding CurrentSubscription, Converter={x:Static ObjectConverters.IsNull}}"/>
<StackPanel DataContext="{Binding CurrentSubscription}" Spacing="6">
<TextBlock Text="{Binding Pack, StringFormat='Offre : {0}'}"/>
<TextBlock Text="{Binding State, StringFormat='Etat PayPal : {0}'}"/>
<TextBlock Text="{Binding PriceIncludingTax, StringFormat='Mensualité TTC souscrite : {0:F2} EUR'}"/>
<TextBlock Text="{Binding NextBillingAt, StringFormat='Prochaine échéance : {0:g}'}"/>
</StackPanel>
<TextBlock Text="Résiliez l'abonnement existant avant de changer d'offre. La résiliation arrête les prochains renouvellements, sans effacer les droits déjà acquis."
TextWrapping="Wrap"/>
<CheckBox Content="Je confirme la résiliation de mon abonnement" IsChecked="{Binding ConfirmCancellation}"
IsEnabled="{Binding !IsBusy}"/>
<Button Content="Résilier l'abonnement" Command="{Binding CancelSubscriptionCommand}"/>
<TextBlock Text="Mon solde" FontSize="18" FontWeight="SemiBold"/>
<StackPanel DataContext="{Binding Usage}" Spacing="6">
<TextBlock Text="{Binding Consumption, StringFormat='Consommation : {0:F3} points'}"/>
<TextBlock Text="{Binding CreditBalance, StringFormat='Crédit reporté disponible : {0:F3} points'}"/>
<TextBlock Text="{Binding RemainingConsumption, StringFormat='Solde : {0:F3} points'}"/>
<TextBlock Text="{Binding DiskQuota, StringFormat='Quota de stockage effectif : {0} octets'}"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</ContentPage>

View file

@ -0,0 +1,8 @@
using Avalonia.Controls;
namespace PostIt.Views;
public partial class SubscriptionsPage : ContentPage
{
public SubscriptionsPage() => InitializeComponent();
}

View file

@ -33,7 +33,6 @@
<TextBlock Text="{Binding UsageError}" TextWrapping="Wrap"/>
<Button Content="Abonnements Découverte et Premium"
Command="{Binding OpenSubscriptionsCommand}"/>
<TextBlock Text="{Binding SubscriptionLinkError}" TextWrapping="Wrap"/>
<StackPanel DataContext="{Binding ResourceUsage}" Spacing="4">
<TextBlock Text="{Binding ApiCalls, StringFormat='Appels API : {0:F0}'}"/>
<TextBlock Text="{Binding CpuSeconds, StringFormat='CPU : {0:F3} s'}"/>