@@ -313,24 +313,31 @@ class _ConfirmTransactionViewState
313313 }
314314 }
315315
316+ /// Firo private (spark) sends carry the recipient in sparkRecipients.
317+ String ? get _recipientAddress =>
318+ widget.txData.recipients? .firstOrNull? .address ??
319+ widget.txData.sparkRecipients? .firstOrNull? .address;
320+
321+ OpenCryptoPaySendHandler ? get _activeOcp {
322+ final ocp = widget.openCryptoPayHandler;
323+ return ocp != null && ocp.isActivePaymentFor (_recipientAddress)
324+ ? ocp
325+ : null ;
326+ }
327+
316328 Future <void > _attemptSend (BuildContext context) async {
317329 final wallet = ref.read (pWallets).getWallet (walletId);
318330 final coin = wallet.info.coin;
319331
320- final ocp = widget.openCryptoPayHandler;
321- // Firo private (spark) sends carry the recipient in sparkRecipients.
322- final recipientAddress =
323- widget.txData.recipients? .firstOrNull? .address ??
324- widget.txData.sparkRecipients? .firstOrNull? .address;
325- final isOcp = ocp != null && ocp.isActivePaymentFor (recipientAddress);
332+ final ocp = _activeOcp;
326333
327- if (isOcp && ocp.isQuoteExpired) {
334+ if (ocp != null && ocp.isQuoteExpired) {
328335 // Abort before anything is broadcast or submitted (both proof types).
329336 await ocp.showQuoteExpiredError (context, paymentNotSent: true );
330337 return ;
331338 }
332339
333- if (isOcp && ! ocp.requiresBroadcast) {
340+ if (ocp != null && ! ocp.requiresBroadcast) {
334341 // Signed-hex proof type: the provider broadcasts the transaction, so
335342 // do NOT broadcast here. The txid proof type falls through to the
336343 // normal confirmSend flow below.
@@ -467,7 +474,7 @@ class _ConfirmTransactionViewState
467474
468475 widget.onSuccess.call ();
469476
470- if (isOcp && txids.isNotEmpty) {
477+ if (ocp != null && txids.isNotEmpty) {
471478 // Broadcast (txid) proof type: submit the txid to the
472479 // OpenCryptoPay provider.
473480 unawaited (ocp.submitProof (context, txids.first));
@@ -746,6 +753,7 @@ class _ConfirmTransactionViewState
746753
747754 final String unit;
748755 final wallet = ref.watch (pWallets).getWallet (walletId);
756+ final businessLines = _activeOcp? .businessLines ?? const < String > [];
749757 if (widget.isTokenTx) {
750758 if (wallet is SolanaWallet ) {
751759 // For Solana tokens, use the Solana token wallet provider or TxData as fallback.
@@ -894,21 +902,31 @@ class _ConfirmTransactionViewState
894902 Text (
895903 widget.isPaynymTransaction
896904 ? widget.txData.paynymAccountLite! .nymName
897- : widget
898- .txData
899- .recipients
900- ? .firstOrNull
901- ? .address ??
902- widget
903- .txData
904- .sparkRecipients!
905- .first
906- .address,
905+ : _recipientAddress! ,
907906 style: STextStyles .itemSubtitle12 (context),
908907 ),
909908 ],
910909 ),
911910 ),
911+ if (businessLines.isNotEmpty) const SizedBox (height: 12 ),
912+ if (businessLines.isNotEmpty)
913+ RoundedWhiteContainer (
914+ child: Column (
915+ crossAxisAlignment: CrossAxisAlignment .stretch,
916+ children: [
917+ Text (
918+ "Business" ,
919+ style: STextStyles .smallMed12 (context),
920+ ),
921+ const SizedBox (height: 4 ),
922+ for (final line in businessLines)
923+ SelectableText (
924+ line,
925+ style: STextStyles .itemSubtitle12 (context),
926+ ),
927+ ],
928+ ),
929+ ),
912930 const SizedBox (height: 12 ),
913931 RoundedWhiteContainer (
914932 child: Row (
@@ -1244,16 +1262,7 @@ class _ConfirmTransactionViewState
12441262 // TODO: [prio=med] spark transaction specifics - better handling
12451263 widget.isPaynymTransaction
12461264 ? widget.txData.paynymAccountLite! .nymName
1247- : widget
1248- .txData
1249- .recipients
1250- ? .firstOrNull
1251- ? .address ??
1252- widget
1253- .txData
1254- .sparkRecipients!
1255- .first
1256- .address,
1265+ : _recipientAddress! ,
12571266 style:
12581267 STextStyles .desktopTextExtraExtraSmall (
12591268 context,
@@ -1266,6 +1275,42 @@ class _ConfirmTransactionViewState
12661275 ],
12671276 ),
12681277 ),
1278+ if (businessLines.isNotEmpty)
1279+ Container (
1280+ height: 1 ,
1281+ color: Theme .of (
1282+ context,
1283+ ).extension < StackColors > ()! .background,
1284+ ),
1285+ if (businessLines.isNotEmpty)
1286+ Padding (
1287+ padding: const EdgeInsets .all (12 ),
1288+ child: Column (
1289+ mainAxisSize: MainAxisSize .min,
1290+ crossAxisAlignment: CrossAxisAlignment .start,
1291+ children: [
1292+ Text (
1293+ "Business" ,
1294+ style: STextStyles .desktopTextExtraExtraSmall (
1295+ context,
1296+ ),
1297+ ),
1298+ const SizedBox (height: 2 ),
1299+ for (final line in businessLines)
1300+ SelectableText (
1301+ line,
1302+ style:
1303+ STextStyles .desktopTextExtraExtraSmall (
1304+ context,
1305+ ).copyWith (
1306+ color: Theme .of (
1307+ context,
1308+ ).extension < StackColors > ()! .textDark,
1309+ ),
1310+ ),
1311+ ],
1312+ ),
1313+ ),
12691314 if (widget.isPaynymTransaction)
12701315 Container (
12711316 height: 1 ,
0 commit comments