aboutsummaryrefslogtreecommitdiff
path: root/src/qt/paymentserver.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/paymentserver.h')
-rw-r--r--src/qt/paymentserver.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h
index d335db9c85..eba195e3bd 100644
--- a/src/qt/paymentserver.h
+++ b/src/qt/paymentserver.h
@@ -32,7 +32,13 @@
// sends them to the server.
//
+#if defined(HAVE_CONFIG_H)
+#include <config/bitcoin-config.h>
+#endif
+
+#ifdef ENABLE_BIP70
#include <qt/paymentrequestplus.h>
+#endif
#include <qt/walletmodel.h>
#include <QObject>
@@ -73,6 +79,7 @@ public:
explicit PaymentServer(QObject* parent, bool startLocalServer = true);
~PaymentServer();
+#ifdef ENABLE_BIP70
// Load root certificate authorities. Pass nullptr (default)
// to read from the file specified in the -rootcertificates setting,
// or, if that's not set, to use the system default root certificates.
@@ -82,10 +89,12 @@ public:
// Return certificate store
static X509_STORE* getCertStore();
+#endif
// OptionsModel is used for getting proxy settings and display unit
void setOptionsModel(OptionsModel *optionsModel);
+#ifdef ENABLE_BIP70
// Verify that the payment request network matches the client network
static bool verifyNetwork(interfaces::Node& node, const payments::PaymentDetails& requestDetails);
// Verify if the payment request is expired
@@ -94,13 +103,16 @@ public:
static bool verifySize(qint64 requestSize);
// Verify the payment request amount is valid
static bool verifyAmount(const CAmount& requestAmount);
+#endif
Q_SIGNALS:
// Fired when a valid payment request is received
void receivedPaymentRequest(SendCoinsRecipient);
+#ifdef ENABLE_BIP70
// Fired when a valid PaymentACK is received
void receivedPaymentACK(const QString &paymentACKMsg);
+#endif
// Fired when a message should be reported to the user
void message(const QString &title, const QString &message, unsigned int style);
@@ -110,17 +122,21 @@ public Q_SLOTS:
// to display payment requests to the user
void uiReady();
+#ifdef ENABLE_BIP70
// Submit Payment message to a merchant, get back PaymentACK:
void fetchPaymentACK(WalletModel* walletModel, const SendCoinsRecipient& recipient, QByteArray transaction);
+#endif
// Handle an incoming URI, URI with local file scheme or file
void handleURIOrFile(const QString& s);
private Q_SLOTS:
void handleURIConnection();
+#ifdef ENABLE_BIP70
void netRequestFinished(QNetworkReply*);
void reportSslErrors(QNetworkReply*, const QList<QSslError> &);
void handlePaymentACK(const QString& paymentACKMsg);
+#endif
protected:
// Constructor registers this on the parent QApplication to
@@ -128,17 +144,21 @@ protected:
bool eventFilter(QObject *object, QEvent *event);
private:
+#ifdef ENABLE_BIP70
static bool readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request);
bool processPaymentRequest(const PaymentRequestPlus& request, SendCoinsRecipient& recipient);
void fetchRequest(const QUrl& url);
// Setup networking
void initNetManager();
+#endif
bool saveURIs; // true during startup
QLocalServer* uriServer;
+#ifdef ENABLE_BIP70
QNetworkAccessManager* netManager; // Used to fetch payment requests
+#endif
OptionsModel *optionsModel;
};