@@ -449,7 +449,8 @@ def update_fields(self):
449449 lock_recipient = pi .type in [PaymentIdentifierType .LNURL , PaymentIdentifierType .LNURLW ,
450450 PaymentIdentifierType .LNURLP , PaymentIdentifierType .LNADDR ,
451451 PaymentIdentifierType .OPENALIAS , PaymentIdentifierType .BIP70 ,
452- PaymentIdentifierType .BIP21 , PaymentIdentifierType .BOLT11 ] and not pi .need_resolve ()
452+ PaymentIdentifierType .BIP21 , PaymentIdentifierType .BOLT11 ,
453+ PaymentIdentifierType .BOLT12_OFFER ] and not pi .need_resolve ()
453454 lock_amount = pi .is_amount_locked ()
454455 lock_max = lock_amount or pi .type not in [PaymentIdentifierType .SPK , PaymentIdentifierType .BIP21 ]
455456
@@ -491,8 +492,9 @@ def update_fields(self):
491492 amount_valid = is_spk_script or bool (self .amount_e .get_amount ())
492493
493494 self .send_button .setEnabled (not pi_unusable and amount_valid and not pi .has_expired ())
494- self .save_button .setEnabled (not pi_unusable and not is_spk_script and not pi .has_expired () and \
495- pi .type not in [PaymentIdentifierType .LNURLP , PaymentIdentifierType .LNADDR ])
495+ self .save_button .setEnabled (not pi_unusable and not is_spk_script and pi .type not in [ \
496+ PaymentIdentifierType .LNURLP , PaymentIdentifierType .LNADDR , PaymentIdentifierType .BOLT12_OFFER
497+ ])
496498
497499 self .invoice_error .setText (_ ('Expired' ) if pi .has_expired () else '' )
498500
@@ -580,6 +582,8 @@ def on_finalize_done(self, pi: PaymentIdentifier):
580582 self .show_error (pi .error )
581583 return
582584 invoice = pi .bolt11
585+ if not invoice and pi .bolt12_offer :
586+ invoice = Invoice .from_bolt12_invoice_tlv (pi .bolt12_invoice_tlv )
583587 self .pending_invoice = invoice
584588 self .logger .debug (f'after finalize invoice: { invoice !r} ' )
585589 self .do_pay_invoice (invoice )
0 commit comments