Browse Source

fix payment URIs

pull/45/head
Jane Mercer 5 years ago
parent
commit
6422de0382
  1. 8
      src/requestdialog.cpp

8
src/requestdialog.cpp

@ -47,8 +47,8 @@ void RequestDialog::setupDialog(MainWindow* main, QDialog* d, Ui_RequestDialog*
void RequestDialog::showPaymentConfirmation(MainWindow* main, QString paymentURI) { void RequestDialog::showPaymentConfirmation(MainWindow* main, QString paymentURI) {
PaymentURI payInfo = Settings::parseURI(paymentURI); PaymentURI payInfo = Settings::parseURI(paymentURI);
if (!payInfo.error.isEmpty()) { if (!payInfo.error.isEmpty()) {
QMessageBox::critical(main, tr("Error paying zcash URI"), QMessageBox::critical(main, tr("Error paying Pirate URI"),
tr("URI should be of the form 'zcash:<addr>?amt=x&memo=y") + "\n" + payInfo.error); tr("URI should be of the form 'pirate:<addr>?amt=x&memo=y") + "\n" + payInfo.error);
return; return;
} }
@ -124,11 +124,11 @@ void RequestDialog::showRequestZcash(MainWindow* main) {
if (d.exec() == QDialog::Accepted) { if (d.exec() == QDialog::Accepted) {
// Construct a zcash Payment URI with the data and pay it immediately. // Construct a zcash Payment URI with the data and pay it immediately.
QString memoURI = "zcash:" + req.cmbMyAddress->currentText() QString memoURI = "pirate:" + req.cmbMyAddress->currentText()
+ "?amt=" + Settings::getDecimalString(req.txtAmount->text().toDouble()) + "?amt=" + Settings::getDecimalString(req.txtAmount->text().toDouble())
+ "&memo=" + QUrl::toPercentEncoding(req.txtMemo->toPlainText()); + "&memo=" + QUrl::toPercentEncoding(req.txtMemo->toPlainText());
QString sendURI = "zcash:" + AddressBook::addressFromAddressLabel(req.txtFrom->text()) QString sendURI = "pirate:" + AddressBook::addressFromAddressLabel(req.txtFrom->text())
+ "?amt=0.0001" + "?amt=0.0001"
+ "&memo=" + QUrl::toPercentEncoding(memoURI); + "&memo=" + QUrl::toPercentEncoding(memoURI);

Loading…
Cancel
Save