Added dialog window to confirm or reject processed payment
This commit is contained in:
@@ -13,6 +13,7 @@ import 'package:pshared/provider/payment/wallets.dart';
|
||||
import 'package:pweb/pages/payment_methods/payment_page/body.dart';
|
||||
import 'package:pweb/widgets/sidebar/destinations.dart';
|
||||
import 'package:pweb/services/posthog.dart';
|
||||
import 'package:pweb/widgets/dialogs/payment_status_dialog.dart';
|
||||
|
||||
|
||||
class PaymentPage extends StatefulWidget {
|
||||
@@ -83,13 +84,13 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
final paymentProvider = context.read<PaymentProvider>();
|
||||
if (paymentProvider.isLoading) return;
|
||||
|
||||
paymentProvider.pay().then((_) {
|
||||
PosthogService.paymentInitiated(method: flowProvider.selectedType);
|
||||
}).catchError((error) {
|
||||
paymentProvider.pay().then((payment) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(error.toString())),
|
||||
);
|
||||
final isSuccess = payment != null && paymentProvider.error == null;
|
||||
showPaymentStatusDialog(context, isSuccess: isSuccess);
|
||||
if (isSuccess) {
|
||||
PosthogService.paymentInitiated(method: flowProvider.selectedType);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user