     
     private let footerText = "Don't forget to add your subscription terms and conditions. Read more about this here: https://www.revenuecat.com/blog/schedule-2-section-3-8-b"
     
+    @State private var error: NSError?
+    @State private var displayError: Bool = false
+
     var body: some View {
         NavigationView {
             ZStack {

                                    /// - If the user didn't cancel and there wasn't an error with the purchase, close the paywall
                                    if !userCancelled, error == nil {
                                        isPresented = false
                                    }
                                }
                            }

        }
        .navigationViewStyle(StackNavigationViewStyle())
        .colorScheme(.dark)
        .alert(
            isPresented: self.$displayError,
            error: self.error,
            actions: { _ in
                Button(role: .cancel,
                       action: { self.displayError = false },
                       label: { Text("OK") })
            },
            message: { Text($0.recoverySuggestion ?? "Please try again") }
        )
    }
}

