def send(self, window, addr): from vialectrum import paymentrequest r = window.wallet.receive_requests.get(addr) message = r.get('memo', '') if r.get('signature'): pr = paymentrequest.serialize_request(r) else: pr = paymentrequest.make_request(self.config, r) if not pr: return recipient, ok = QInputDialog.getText(window, 'Send request', 'Email invoice to:') if not ok: return recipient = str(recipient) payload = pr.SerializeToString() self.print_error('sending mail to', recipient) try: # FIXME this runs in the GUI thread and blocks it... self.processor.send(recipient, message, payload) except BaseException as e: traceback.print_exc(file=sys.stderr) window.show_message(str(e)) else: window.show_message(_('Request sent.'))
def send(self, window, addr): from vialectrum import paymentrequest r = window.wallet.receive_requests.get(addr) message = r.get('memo', '') if r.get('signature'): pr = paymentrequest.serialize_request(r) else: pr = paymentrequest.make_request(self.config, r) if not pr: return recipient, ok = QInputDialog.getText(window, 'Send request', 'Email invoice to:') if not ok: return recipient = str(recipient) payload = pr.SerializeToString() self.logger.info(f'sending mail to {recipient}') try: # FIXME this runs in the GUI thread and blocks it... self.processor.send(recipient, message, payload) except BaseException as e: self.logger.exception('') window.show_message(str(e)) else: window.show_message(_('Request sent.'))