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 Fee wrapper module.
  14. 14 : * @module wrappers/Fee
  15. 15 : */
  16. 16 : var exports = function(fee_amount) {
  17. 17 : var _this = this;
  18. 18 : Base.call(_this);
  19. 19 : _this['fee_amount'] = fee_amount;
  20. 20 : };
  21. 21 :
  22. 22 : /**
  23. 23 : * Constructs a <code>Fee</code> from a plain JavaScript object, optionally creating a new instance.
  24. 24 : * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
  25. 25 : * @param {Object} data The plain JavaScript object bearing properties of interest.
  26. 26 : * @param {module:wrappers/Fee} obj Optional instance to populate.
  27. 27 : * @return {module:wrappers/Fee} The populated <code>Fee</code> instance.
  28. 28 : */
  29. 29 : exports.constructFromObject = function (data, obj) {
  30. 30 : if (data) {
  31. 31 : obj = obj || new exports();
  32. 32 : if (data.hasOwnProperty('fee_type')) {
  33. 33 : obj['fee_type'] = data['fee_type'];
  34. 34 : }
  35. 35 : if (data.hasOwnProperty('fee_amount')) {
  36. 36 : obj['fee_amount'] = data['fee_amount'];
  37. 37 : }
  38. 38 : if (data.hasOwnProperty('id')) {
  39. 39 : obj['id'] = data['id'];
  40. 40 : }
  41. 41 : if (data.hasOwnProperty('url')) {
  42. 42 : obj['url'] = data['url'];
  43. 43 : }
  44. 44 : }
  45. 45 : return obj;
  46. 46 : };
  47. 47 :
  48. 48 :
  49. 49 : exports.prototype = Object.create(Base.prototype);
  50. 50 : exports.prototype.constructor = exports;
  51. 51 :
  52. 52 : /**
  53. 53 : * The way the fee is being charged to the customer. Fee could be added to the amount being paid, or, it could be charged separately by the biller. The fee_type would default to add_to_principal if the fee is not configured for the client in EBPP.
  54. 54 : * @member {String} fee_type
  55. 55 : */
  56. 56 : exports.prototype['fee_type'] = undefined;
  57. 57 : /**
  58. 58 : * The fee amount upto 2 decimal places.
  59. 59 : * @member {String} fee_amount
  60. 60 : */
  61. 61 : exports.prototype['fee_amount'] = undefined;
  62. 62 : /**
  63. 63 : * The unique identifier assigned by EBPP to the fee. In case of split fee.
  64. 64 : * @member {String} id
  65. 65 : */
  66. 66 : exports.prototype['id'] = undefined;
  67. 67 : /**
  68. 68 : * This URL fetches the details of fee as a payment resource. In case of split fee.
  69. 69 : * @member {String} url
  70. 70 : */
  71. 71 : exports.prototype['url'] = undefined;
  72. 72 :
  73. 73 :
  74. 74 :
  75. 75 :
  76. 76 : return exports;
  77. 77 :
  78. 78 : }));