Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OTPaymentPlan.hpp
Go to the documentation of this file.
1 /************************************************************
2  *
3  * OTPaymentPlan.hpp
4  *
5  */
6 
7 /************************************************************
8  -----BEGIN PGP SIGNED MESSAGE-----
9  Hash: SHA1
10 
11  * OPEN TRANSACTIONS
12  *
13  * Financial Cryptography and Digital Cash
14  * Library, Protocol, API, Server, CLI, GUI
15  *
16  * -- Anonymous Numbered Accounts.
17  * -- Untraceable Digital Cash.
18  * -- Triple-Signed Receipts.
19  * -- Cheques, Vouchers, Transfers, Inboxes.
20  * -- Basket Currencies, Markets, Payment Plans.
21  * -- Signed, XML, Ricardian-style Contracts.
22  * -- Scripted smart contracts.
23  *
24  * Copyright (C) 2010-2013 by "Fellow Traveler" (A pseudonym)
25  *
26  * EMAIL:
28  *
29  * BITCOIN: 1NtTPVVjDsUfDWybS4BwvHpG2pdS9RnYyQ
30  *
31  * KEY FINGERPRINT (PGP Key in license file):
32  * 9DD5 90EB 9292 4B48 0484 7910 0308 00ED F951 BB8E
33  *
34  * OFFICIAL PROJECT WIKI(s):
35  * https://github.com/FellowTraveler/Moneychanger
36  * https://github.com/FellowTraveler/Open-Transactions/wiki
37  *
38  * WEBSITE:
39  * http://www.OpenTransactions.org/
40  *
41  * Components and licensing:
42  * -- Moneychanger..A Java client GUI.....LICENSE:.....GPLv3
43  * -- otlib.........A class library.......LICENSE:...LAGPLv3
44  * -- otapi.........A client API..........LICENSE:...LAGPLv3
45  * -- opentxs/ot....Command-line client...LICENSE:...LAGPLv3
46  * -- otserver......Server Application....LICENSE:....AGPLv3
47  * Github.com/FellowTraveler/Open-Transactions/wiki/Components
48  *
49  * All of the above OT components were designed and written by
50  * Fellow Traveler, with the exception of Moneychanger, which
51  * was contracted out to Vicky C ([email protected]).
52  * The open-source community has since actively contributed.
53  *
54  * -----------------------------------------------------
55  *
56  * LICENSE:
57  * This program is free software: you can redistribute it
58  * and/or modify it under the terms of the GNU Affero
59  * General Public License as published by the Free Software
60  * Foundation, either version 3 of the License, or (at your
61  * option) any later version.
62  *
63  * ADDITIONAL PERMISSION under the GNU Affero GPL version 3
64  * section 7: (This paragraph applies only to the LAGPLv3
65  * components listed above.) If you modify this Program, or
66  * any covered work, by linking or combining it with other
67  * code, such other code is not for that reason alone subject
68  * to any of the requirements of the GNU Affero GPL version 3.
69  * (==> This means if you are only using the OT API, then you
70  * don't have to open-source your code--only your changes to
71  * Open-Transactions itself must be open source. Similar to
72  * LGPLv3, except it applies to software-as-a-service, not
73  * just to distributing binaries.)
74  *
75  * Extra WAIVER for OpenSSL, Lucre, and all other libraries
76  * used by Open Transactions: This program is released under
77  * the AGPL with the additional exemption that compiling,
78  * linking, and/or using OpenSSL is allowed. The same is true
79  * for any other open source libraries included in this
80  * project: complete waiver from the AGPL is hereby granted to
81  * compile, link, and/or use them with Open-Transactions,
82  * according to their own terms, as long as the rest of the
83  * Open-Transactions terms remain respected, with regard to
84  * the Open-Transactions code itself.
85  *
86  * Lucre License:
87  * This code is also "dual-license", meaning that Ben Lau-
88  * rie's license must also be included and respected, since
89  * the code for Lucre is also included with Open Transactions.
90  * See Open-Transactions/src/otlib/lucre/LUCRE_LICENSE.txt
91  * The Laurie requirements are light, but if there is any
92  * problem with his license, simply remove the Lucre code.
93  * Although there are no other blind token algorithms in Open
94  * Transactions (yet. credlib is coming), the other functions
95  * will continue to operate.
96  * See Lucre on Github: https://github.com/benlaurie/lucre
97  * -----------------------------------------------------
98  * You should have received a copy of the GNU Affero General
99  * Public License along with this program. If not, see:
100  * http://www.gnu.org/licenses/
101  *
102  * If you would like to use this software outside of the free
103  * software license, please contact FellowTraveler.
104  * (Unfortunately many will run anonymously and untraceably,
105  * so who could really stop them?)
106  *
107  * DISCLAIMER:
108  * This program is distributed in the hope that it will be
109  * useful, but WITHOUT ANY WARRANTY; without even the implied
110  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
111  * PURPOSE. See the GNU Affero General Public License for
112  * more details.
113 
114  -----BEGIN PGP SIGNATURE-----
115  Version: GnuPG v1.4.9 (Darwin)
116 
117  iQIcBAEBAgAGBQJRSsfJAAoJEAMIAO35UbuOQT8P/RJbka8etf7wbxdHQNAY+2cC
118  vDf8J3X8VI+pwMqv6wgTVy17venMZJa4I4ikXD/MRyWV1XbTG0mBXk/7AZk7Rexk
119  KTvL/U1kWiez6+8XXLye+k2JNM6v7eej8xMrqEcO0ZArh/DsLoIn1y8p8qjBI7+m
120  aE7lhstDiD0z8mwRRLKFLN2IH5rAFaZZUvj5ERJaoYUKdn4c+RcQVei2YOl4T0FU
121  LWND3YLoH8naqJXkaOKEN4UfJINCwxhe5Ke9wyfLWLUO7NamRkWD2T7CJ0xocnD1
122  sjAzlVGNgaFDRflfIF4QhBx1Ddl6wwhJfw+d08bjqblSq8aXDkmFA7HeunSFKkdn
123  oIEOEgyj+veuOMRJC5pnBJ9vV+7qRdDKQWaCKotynt4sWJDGQ9kWGWm74SsNaduN
124  TPMyr9kNmGsfR69Q2Zq/FLcLX/j8ESxU+HYUB4vaARw2xEOu2xwDDv6jt0j3Vqsg
125  x7rWv4S/Eh18FDNDkVRChiNoOIilLYLL6c38uMf1pnItBuxP3uhgY6COm59kVaRh
126  nyGTYCDYD2TK+fI9o89F1297uDCwEJ62U0Q7iTDp5QuXCoxkPfv8/kX6lS6T3y9G
127  M9mqIoLbIQ1EDntFv7/t6fUTS2+46uCrdZWbQ5RjYXdrzjij02nDmJAm2BngnZvd
128  kamH0Y/n11lCvo1oQxM+
129  =uSzz
130  -----END PGP SIGNATURE-----
131  **************************************************************/
132 
133 #ifndef OPENTXS_CORE_OTPAYMENTPLAN_HPP
134 #define OPENTXS_CORE_OTPAYMENTPLAN_HPP
135 
137 
138 namespace opentxs
139 {
140 
141 #define PLAN_PROCESS_INTERVAL OTTimeGetTimeFromSeconds(10)
142 
143 /*
144  OTPaymentPlan
145 
146  This instrument is signed by two parties or more (the first one, I think...)
147 
148  While processing payment, BOTH parties to a payment plan will be loaded up and
149  their signatures will be checked against the original plan, which is saved as a
150  cron receipt.
151 
152  There is also a "current version" of the payment plan, which contains updated
153  info
154  from processing, and is signed by the server.
155 
156  BOTH the original version, and the updated version, are sent to EACH user
157  whenever
158  a payment is processed, as his receipt. This way you have the user's signature
159  on
160  the terms, and the server's signature whenever it carries out the terms. A
161  receipt
162  with both is placed in the inbox of both users after any action.
163 
164  As with cheques, the server can use the receipts in the inboxes, plus the last
165  agreed
166  balance, to prove the current balance of any account. The user removes the
167  receipt from
168  his inbox by accepting it and, in the process, performing a new balance
169  agreement.
170 
171  THIS MEANS that the OT server can carry out the terms of contracts! So far, at
172  least,
173  cheques, trades, payment plans... as long as everything is signed off, we're
174  free and
175  clear under the same triple-signed system that account transfer uses. (The
176  Users cannot
177  repudiate their own signatures later, and the server can prove all balances
178  with the
179  user's own signature.)
180 
181  Of course, either side is free to CANCEL a payment plan, or to leave their
182  account bereft
183  of funds and prone to failed payments. But if they cancel, their signature will
184  appear
185  on the cancellation request, and the recipient gets a copy of it in his inbox.
186  And if
187  the funds are insufficient, the plan will keep trying to charge, leaving
188  failure notices
189  in both inboxes when such things occur.
190 
191  You could even have the server manage an issuer account, backed in payment plan
192  revenue,
193  that would form a new asset type that can then be traded on markets. (The same
194  as you can
195  have the server manage the issuer account for a basket currency now, which is
196  backed with
197  reserve accounts managed by the server, and you can then trade the basket
198  currency on markets.)
199  */
201 {
202 private: // Private prevents erroneous use by other classes.
203  typedef OTAgreement ot_super;
204 
205  // *********** Methods for generating a payment plan: ****************
206 
207 public:
208  // From parent: (This must be called first, before the other two methods
209  // below can be called.)
210  //
211  // bool SetAgreement(const int64_t& lTransactionNum, const
212  // OTString& strConsideration,
213  // const time64_t& VALID_FROM=0, const
214  // time64_t& VALID_TO=0);
215 
216  // Then call one (or both) of these:
217 
218  EXPORT bool SetInitialPayment(
219  const int64_t& lAmount,
220  time64_t tTimeUntilInitialPayment = OT_TIME_ZERO); // default: now.
221 
222  // These two can be called independent of each other. You can
223  // have an initial payment, AND/OR a payment plan.
224 
225  EXPORT bool SetPaymentPlan(
226  const int64_t& lPaymentAmount,
227  time64_t tTimeUntilPlanStart = OT_TIME_MONTH_IN_SECONDS,
228  time64_t tBetweenPayments = OT_TIME_MONTH_IN_SECONDS, // Default: 30
229  // days.
230  time64_t tPlanLength = OT_TIME_ZERO, int32_t nMaxPayments = 0);
231 
232  // VerifyAgreement()
233  // This function verifies both Nyms and both signatures.
234  // Due to the peculiar nature of how OTAgreement/OTPaymentPlan works, there
235  // are two signed
236  // copies stored. The merchant signs first, adding his transaction numbers
237  // (2), and then he
238  // sends it to the customer, who also adds two numbers and signs. (Also
239  // resetting the creation date.)
240  // The problem is, adding the additional transaction numbers invalidates the
241  // first (merchant's)
242  // signature.
243  // The solution is, when the customer confirms the agreement, he stores an
244  // internal copy of the
245  // merchant's signed version. This way later, in VERIFY AGREEMENT, the
246  // internal copy can be loaded,
247  // and BOTH Nyms can be checked to verify that BOTH transaction numbers are
248  // valid for each.
249  // The two versions of the contract can also be compared to each other, to
250  // make sure that none of
251  // the vital terms, values, clauses, etc are different between the two.
252  //
253  virtual bool VerifyAgreement(OTPseudonym& RECIPIENT_NYM,
254  OTPseudonym& SENDER_NYM) const;
255  virtual bool CompareAgreement(const OTAgreement& rh) const;
256 
257  // ************ "INITIAL PAYMENT" public GET METHODS **************
258 public:
259  inline bool HasInitialPayment() const
260  {
261  return m_bInitialPayment;
262  }
263  inline const time64_t& GetInitialPaymentDate() const
264  {
265  return m_tInitialPaymentDate;
266  }
267  inline const int64_t& GetInitialPaymentAmount() const
268  {
269  return m_lInitialPaymentAmount;
270  }
271  inline bool IsInitialPaymentDone() const
272  {
273  return m_bInitialPaymentDone;
274  }
275 
277  {
278  return m_tInitialPaymentCompletedDate;
279  }
281  {
282  return m_tFailedInitialPaymentDate;
283  }
284  inline int32_t GetNoInitialFailures() const
285  {
286  return m_nNumberInitialFailures;
287  }
288 
289  // "INITIAL PAYMENT" private MEMBERS
290 private:
291  bool m_bInitialPayment; // Will there be an initial payment?
292  time64_t m_tInitialPaymentDate; // Date of the initial payment, measured
293  // seconds after creation.
294  time64_t m_tInitialPaymentCompletedDate; // Date the initial payment was
295  // finally transacted.
296  time64_t m_tFailedInitialPaymentDate; // Date of the last failed payment,
297  // measured seconds after creation.
298  int64_t m_lInitialPaymentAmount; // Amount of the initial payment.
299  bool m_bInitialPaymentDone; // Has the initial payment been made?
300  int32_t m_nNumberInitialFailures; // If we've tried to process this multiple
301  // times, we'll know.
302 
303  // "INITIAL PAYMENT" protected SET METHODS
304 protected:
305  inline void SetInitialPaymentDate(const time64_t& tInitialPaymentDate)
306  {
307  m_tInitialPaymentDate = tInitialPaymentDate;
308  }
309  inline void SetInitialPaymentAmount(const int64_t& lAmount)
310  {
311  m_lInitialPaymentAmount = lAmount;
312  }
313 
314  // Sets the bool that officially the initial payment has been done. (Checks
315  // first to make sure not already done.)
316  bool SetInitialPaymentDone();
317 
319  const time64_t& tInitialPaymentDate)
320  {
321  m_tInitialPaymentCompletedDate = tInitialPaymentDate;
322  }
324  const time64_t& tFailedInitialPaymentDate)
325  {
326  m_tFailedInitialPaymentDate = tFailedInitialPaymentDate;
327  }
328 
329  inline void SetNoInitialFailures(const int32_t& nNoFailures)
330  {
331  m_nNumberInitialFailures = nNoFailures;
332  }
334  {
335  m_nNumberInitialFailures++;
336  }
337 
338  // ************ "PAYMENT PLAN" public GET METHODS ****************
339 public:
340  inline bool HasPaymentPlan() const
341  {
342  return m_bPaymentPlan;
343  }
344  inline const int64_t& GetPaymentPlanAmount() const
345  {
346  return m_lPaymentPlanAmount;
347  }
348  inline const time64_t& GetTimeBetweenPayments() const
349  {
350  return m_tTimeBetweenPayments;
351  }
352  inline const time64_t& GetPaymentPlanStartDate() const
353  {
354  return m_tPaymentPlanStartDate;
355  }
356  inline const time64_t& GetPaymentPlanLength() const
357  {
358  return m_tPaymentPlanLength;
359  }
360  inline int32_t GetMaximumNoPayments() const
361  {
362  return m_nMaximumNoPayments;
363  }
364 
365  inline const time64_t& GetDateOfLastPayment() const
366  {
367  return m_tDateOfLastPayment;
368  }
369  inline const time64_t& GetDateOfLastFailedPayment() const
370  {
371  return m_tDateOfLastFailedPayment;
372  }
373 
374  inline int32_t GetNoPaymentsDone() const
375  {
376  return m_nNoPaymentsDone;
377  }
378  inline int32_t GetNoFailedPayments() const
379  {
380  return m_nNoFailedPayments;
381  }
382 
383  // "PAYMENT PLAN" private MEMBERS
384 private:
385  bool m_bPaymentPlan; // Will there be a payment plan?
386  int64_t m_lPaymentPlanAmount; // Amount of each payment.
387  time64_t m_tTimeBetweenPayments; // How much time between each payment?
388  time64_t m_tPaymentPlanStartDate; // Date for the first payment plan
389  // payment.
390  time64_t m_tPaymentPlanLength; // Optional. Plan length measured in seconds
391  // since plan start.
392  int32_t m_nMaximumNoPayments; // Optional. The most number of payments that
393  // are authorized.
394 
395  time64_t m_tDateOfLastPayment; // Recording of date of the last payment.
396  time64_t m_tDateOfLastFailedPayment; // Recording of date of the last failed
397  // payment.
398  int32_t m_nNoPaymentsDone; // Recording of the number of payments already
399  // processed.
400  int32_t m_nNoFailedPayments; // Every time a payment fails, we record that
401  // here.
402 
403  // "PAYMENT PLAN" protected SET METHODS
404 protected:
405  inline void SetPaymentPlanAmount(const int64_t& lAmount)
406  {
407  m_lPaymentPlanAmount = lAmount;
408  }
409  inline void SetTimeBetweenPayments(const time64_t& tTimeBetween)
410  {
411  m_tTimeBetweenPayments = tTimeBetween;
412  }
413  inline void SetPaymentPlanStartDate(const time64_t& tPlanStartDate)
414  {
415  m_tPaymentPlanStartDate = tPlanStartDate;
416  }
417  inline void SetPaymentPlanLength(const time64_t& tPlanLength)
418  {
419  m_tPaymentPlanLength = tPlanLength;
420  }
421  inline void SetMaximumNoPayments(int32_t nMaxNoPayments)
422  {
423  m_nMaximumNoPayments = nMaxNoPayments;
424  }
425 
426  inline void SetDateOfLastPayment(const time64_t& tDateOfLast)
427  {
428  m_tDateOfLastPayment = tDateOfLast;
429  }
430  inline void SetDateOfLastFailedPayment(const time64_t& tDateOfLast)
431  {
432  m_tDateOfLastFailedPayment = tDateOfLast;
433  }
434 
435  inline void SetNoPaymentsDone(int32_t nNoPaymentsDone)
436  {
437  m_nNoPaymentsDone = nNoPaymentsDone;
438  }
439  inline void SetNoFailedPayments(int32_t nNoFailed)
440  {
441  m_nNoFailedPayments = nNoFailed;
442  }
443 
445  {
446  m_nNoPaymentsDone++;
447  }
449  {
450  m_nNoFailedPayments++;
451  }
452 
453 private: // These are NOT stored as part of the payment plan. They are merely
454  // used during execution.
455  bool m_bProcessingInitialPayment;
456  bool m_bProcessingPaymentPlan;
457 
458 public:
459  // From OTAgreement (parent class of this)
460  /*
461  inline OTIdentifier& GetRecipientAcctID() { return
462  m_RECIPIENT_ACCT_ID; }
463  inline OTIdentifier& GetRecipientUserID() { return
464  m_RECIPIENT_USER_ID; }
465  inline void SetRecipientAcctID(OTIdentifier& ACCT_ID) {
466  m_RECIPIENT_ACCT_ID = ACCT_ID; }
467  inline void SetRecipientUserID(OTIdentifier& USER_ID) {
468  m_RECIPIENT_USER_ID = USER_ID; }
469 
470  const OTString& GetConsideration() const { return m_strConsideration; }
471  */
472  // Return True if should stay on OTCron's list for more processing.
473  // Return False if expired or otherwise should be removed.
474  virtual bool ProcessCron(); // OTCron calls this regularly, which is my
475  // chance to expire, etc.
476 
477  // From OTCronItem (parent class of OTAgreement, parent class of this)
478 
479  /*
480  inline void SetCronPointer(OTCron& theCron) { m_pCron = &theCron; }
481 
482  inline void SetCreationDate(const time64_t& CREATION_DATE) {
483  m_CREATION_DATE = CREATION_DATE; }
484  inline const time64_t& GetCreationDate() const { return m_CREATION_DATE; }
485  */
486 
487  // From OTTrackable (parent class of OTCronItem, parent class of
488  // OTAgreement, parent of this)
489  /*
490  inline int64_t GetTransactionNum() const { return m_lTransactionNum; }
491  inline void SetTransactionNum(int64_t lTransactionNum) { m_lTransactionNum
492  = lTransactionNum; }
493 
494  inline const OTIdentifier& GetSenderAcctID() { return
495  m_SENDER_ACCT_ID; }
496  inline const OTIdentifier& GetSenderUserID() { return
497  m_SENDER_USER_ID; }
498  inline void SetSenderAcctID(const OTIdentifier& ACCT_ID) {
499  m_SENDER_ACCT_ID = ACCT_ID; }
500  inline void SetSenderUserID(const OTIdentifier& USER_ID) {
501  m_SENDER_USER_ID = USER_ID; }
502  */
503 
504  // From OTInstrument (parent of OTTrackable, parent of OTCronItem, parent of
505  // OTAgreement, parent of this)
506  /*
507  OTInstrument(const OTIdentifier& SERVER_ID, const OTIdentifier& ASSET_ID)
508  : OTContract()
509 
510  inline const OTIdentifier& GetAssetID() const { return m_AssetTypeID; }
511  inline const OTIdentifier& GetServerID() const { return m_ServerID; }
512 
513  inline void SetAssetID(const OTIdentifier& ASSET_ID) { m_AssetTypeID =
514  ASSET_ID; }
515  inline void SetServerID(const OTIdentifier& SERVER_ID) { m_ServerID =
516  SERVER_ID; }
517 
518  inline time64_t GetValidFrom() const { return m_VALID_FROM; }
519  inline time64_t GetValidTo() const { return m_VALID_TO; }
520 
521  inline void SetValidFrom(time64_t TIME_FROM) { m_VALID_FROM =
522  TIME_FROM; }
523  inline void SetValidTo(time64_t TIME_TO) { m_VALID_TO = TIME_TO;
524  }
525 
526  bool VerifyCurrentDate(); // Verify the current date against the VALID FROM
527  / TO dates.
528  bool IsExpired()
529  */
530 protected:
531  // virtual void onFinalReceipt(); // Now handled in the parent
532  // class.
533  // virtual void onRemovalFromCron(); // Now handled in the parent
534  // class.
535 
536  bool ProcessPayment(const int64_t& lAmount);
537  void ProcessInitialPayment();
538  void ProcessPaymentPlan();
539 
540 public:
541  EXPORT OTPaymentPlan();
542  EXPORT OTPaymentPlan(const OTIdentifier& SERVER_ID,
543  const OTIdentifier& ASSET_ID);
544  EXPORT OTPaymentPlan(const OTIdentifier& SERVER_ID,
545  const OTIdentifier& ASSET_ID,
546  const OTIdentifier& SENDER_ACCT_ID,
547  const OTIdentifier& SENDER_USER_ID,
548  const OTIdentifier& RECIPIENT_ACCT_ID,
549  const OTIdentifier& RECIPIENT_USER_ID);
550  EXPORT virtual ~OTPaymentPlan();
551  void InitPaymentPlan();
552  virtual void Release();
553  void Release_PaymentPlan();
554  // return -1 if error, 0 if nothing, and 1 if the node was processed.
555  virtual int32_t ProcessXMLNode(irr::io::IrrXMLReader*& xml);
556  virtual void UpdateContents(); // Before transmission or serialization, this
557  // is where the ledger saves its contents
558  virtual bool SaveContractWallet(std::ofstream& ofs) const;
559 };
560 
561 } // namespace opentxs
562 
563 #endif // OPENTXS_CORE_OTPAYMENTPLAN_HPP
int32_t GetMaximumNoPayments() const
const time64_t & GetPaymentPlanLength() const
const time64_t & GetTimeBetweenPayments() const
void SetDateOfLastFailedPayment(const time64_t &tDateOfLast)
int32_t GetNoPaymentsDone() const
bool HasPaymentPlan() const
const time64_t & GetLastFailedInitialPaymentDate() const
const time64_t & GetInitialPaymentDate() const
void SetPaymentPlanStartDate(const time64_t &tPlanStartDate)
const int64_t & GetInitialPaymentAmount() const
virtual int32_t ProcessXMLNode(irr::io::IrrXMLReader *&xml)
#define OT_TIME_MONTH_IN_SECONDS
Definition: Common.hpp:174
virtual void UpdateContents()
int64_t time64_t
Definition: Common.hpp:209
virtual EXPORT ~OTPaymentPlan()
virtual bool ProcessCron()
EXPORT bool SetPaymentPlan(const int64_t &lPaymentAmount, time64_t tTimeUntilPlanStart=OT_TIME_MONTH_IN_SECONDS, time64_t tBetweenPayments=OT_TIME_MONTH_IN_SECONDS, time64_t tPlanLength=OT_TIME_ZERO, int32_t nMaxPayments=0)
bool HasInitialPayment() const
virtual bool SaveContractWallet(std::ofstream &ofs) const
int32_t GetNoInitialFailures() const
int32_t GetNoFailedPayments() const
void SetTimeBetweenPayments(const time64_t &tTimeBetween)
void SetMaximumNoPayments(int32_t nMaxNoPayments)
const time64_t & GetInitialPaymentCompletedDate() const
const time64_t & GetDateOfLastFailedPayment() const
void SetLastFailedInitialPaymentDate(const time64_t &tFailedInitialPaymentDate)
const time64_t & GetPaymentPlanStartDate() const
virtual bool VerifyAgreement(OTPseudonym &RECIPIENT_NYM, OTPseudonym &SENDER_NYM) const
void SetInitialPaymentCompletedDate(const time64_t &tInitialPaymentDate)
void SetNoFailedPayments(int32_t nNoFailed)
EXPORT bool SetInitialPayment(const int64_t &lAmount, time64_t tTimeUntilInitialPayment=OT_TIME_ZERO)
void SetNoInitialFailures(const int32_t &nNoFailures)
const int64_t & GetPaymentPlanAmount() const
const time64_t & GetDateOfLastPayment() const
virtual bool CompareAgreement(const OTAgreement &rh) const
bool IsInitialPaymentDone() const
bool ProcessPayment(const int64_t &lAmount)
void SetNoPaymentsDone(int32_t nNoPaymentsDone)
void SetPaymentPlanAmount(const int64_t &lAmount)
void SetInitialPaymentAmount(const int64_t &lAmount)
#define OT_TIME_ZERO
Definition: Common.hpp:180
void SetInitialPaymentDate(const time64_t &tInitialPaymentDate)
void SetPaymentPlanLength(const time64_t &tPlanLength)
void SetDateOfLastPayment(const time64_t &tDateOfLast)