verification before payment and email fixes
This commit is contained in:
@@ -17,6 +17,9 @@ import 'package:pweb/widgets/sidebar/destinations.dart';
|
||||
import 'package:pweb/services/posthog.dart';
|
||||
import 'package:pweb/widgets/dialogs/payment_status_dialog.dart';
|
||||
import 'package:pweb/controllers/payment_page.dart';
|
||||
import 'package:pweb/controllers/payout_verification.dart';
|
||||
import 'package:pweb/utils/payment/payout_verification_flow.dart';
|
||||
import 'package:pweb/models/control_state.dart';
|
||||
|
||||
|
||||
class PaymentPage extends StatefulWidget {
|
||||
@@ -98,8 +101,15 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
final flowProvider = context.read<PaymentFlowProvider>();
|
||||
final paymentProvider = context.read<PaymentProvider>();
|
||||
final controller = context.read<PaymentPageController>();
|
||||
final verificationController = context.read<PayoutVerificationController>();
|
||||
if (paymentProvider.isLoading) return;
|
||||
|
||||
final verified = await runPayoutVerification(
|
||||
context: context,
|
||||
controller: verificationController,
|
||||
);
|
||||
if (!verified || !mounted) return;
|
||||
|
||||
final isSuccess = await controller.sendPayment();
|
||||
if (!mounted) return;
|
||||
|
||||
@@ -117,11 +127,16 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
Widget build(BuildContext context) {
|
||||
final methodsProvider = context.watch<PaymentMethodsProvider>();
|
||||
final recipientProvider = context.watch<RecipientsProvider>();
|
||||
final verificationController =
|
||||
context.watch<PayoutVerificationController>();
|
||||
final recipient = recipientProvider.currentObject;
|
||||
final filteredRecipients = filterRecipients(
|
||||
recipients: recipientProvider.recipients,
|
||||
query: _query,
|
||||
);
|
||||
final sendState = verificationController.isCooldownActive
|
||||
? ControlState.disabled
|
||||
: ControlState.enabled;
|
||||
|
||||
return PaymentPageBody(
|
||||
onBack: widget.onBack,
|
||||
@@ -132,6 +147,9 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
searchQuery: _query,
|
||||
filteredRecipients: filteredRecipients,
|
||||
methodsProvider: methodsProvider,
|
||||
sendState: sendState,
|
||||
cooldownRemainingSeconds:
|
||||
verificationController.cooldownRemainingSeconds,
|
||||
onWalletSelected: context.read<WalletsController>().selectWallet,
|
||||
searchController: _searchController,
|
||||
searchFocusNode: _searchFocusNode,
|
||||
|
||||
Reference in New Issue
Block a user