Bitcoin ABC  0.29.2
P2P Digital Currency
paymentrequestplus.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_PAYMENTREQUESTPLUS_H
6 #define BITCOIN_QT_PAYMENTREQUESTPLUS_H
7 
8 #pragma GCC diagnostic push
9 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
10 #include <qt/paymentrequest.pb.h>
11 #pragma GCC diagnostic pop
12 
13 #include <consensus/amount.h>
14 #include <script/script.h>
15 
16 #include <openssl/x509.h>
17 
18 #include <QByteArray>
19 #include <QList>
20 #include <QString>
21 
22 static const bool DEFAULT_SELFSIGNED_ROOTCERTS = false;
23 
24 //
25 // Wraps dumb protocol buffer paymentRequest with extra methods
26 //
27 
29 public:
31 
32  bool parse(const QByteArray &data);
33  bool SerializeToString(std::string *output) const;
34 
35  bool IsInitialized() const;
36  // Returns true if merchant's identity is authenticated, and returns
37  // human-readable merchant identity in merchant
38  bool getMerchant(X509_STORE *certStore, QString &merchant) const;
39 
40  // Returns list of outputs, amount
41  QList<std::pair<CScript, Amount>> getPayTo() const;
42 
43  const payments::PaymentDetails &getDetails() const { return details; }
44 
45 private:
46  payments::PaymentRequest paymentRequest;
47  payments::PaymentDetails details;
48 };
49 
50 #endif // BITCOIN_QT_PAYMENTREQUESTPLUS_H
QList< std::pair< CScript, Amount > > getPayTo() const
bool getMerchant(X509_STORE *certStore, QString &merchant) const
payments::PaymentDetails details
bool parse(const QByteArray &data)
const payments::PaymentDetails & getDetails() const
payments::PaymentRequest paymentRequest
bool SerializeToString(std::string *output) const
static const bool DEFAULT_SELFSIGNED_ROOTCERTS