35 lines
766 B
C++
35 lines
766 B
C++
#ifndef SHOP_EETV4ADAPTER_H
|
|
#define SHOP_EETV4ADAPTER_H
|
|
|
|
#include <QUrl>
|
|
|
|
#include <eetv4request.h>
|
|
|
|
#include "../data/voucher.h"
|
|
|
|
struct EetV4ShopConfig
|
|
{
|
|
QUrl endpoint;
|
|
QString taxpayerEic;
|
|
qint32 unitId{0};
|
|
QString cashRegisterId;
|
|
int timeoutMilliseconds{30000};
|
|
bool verificationMode{true};
|
|
|
|
bool validate(QString *error = nullptr) const;
|
|
};
|
|
|
|
class EetV4ShopAdapter
|
|
{
|
|
public:
|
|
static bool createRequest(const Voucher &voucher,
|
|
const EetV4ShopConfig &config,
|
|
EetV4SaleRequest *request,
|
|
QString *error = nullptr);
|
|
|
|
private:
|
|
static bool amountText(const QDecDouble &amount, QString *text, QString *error);
|
|
};
|
|
|
|
#endif // SHOP_EETV4ADAPTER_H
|