Line data Source code
1 : // Copyright (c) 2011-2014 The Bitcoin 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 : #include "paymentrequest.pb.h"
9 :
10 : #include "base58.h"
11 :
12 : #include <openssl/x509.h>
13 :
14 : #include <QByteArray>
15 : #include <QList>
16 : #include <QString>
17 :
18 : //
19 : // Wraps dumb protocol buffer paymentRequest
20 : // with extra methods
21 : //
22 :
23 119 : class PaymentRequestPlus
24 : {
25 : public:
26 31 : PaymentRequestPlus() { }
27 :
28 : bool parse(const QByteArray& data);
29 : bool SerializeToString(std::string* output) const;
30 :
31 : bool IsInitialized() const;
32 : // Returns true if merchant's identity is authenticated, and
33 : // returns human-readable merchant identity in merchant
34 : bool getMerchant(X509_STORE* certStore, QString& merchant) const;
35 :
36 : // Returns list of outputs, amount
37 : QList<std::pair<CScript,CAmount> > getPayTo() const;
38 :
39 6 : const payments::PaymentDetails& getDetails() const { return details; }
40 :
41 : private:
42 : payments::PaymentRequest paymentRequest;
43 : payments::PaymentDetails details;
44 : };
45 :
46 : #endif // BITCOIN_QT_PAYMENTREQUESTPLUS_H
|