Sfoglia il codice sorgente

Show error dialog to Stripe customers

Vishnu Mohandas 4 anni fa
parent
commit
43a7e074ba
2 ha cambiato i file con 9 aggiunte e 3 eliminazioni
  1. 4 3
      lib/models/subscription.dart
  2. 5 0
      lib/ui/subscription_page.dart

+ 4 - 3
lib/models/subscription.dart

@@ -1,6 +1,7 @@
 import 'dart:convert';
 
 const kFreeProductID = "free";
+const kStripe = "stripe";
 
 class Subscription {
   final int id;
@@ -25,10 +26,10 @@ class Subscription {
 
   Subscription copyWith({
     int id,
-    int productID,
+    String productID,
     int storage,
-    int originalTransactionID,
-    int paymentProvider,
+    String originalTransactionID,
+    String paymentProvider,
     int expiryTime,
   }) {
     return Subscription(

+ 5 - 0
lib/ui/subscription_page.dart

@@ -324,6 +324,11 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
               if (isActive) {
                 return;
               }
+              if (_currentSubscription.paymentProvider == kStripe) {
+                showErrorDialog(context, "sorry",
+                    "please visit photos.ente.io to manage your subscription");
+                return;
+              }
               await _dialog.show();
               if (_usageFuture != null) {
                 final usage = await _usageFuture;