iberbox  2.1.2
payments.h
Go to the documentation of this file.
1 
10 #ifndef PAYMENTS_H
11 #define PAYMENTS_H
12 
13 #include "iberbox/config.h"
14 
15 #include <memory>
16 #include <vector>
17 #include <string>
18 
19 #ifdef USE_SCAPIX
20 #include <scapix/bridge/object.h>
21 #endif
22 
23 namespace iberbox {
24 
26 typedef std::shared_ptr<SubscriptionInfoData> SubscriptionInfo;
27 typedef std::vector<SubscriptionInfo> SubscriptionInfoDataList;
28 typedef std::shared_ptr<SubscriptionInfoDataList> SubscriptionInfoList;
29 
34 #ifdef USE_SCAPIX
35  : public scapix::bridge::object<SubscriptionInfoData>
36 #endif
37 {
38 public:
44  {
45  SP_NONE = 0,
46  SP_MONTHLY = 1,
47  SP_YEARLY = 2,
48  };
49 
55  {
56  FEATURE_BMAIL = 0x01,
57  FEATURE_BACKUP = 0x02,
58  FEATURE_CLOUD = 0x04,
59  FEATURE_SECRETS = 0x08,
60  };
61 
69  virtual ~SubscriptionInfoData();
70 
75  int getId() const;
80  int getType() const;
85  std::string getName() const;
92  int getPeriod() const;
97  int getAmount() const;
102  int getDiscount() const;
108  int getTotal() const;
113  uint64_t getStorage() const;
118  uint32_t getFeatures() const;
119 
120 protected:
121  int mId;
122  int mType;
123  std::string mName;
124  int mPeriod;
125  int mAmount;
126  int mDiscount;
127  uint64_t mStorage;
128  uint32_t mFeatures;
129 };
130 
132 typedef std::shared_ptr<PaymentMethodInfoData> PaymentMethodInfo;
133 
138 #ifdef USE_SCAPIX
139  : public scapix::bridge::object<PaymentMethodInfoData>
140 #endif
141 {
142 public:
147  {
148  PMT_NONE = 0,
149  PMT_CREDIT_CARD = 1,
150  PMT_RESELLER = 2,
151  PMT_DIRECT_DEBIT = 3,
152  PMT_BANK_TRANSFER = 4,
153  };
154 
159  {
160  PMS_NONE = 0,
161  PMS_ACTIVE = 1,
162  PMS_FAILED = 2,
163  PMS_EXPIRED = 3
164  };
165 
173  virtual ~PaymentMethodInfoData();
174 
180  int getId() const;
187  int getType() const;
193  std::string getName() const;
198  uint64_t getExpirationTime() const;
205  int getStatus() const;
206 
207 protected:
208  int mId;
209  int mType;
210  std::string mName;
211  uint64_t mExpirationTime;
212  int mStatus;
213 };
214 
216 typedef std::shared_ptr<PaymentInfoData> PaymentInfo;
217 
222 #ifdef USE_SCAPIX
223  : public scapix::bridge::object<PaymentInfoData>
224 #endif
225 {
226 public:
230  PaymentInfoData();
234  virtual ~PaymentInfoData();
235 
240  int getId() const;
246  std::string getInfo() const;
251  std::string getSignature() const;
256  std::string getSignatureVersion() const;
262  std::string getUrl() const;
263 
264 protected:
265  int mId;
266  std::string mInfo;
267  std::string mSignature;
268  std::string mSignatureVersion;
269  std::string mUrl;
270 };
271 
273 typedef std::shared_ptr<InvoiceInfoData> InvoiceInfo;
274 typedef std::vector<InvoiceInfo> InvoiceInfoDataList;
275 typedef std::shared_ptr<InvoiceInfoDataList> InvoiceInfoList;
276 
278 #ifdef USE_SCAPIX
279  : public scapix::bridge::object<InvoiceInfoData>
280 #endif
281 {
282 public:
283  InvoiceInfoData();
284  virtual ~InvoiceInfoData();
285 
286  int getId() const;
287  uint64_t getCreationTime() const;
288  std::string getSubject() const;
289  int getTotal() const;
290  bool isPaid() const;
291 
292 protected:
293  int mId;
294  uint64_t mCreationTime;
295  std::string mSubject;
296  int mTotal;
297  int mPaid;
298 };
299 
301 typedef std::shared_ptr<InvoicingInfoData> InvoicingInfo;
302 
304 #ifdef USE_SCAPIX
305  : public scapix::bridge::object<InvoicingInfoData>
306 #endif
307 {
308 public:
310  virtual ~InvoicingInfoData();
311 
312  int getId() const;
313  std::string getName() const;
314  std::string getAddress() const;
315  std::string getAddress2() const;
316  std::string getNIF() const;
317  SubscriptionInfo getSubscriptionInfo() const;
318  uint64_t getRenewTime() const;
319  bool hasCredit() const;
320  PaymentMethodInfo getPaymentMethodInfo() const;
321  InvoiceInfoList getInvoices() const;
322 
323 protected:
324  int mId;
325  std::string mName;
326  std::string mAddress;
327  std::string mAddress2;
328  std::string mNIF;
329  SubscriptionInfo mSubscriptionInfo;
330  uint64_t mRenewTime;
331  int mHasCredit;
332  PaymentMethodInfo mPaymentMethod;
333  InvoiceInfoList mInvoices;
334 };
335 
336 
337 }
338 
339 #endif // PAYMENTS_H
virtual ~SubscriptionInfoData()
Destroys the Subscription Info Data object.
Definition: payments.h:277
std::shared_ptr< PaymentMethodInfoData > PaymentMethodInfo
Definition: payments.h:131
Definition: payments.h:303
The iberbox namespace.
Definition: task.h:21
int getTotal() const
Gets the total price of the subscription for the current period.
Backup feature.
Definition: payments.h:57
std::shared_ptr< InvoicingInfoData > InvoicingInfo
Definition: payments.h:300
Monthly subscription.
Definition: payments.h:46
std::shared_ptr< InvoiceInfoDataList > InvoiceInfoList
Definition: payments.h:275
Secret spaces feature.
Definition: payments.h:59
The Payment Info Data class.
Definition: payments.h:221
std::shared_ptr< SubscriptionInfoData > SubscriptionInfo
Definition: payments.h:25
std::string getName() const
Gets the name of the subscription option.
SubscriptionPeriod
The Subscription Period enum.
Definition: payments.h:43
uint32_t getFeatures() const
Gets account features bitmap.
int getDiscount() const
Gets the discount price over the fee of the subscription for the current period.
std::shared_ptr< PaymentInfoData > PaymentInfo
Definition: payments.h:215
uint64_t getStorage() const
Gets the contracted storage with the subscription.
std::vector< InvoiceInfo > InvoiceInfoDataList
Definition: payments.h:274
std::shared_ptr< InvoiceInfoData > InvoiceInfo
Definition: payments.h:272
int getAmount() const
Gets the fee of the subscription for the current period.
FeatureType
The Feature Type enum.
Definition: payments.h:54
PaymentMethodStatus
The Payment Method Status enum.
Definition: payments.h:158
No subscription period.
Definition: payments.h:45
Cloud feature.
Definition: payments.h:58
int getId() const
Gets the identifier of the subscription.
PaymentMethodType
The Payment Method Type enum.
Definition: payments.h:146
Yearly subscription.
Definition: payments.h:47
std::shared_ptr< SubscriptionInfoDataList > SubscriptionInfoList
Definition: payments.h:28
Bmail feature.
Definition: payments.h:56
std::vector< SubscriptionInfo > SubscriptionInfoDataList
Definition: payments.h:27
int getPeriod() const
Gets the subscription period.
The Subscription Info Data class.
Definition: payments.h:33
SubscriptionInfoData()
Constructs a new Subscription Info Data object.
The Payment Info Data class.
Definition: payments.h:137
int getType() const
Gets the type of the subscription.