1. 1 : (function(root, factory) {
  2. 2 : if (typeof define === 'function' && define.amd) {
  3. 3 : // AMD. Register as an anonymous module.
  4. 4 : define(['ApiClient', 'models/FeeRequest', 'models/RecordPaymentCustomerAccountRequest', 'models/RecordPaymentCustomerRequest', 'models/RecordedPaymentFundingAccount'], factory);
  5. 5 : } else 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('./FeeRequest'), require('./RecordPaymentCustomerAccountRequest'), require('./RecordPaymentCustomerRequest'), require('./RecordedPaymentFundingAccount'));
  8. 8 : } else {
  9. 9 : // Browser globals (root is window)
  10. 10 : if (!root.OrbipayPaymentsapiClient) {
  11. 11 : root.OrbipayPaymentsapiClient = {};
  12. 12 : }
  13. 13 : root.OrbipayPaymentsapiClient.RecordPaymentRequest = factory(root.OrbipayPaymentsapiClient.ApiClient, root.OrbipayPaymentsapiClient.FeeRequest, root.OrbipayPaymentsapiClient.RecordPaymentCustomerAccountRequest, root.OrbipayPaymentsapiClient.RecordPaymentCustomerRequest, root.OrbipayPaymentsapiClient.RecordedPaymentFundingAccount);
  14. 14 : }
  15. 15 : }(this, function(ApiClient, FeeRequest, RecordPaymentCustomerAccountRequest, RecordPaymentCustomerRequest, RecordedPaymentFundingAccount) {
  16. 16 : 'use strict';
  17. 17 :
  18. 18 :
  19. 19 :
  20. 20 :
  21. 21 : /**
  22. 22 : * The RecordPaymentRequest model module.
  23. 23 : * @module models/RecordPaymentRequest
  24. 24 : */
  25. 25 :
  26. 26 : /**
  27. 27 : * <h3 style="color:red"> This class subject to change without prior notice, Please dont use this class directly. </h3>
  28. 28 :
  29. 29 : * Constructs a new <code>RecordPaymentRequest</code>.
  30. 30 : * @alias module:models/RecordPaymentRequest
  31. 31 : * @class
  32. 32 : * @param payment_date {String} The date on which the payment is scheduled to be made. It must be in ISO8601 full-date format, namely, YYYY-MM-DD.
  33. 33 : * @param payment_method {module:models/RecordPaymentRequest.PaymentMethodEnum} The non fulfillment method for the payment.
  34. 34 : * @param customer {module:models/RecordPaymentCustomerRequest}
  35. 35 : * @param customer_account {module:models/RecordPaymentCustomerAccountRequest}
  36. 36 : */
  37. 37 : var exports = function(payment_date, payment_method, customer, customer_account) {
  38. 38 : var _this = this;
  39. 39 :
  40. 40 :
  41. 41 : _this['payment_date'] = payment_date;
  42. 42 :
  43. 43 : _this['payment_method'] = payment_method;
  44. 44 :
  45. 45 :
  46. 46 : _this['customer'] = customer;
  47. 47 :
  48. 48 : _this['customer_account'] = customer_account;
  49. 49 :
  50. 50 :
  51. 51 :
  52. 52 : };
  53. 53 :
  54. 54 : /**
  55. 55 : * Constructs a <code>RecordPaymentRequest</code> from a plain JavaScript object, optionally creating a new instance.
  56. 56 : * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
  57. 57 : * @param {Object} data The plain JavaScript object bearing properties of interest.
  58. 58 : * @param {module:models/RecordPaymentRequest} obj Optional instance to populate.
  59. 59 : * @return {module:models/RecordPaymentRequest} The populated <code>RecordPaymentRequest</code> instance.
  60. 60 : */
  61. 61 : exports.constructFromObject = function(data, obj) {
  62. 62 : if (data) {
  63. 63 : obj = obj || new exports();
  64. 64 :
  65. 65 : if (data.hasOwnProperty('amount')) {
  66. 66 : obj['amount'] = ApiClient.convertToType(data['amount'], 'String');
  67. 67 : }
  68. 68 : if (data.hasOwnProperty('payment_date')) {
  69. 69 : obj['payment_date'] = ApiClient.convertToType(data['payment_date'], 'String');
  70. 70 : }
  71. 71 : if (data.hasOwnProperty('payment_amount_type')) {
  72. 72 : obj['payment_amount_type'] = ApiClient.convertToType(data['payment_amount_type'], 'String');
  73. 73 : }
  74. 74 : if (data.hasOwnProperty('payment_method')) {
  75. 75 : obj['payment_method'] = ApiClient.convertToType(data['payment_method'], 'String');
  76. 76 : }
  77. 77 : if (data.hasOwnProperty('token')) {
  78. 78 : obj['token'] = ApiClient.convertToType(data['token'], 'String');
  79. 79 : }
  80. 80 : if (data.hasOwnProperty('fee')) {
  81. 81 : obj['fee'] = FeeRequest.constructFromObject(data['fee']);
  82. 82 : }
  83. 83 : if (data.hasOwnProperty('customer')) {
  84. 84 : obj['customer'] = RecordPaymentCustomerRequest.constructFromObject(data['customer']);
  85. 85 : }
  86. 86 : if (data.hasOwnProperty('funding_account')) {
  87. 87 : obj['funding_account'] = RecordedPaymentFundingAccount.constructFromObject(data['funding_account']);
  88. 88 : }
  89. 89 : if (data.hasOwnProperty('customer_account')) {
  90. 90 : obj['customer_account'] = RecordPaymentCustomerAccountRequest.constructFromObject(data['customer_account']);
  91. 91 : }
  92. 92 : if (data.hasOwnProperty('payment_reference')) {
  93. 93 : obj['payment_reference'] = ApiClient.convertToType(data['payment_reference'], 'String');
  94. 94 : }
  95. 95 : if (data.hasOwnProperty('comments')) {
  96. 96 : obj['comments'] = ApiClient.convertToType(data['comments'], 'String');
  97. 97 : }
  98. 98 : if (data.hasOwnProperty('custom_fields')) {
  99. 99 : obj['custom_fields'] = ApiClient.convertToType(data['custom_fields'], {'String': 'String'});
  100. 100 : }
  101. 101 : }
  102. 102 : return obj;
  103. 103 : };
  104. 104 :
  105. 105 : /**
  106. 106 : * The amount being paid.
  107. 107 : * @member {String} amount
  108. 108 : */
  109. 109 : exports.prototype['amount'] = undefined;
  110. 110 : /**
  111. 111 : * The date on which the payment is scheduled to be made. It must be in ISO8601 full-date format, namely, YYYY-MM-DD.
  112. 112 : * @member {String} payment_date
  113. 113 : */
  114. 114 : exports.prototype['payment_date'] = undefined;
  115. 115 : /**
  116. 116 : * The type of amount, as per the bill/statement, that is being paid. The payment amount is derived from the amount type selected for the payment. This defaults to other.
  117. 117 : * @member {module:models/RecordPaymentRequest.PaymentAmountTypeEnum} payment_amount_type
  118. 118 : */
  119. 119 : exports.prototype['payment_amount_type'] = undefined;
  120. 120 : /**
  121. 121 : * The non fulfillment method for the payment.
  122. 122 : * @member {module:models/RecordPaymentRequest.PaymentMethodEnum} payment_method
  123. 123 : */
  124. 124 : exports.prototype['payment_method'] = undefined;
  125. 125 : /**
  126. 126 : * The token is used to uniquely identify the payment, such as the POS token.
  127. 127 : * @member {String} token
  128. 128 : */
  129. 129 : exports.prototype['token'] = undefined;
  130. 130 : /**
  131. 131 : * @member {module:models/FeeRequest} fee
  132. 132 : */
  133. 133 : exports.prototype['fee'] = undefined;
  134. 134 : /**
  135. 135 : * @member {module:models/RecordPaymentCustomerRequest} customer
  136. 136 : */
  137. 137 : exports.prototype['customer'] = undefined;
  138. 138 : /**
  139. 139 : * @member {module:models/RecordedPaymentFundingAccount} funding_account
  140. 140 : */
  141. 141 : exports.prototype['funding_account'] = undefined;
  142. 142 : /**
  143. 143 : * @member {module:models/RecordPaymentCustomerAccountRequest} customer_account
  144. 144 : */
  145. 145 : exports.prototype['customer_account'] = undefined;
  146. 146 : /**
  147. 147 : * The unique identifier in the client system for the payment.
  148. 148 : * @member {String} payment_reference
  149. 149 : */
  150. 150 : exports.prototype['payment_reference'] = undefined;
  151. 151 : /**
  152. 152 : * @member {String} comments
  153. 153 : */
  154. 154 : exports.prototype['comments'] = undefined;
  155. 155 : /**
  156. 156 : * The additional information or meta-information that EBPP can accept, maintain and transmit back to the client.
  157. 157 : * @member {Object.<String, String>} custom_fields
  158. 158 : */
  159. 159 : exports.prototype['custom_fields'] = undefined;
  160. 160 :
  161. 161 :
  162. 162 : /**
  163. 163 : * Allowed values for the <code>payment_amount_type</code> property.
  164. 164 : * @enum {String}
  165. 165 : * @readonly
  166. 166 : */
  167. 167 : exports.PaymentAmountTypeEnum = {
  168. 168 : /**
  169. 169 : * value: "current_balance"
  170. 170 : * @const
  171. 171 : */
  172. 172 : "current_balance": "current_balance",
  173. 173 : /**
  174. 174 : * value: "minimum_payment_due"
  175. 175 : * @const
  176. 176 : */
  177. 177 : "minimum_payment_due": "minimum_payment_due",
  178. 178 : /**
  179. 179 : * value: "past_payment_due"
  180. 180 : * @const
  181. 181 : */
  182. 182 : "past_payment_due": "past_payment_due",
  183. 183 : /**
  184. 184 : * value: "statement_balance"
  185. 185 : * @const
  186. 186 : */
  187. 187 : "statement_balance": "statement_balance",
  188. 188 : /**
  189. 189 : * value: "other"
  190. 190 : * @const
  191. 191 : */
  192. 192 : "other": "other" };
  193. 193 :
  194. 194 : /**
  195. 195 : * Allowed values for the <code>payment_method</code> property.
  196. 196 : * @enum {String}
  197. 197 : * @readonly
  198. 198 : */
  199. 199 : exports.PaymentMethodEnum = {
  200. 200 : /**
  201. 201 : * value: "cash"
  202. 202 : * @const
  203. 203 : */
  204. 204 : "cash": "cash",
  205. 205 : /**
  206. 206 : * value: "swiped_card"
  207. 207 : * @const
  208. 208 : */
  209. 209 : "swiped_card": "swiped_card",
  210. 210 : /**
  211. 211 : * value: "scanned_check"
  212. 212 : * @const
  213. 213 : */
  214. 214 : "scanned_check": "scanned_check" };
  215. 215 :
  216. 216 :
  217. 217 : return exports;
  218. 218 : }));
  219. 219 :
  220. 220 :