/usr/include/Wt/Payment/Result is in libwt-dev 3.3.4+dfsg-6ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2012 Emweb bvba, Kessel-Lo, Belgium.
*/
#ifndef WT_PAYMENT_RESULT_H
#define WT_PAYMENT_RESULT_H
#include <Wt/WString>
#include <map>
namespace Wt {
namespace Payment {
/*! \class Result Wt/Payment/Result Wt/Payment/Result
* \brief A class that represents the result of a payment API call.
*
* This class indicates the result of an asynchronous call: error()
* indicates whether there was an error.
*
* \ingroup payment
*/
class WT_API Result
{
public:
/*! \brief Default constructor.
*
* This creates a successful result.
*/
Result() {}
/*! \brief Constructor with an error message.
*
* This creates an unsuccessful result. The error message cannot be
* empty.
*/
Result(const WString& errorMessage);
/*! \brief Returns whether the result indicates success.
*/
bool error() const { return (!errorMessage_.empty()); }
/*! \brief Returns the error message.
*/
WString errorMessage() const { return errorMessage_; }
/*! \brief Sets the request parameters.
*
* For an asynchronous API call that uses name value pairs, this sets
* the underlying values that were sent in the request.
*/
void setRequestMessage(const std::map<std::string, std::string> & msg);
/*! \brief Returns the request parameters.
*
* \sa setRequestMessage()
*/
std::map<std::string, std::string> requestMessage() const;
/*! \brief Sets the response parameters.
*
* For an asynchronous API call that uses name value pairs, this sets
* the underlying values that were returned in the response.
*/
void setResponseMessage(const std::map<std::string, std::string> &msg);
/*! \brief Returns the response parameters.
*
* \sa setResponseMessage()
*/
std::map<std::string, std::string> responseMessage() const;
private:
WString errorMessage_;
std::map<std::string, std::string> responseMessage_;
std::map<std::string, std::string> requestMessage_;
};
/*! \class Approval Wt/Payment/Result Wt/Payment/Result
* \brief A class that represents the result of a payment.
*
* \ingroup payment
*/
class Approval : public Result
{
public:
/*! \brief Enumeration for a payment approval outcome.
*/
enum Outcome {
Denied = 0, //!< The user denied the payment.
Interrupted = 1, //!< The payment process was interrupted.
Accepted = 2 //!< The user accepted the payment.
};
/*! \brief Constructor.
*/
Approval(Outcome outcome);
/*! \brief Constructor for an interrupted payment.
*/
Approval(const WString& errorMessage);
/*! \brief Returns the outcome.
*/
Outcome outcome() const { return outcome_; }
private:
Outcome outcome_;
};
}
}
#endif // WT_PAYMENT_RESULT_H_
|