MagicSmoke
$VERSION$
|
Use a voucher to pay for an order. More...
#include <srcMTUseVoucher.h>
Public Member Functions | |
MTUseVoucher () | |
default constructor: generates an invalid transaction More... | |
MTUseVoucher (const MTUseVoucher &) | |
copy constructor: the two copies share their state More... | |
virtual | ~MTUseVoucher () |
deletes this instance More... | |
Q_SLOT Nullable< qint64 > | getamount () const |
The amount that was deducted. More... | |
Q_SLOT Nullable< MOOrder > | getorder () const |
The full order object after the transaction. More... | |
Q_SLOT Nullable< MOVoucher > | getvoucher () const |
The full voucher object after the transaction. More... | |
MTUseVoucher & | operator= (const MTUseVoucher &) |
copy assignment: the copy shares the state of the original object More... | |
Static Public Member Functions | |
static MTUseVoucher | asyncQuery (const qint64 &aorderid, const QString &avoucherid, QString iface="MagicSmoke") |
emits the query over the network and returns the transaction object, use isFinished() to check for the transaction's state More... | |
static MTUseVoucher | query (const qint64 &aorderid, const QString &avoucherid, QString iface="MagicSmoke") |
emits the query over the network and returns the finished transaction object More... | |
Static Public Member Functions inherited from MTransaction | |
static void | setStartStopActions (const MTStartStop &start, const MTStartStop &stop) |
set actions to be executed at start/stop More... | |
Protected Member Functions | |
MTUseVoucher (const qint64 &aorderid, const QString &avoucherid, QString iface) | |
generates an instance from its properties More... | |
virtual void | endQuery () |
Protected Member Functions inherited from MTransaction | |
MTransaction (QString iface=QString()) | |
internal: construct the transaction More... | |
MTransaction (const WTransaction &) | |
internal: copy the transaction More... | |
MTransaction (const MTransaction &) | |
internal: copy the transaction More... | |
QByteArray | executeQuery (QString, QByteArray) |
internal: extend executeQuery to show a wait cursor More... | |
Friends | |
class | MTUseVoucher_Private |
Use a voucher to pay for an order.
The system automatically deducts as much as is due for the order or as much as is left on the voucher - whichever is lower. If the voucher is not paid for the transaction will fail. The transaction will never transfer money from an order back to the voucher. If the voucher is no longer valid the transaction will fail.
|
explicitprotected |
generates an instance from its properties
aorderid | ID of the order that is to be paid for |
avoucherid | ID of the voucher that is to be used for payment |
iface | ID of the interface that the transaction will be sent on |
References MTUseVoucher_Private::in_orderid, MTUseVoucher_Private::in_voucherid, and MTUseVoucher_Private.
MTUseVoucher::MTUseVoucher | ( | ) |
default constructor: generates an invalid transaction
References MTUseVoucher_Private.
MTUseVoucher::MTUseVoucher | ( | const MTUseVoucher & | t | ) |
copy constructor: the two copies share their state
References MTUseVoucher_Private::attach().
|
virtual |
deletes this instance
References MTUseVoucher_Private::detach().
|
static |
emits the query over the network and returns the transaction object, use isFinished() to check for the transaction's state
aorderid | ID of the order that is to be paid for |
avoucherid | ID of the voucher that is to be used for payment |
iface | ID of the interface that the transaction will be sent on |
|
protectedvirtual |
Nullable< qint64 > MTUseVoucher::getamount | ( | ) | const |
The amount that was deducted.
References MTUseVoucher_Private::out_amount.
Nullable< MOOrder > MTUseVoucher::getorder | ( | ) | const |
The full order object after the transaction.
References MTUseVoucher_Private::out_order.
Nullable< MOVoucher > MTUseVoucher::getvoucher | ( | ) | const |
The full voucher object after the transaction.
References MTUseVoucher_Private::out_voucher.
MTUseVoucher & MTUseVoucher::operator= | ( | const MTUseVoucher & | t | ) |
copy assignment: the copy shares the state of the original object
References MTUseVoucher_Private::attach(), and MTUseVoucher_Private::detach().
|
static |
emits the query over the network and returns the finished transaction object
aorderid | ID of the order that is to be paid for |
avoucherid | ID of the voucher that is to be used for payment |
iface | ID of the interface that the transaction will be sent on |
Referenced by MInterface::queryUseVoucher().
|
friend |
Referenced by MTUseVoucher().