1. 1 :
  2. 2 :
  3. 3 : (function(root, factory) {
  4. 4 :
  5. 5 : if (typeof module === 'object' && module.exports) {
  6. 6 : // CommonJS-like environments that support module.exports, like Node.
  7. 7 : module.exports = factory(require('../ApiClient'), require('./InvocationContext'), require('../CommonUtil'), require('../ResponseWrapper'), require('./Base'), require('../OrbipayApiError'));
  8. 8 : }
  9. 9 : }(this, function(ApiClient, InvocationContext, CommonUtil, ResponseWrapper, Base, OrbipayApiError) {
  10. 10 : 'use strict';
  11. 11 :
  12. 12 : /**
  13. 13 : * The PaymentSchedule wrapper module.
  14. 14 : * @module wrappers/PaymentSchedule
  15. 15 : */
  16. 16 : var exports = function(payment_recurring_type, payment_recurring_count, payment_amount_type, payment_start_date, payment_end_date, payment_limit_amount, payment_plan_id, payment_defer_days) {
  17. 17 : var _this = this;
  18. 18 : Base.call(_this);
  19. 19 : _this['payment_recurring_type'] = payment_recurring_type;
  20. 20 : _this['payment_recurring_count'] = payment_recurring_count;
  21. 21 : _this['payment_amount_type'] = payment_amount_type;
  22. 22 : _this['payment_start_date'] = payment_start_date;
  23. 23 : _this['payment_end_date'] = payment_end_date;
  24. 24 : _this['payment_limit_amount'] = payment_limit_amount;
  25. 25 : _this['payment_plan_id'] = payment_plan_id;
  26. 26 : _this['payment_defer_days'] = payment_defer_days;
  27. 27 : };
  28. 28 :
  29. 29 : /**
  30. 30 : * Constructs a <code>PaymentSchedule</code> from a plain JavaScript object, optionally creating a new instance.
  31. 31 : * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
  32. 32 : * @param {Object} data The plain JavaScript object bearing properties of interest.
  33. 33 : * @param {module:wrappers/PaymentSchedule} obj Optional instance to populate.
  34. 34 : * @return {module:wrappers/PaymentSchedule} The populated <code>PaymentSchedule</code> instance.
  35. 35 : */
  36. 36 : exports.constructFromObject = function (data, obj) {
  37. 37 : if (data) {
  38. 38 : obj = obj || new exports();
  39. 39 : if (data.hasOwnProperty('payment_recurring_type')) {
  40. 40 : obj['payment_recurring_type'] = data['payment_recurring_type'];
  41. 41 : }
  42. 42 : if (data.hasOwnProperty('payment_recurring_count')) {
  43. 43 : obj['payment_recurring_count'] = data['payment_recurring_count'];
  44. 44 : }
  45. 45 : if (data.hasOwnProperty('payment_amount_type')) {
  46. 46 : obj['payment_amount_type'] = data['payment_amount_type'];
  47. 47 : }
  48. 48 : if (data.hasOwnProperty('payment_start_date')) {
  49. 49 : obj['payment_start_date'] = data['payment_start_date'];
  50. 50 : }
  51. 51 : if (data.hasOwnProperty('payment_end_date')) {
  52. 52 : obj['payment_end_date'] = data['payment_end_date'];
  53. 53 : }
  54. 54 : if (data.hasOwnProperty('payment_limit_amount')) {
  55. 55 : obj['payment_limit_amount'] = data['payment_limit_amount'];
  56. 56 : }
  57. 57 : if (data.hasOwnProperty('payment_plan_id')) {
  58. 58 : obj['payment_plan_id'] = data['payment_plan_id'];
  59. 59 : }
  60. 60 : if (data.hasOwnProperty('payment_defer_days')) {
  61. 61 : obj['payment_defer_days'] = data['payment_defer_days'];
  62. 62 : }
  63. 63 : }
  64. 64 : return obj;
  65. 65 : };
  66. 66 :
  67. 67 :
  68. 68 : exports.prototype = Object.create(Base.prototype);
  69. 69 : exports.prototype.constructor = exports;
  70. 70 :
  71. 71 : /**
  72. 72 : * The frequency of the payments created as part of a payment setup.
  73. 73 : * @member {String} payment_recurring_type
  74. 74 : */
  75. 75 : exports.prototype['payment_recurring_type'] = undefined;
  76. 76 : /**
  77. 77 : * The maximum number of payments that can be created as part of a recurring payment setup.
  78. 78 : * @member {String} payment_recurring_count
  79. 79 : */
  80. 80 : exports.prototype['payment_recurring_count'] = undefined;
  81. 81 : /**
  82. 82 : * The amount type that is used to set the amount for payments created as part of a recurring payment or autopay setup.
  83. 83 : * @member {String} payment_amount_type
  84. 84 : */
  85. 85 : exports.prototype['payment_amount_type'] = undefined;
  86. 86 : /**
  87. 87 : * The date on which the first payment will be drafted as part of a recurring payment setup. This is to be specified in the ISO8601 full-date format, namely, YYYY-MM-DD.
  88. 88 : * @member {String} payment_start_date
  89. 89 : */
  90. 90 : exports.prototype['payment_start_date'] = undefined;
  91. 91 : /**
  92. 92 : * The date by which the last payment will be drafted as part of a recurring payment setup. This is to be specified in the ISO8601 full-date format, namely, YYYY-MM-DD.
  93. 93 : * @member {String} payment_end_date
  94. 94 : */
  95. 95 : exports.prototype['payment_end_date'] = undefined;
  96. 96 : /**
  97. 97 : * The upper limit for the payment amount in the case of recurring or autopay payments.
  98. 98 : * @member {String} payment_limit_amount
  99. 99 : */
  100. 100 : exports.prototype['payment_limit_amount'] = undefined;
  101. 101 : /**
  102. 102 : * The reference to the payment plan, offered by the biller, that is used to set up the recurring payment. The list of payment plans offered is published as part of the biller set-up.
  103. 103 : * @member {String} payment_plan_id
  104. 104 : */
  105. 105 : exports.prototype['payment_plan_id'] = undefined;
  106. 106 : /**
  107. 107 : * The number of days from the bill due date that the customer wishes to delay the autopay payment by.
  108. 108 : * @member {String} payment_defer_days
  109. 109 : */
  110. 110 : exports.prototype['payment_defer_days'] = undefined;
  111. 111 :
  112. 112 : /**
  113. 113 : * @param {String} payment_limit_amount - The payment_limit_amount of PaymentSchedule.
  114. 114 : * @return {module:wrappers/PaymentSchedule} The instance of <code>PaymentSchedule</code>.
  115. 115 : */
  116. 116 : exports.prototype.withPaymentLimitAmount = function (payment_limit_amount) {
  117. 117 : var _this = this;
  118. 118 :
  119. 119 : _this['payment_limit_amount'] = payment_limit_amount;
  120. 120 :
  121. 121 :
  122. 122 : return _this;
  123. 123 : };
  124. 124 :
  125. 125 :
  126. 126 :
  127. 127 : return exports;
  128. 128 :
  129. 129 : }));