Merge branch 'master' of https://git.bukova.info/repos/git/EetCpp
This commit is contained in:
+41
-5
@@ -2,35 +2,75 @@
|
||||
#define EETSENDER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
|
||||
#include "eetcpp_global.h"
|
||||
#include "eetrequest.h"
|
||||
#include "eetresult.h"
|
||||
|
||||
#define PRODUCTION_URL "https://prod.eet.cz/eet/services/EETServiceSOAP/v3"
|
||||
#define PLAYGROUND_URL "https://pg.eet.cz/eet/services/EETServiceSOAP/v3"
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class EetSigner;
|
||||
|
||||
/**
|
||||
* @brief The EetSender class Performs send actions.
|
||||
*/
|
||||
class EETCPPSHARED_EXPORT EetSender : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EetSender(QObject *parent = 0);
|
||||
|
||||
/**
|
||||
* @brief Sends request to EET web service
|
||||
* @param request EET data
|
||||
*/
|
||||
void sendRequest(EetRequest *request);
|
||||
/**
|
||||
* @brief Setup certificate for signing EET request data.
|
||||
* @param certPath Path to certificate p12 file. File must contain private key.
|
||||
* @param passwd Password for accesing p12 file.
|
||||
*/
|
||||
void setupSigner(const QString &certPath, const QString &passwd);
|
||||
|
||||
/**
|
||||
* @brief Sets verifing signature of response data.
|
||||
* @param checkSignature true if you wish to verify.
|
||||
*/
|
||||
void setCheckSignature(bool checkSignature);
|
||||
/**
|
||||
* @brief Returns signature verifing state.
|
||||
* @return true if verify.
|
||||
*/
|
||||
bool checkSignature() const;
|
||||
|
||||
/**
|
||||
* @brief Sets comunication with playground EET portal.
|
||||
* @param pg true if you wish to communicate with playground portal.
|
||||
*/
|
||||
void setPlayground(bool pg);
|
||||
|
||||
/**
|
||||
* @brief Returns comunication result.
|
||||
* @return result
|
||||
*/
|
||||
EetResult *resut() const;
|
||||
|
||||
void setTimeout(int timeout);
|
||||
|
||||
static bool m_online;
|
||||
|
||||
private:
|
||||
static const QString ms_nsDef;
|
||||
EetSigner *m_signer;
|
||||
QNetworkAccessManager *m_manager;
|
||||
QTimer *m_timer;
|
||||
bool m_checkSignature;
|
||||
EetResult *m_resut;
|
||||
QString m_serviceUrl;
|
||||
|
||||
bool verifySignature(const QByteArray &repData);
|
||||
|
||||
@@ -38,11 +78,7 @@ private slots:
|
||||
void replyFinished(QNetworkReply *reply);
|
||||
|
||||
signals:
|
||||
void certError();
|
||||
void sendError();
|
||||
void responseRecieved(EetResult *result);
|
||||
void signInvalid();
|
||||
void serviceCertError();
|
||||
void sendFinished();
|
||||
|
||||
public slots:
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user