- 1 :
- 2 :
- 3 :
(function(root, factory) {
- 4 :
- 5 :
if (typeof module === 'object' && module.exports) {
- 6 :
// CommonJS-like environments that support module.exports, like Node.
- 7 :
module.exports = factory(require('../ApiClient'), require('./InvocationContext'), require('../CommonUtil'), require('../ResponseWrapper'), require('./Base'), require('../OrbipayApiError'));
- 8 :
}
- 9 :
}(this, function(ApiClient, InvocationContext, CommonUtil, ResponseWrapper, Base, OrbipayApiError) {
- 10 :
'use strict';
- 11 :
- 12 :
/**
- 13 :
* The Fee wrapper module.
- 14 :
* @module wrappers/Fee
- 15 :
*/
- 16 :
var exports = function(fee_amount) {
- 17 :
var _this = this;
- 18 :
Base.call(_this);
- 19 :
_this['fee_amount'] = fee_amount;
- 20 :
};
- 21 :
- 22 :
/**
- 23 :
* Constructs a <code>Fee</code> from a plain JavaScript object, optionally creating a new instance.
- 24 :
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
- 25 :
* @param {Object} data The plain JavaScript object bearing properties of interest.
- 26 :
* @param {module:wrappers/Fee} obj Optional instance to populate.
- 27 :
* @return {module:wrappers/Fee} The populated <code>Fee</code> instance.
- 28 :
*/
- 29 :
exports.constructFromObject = function (data, obj) {
- 30 :
if (data) {
- 31 :
obj = obj || new exports();
- 32 :
if (data.hasOwnProperty('fee_type')) {
- 33 :
obj['fee_type'] = data['fee_type'];
- 34 :
}
- 35 :
if (data.hasOwnProperty('fee_amount')) {
- 36 :
obj['fee_amount'] = data['fee_amount'];
- 37 :
}
- 38 :
if (data.hasOwnProperty('id')) {
- 39 :
obj['id'] = data['id'];
- 40 :
}
- 41 :
if (data.hasOwnProperty('url')) {
- 42 :
obj['url'] = data['url'];
- 43 :
}
- 44 :
}
- 45 :
return obj;
- 46 :
};
- 47 :
- 48 :
- 49 :
exports.prototype = Object.create(Base.prototype);
- 50 :
exports.prototype.constructor = exports;
- 51 :
- 52 :
/**
- 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 :
* @member {String} fee_type
- 55 :
*/
- 56 :
exports.prototype['fee_type'] = undefined;
- 57 :
/**
- 58 :
* The fee amount upto 2 decimal places.
- 59 :
* @member {String} fee_amount
- 60 :
*/
- 61 :
exports.prototype['fee_amount'] = undefined;
- 62 :
/**
- 63 :
* The unique identifier assigned by EBPP to the fee. In case of split fee.
- 64 :
* @member {String} id
- 65 :
*/
- 66 :
exports.prototype['id'] = undefined;
- 67 :
/**
- 68 :
* This URL fetches the details of fee as a payment resource. In case of split fee.
- 69 :
* @member {String} url
- 70 :
*/
- 71 :
exports.prototype['url'] = undefined;
- 72 :
- 73 :
- 74 :
- 75 :
- 76 :
return exports;
- 77 :
- 78 :
}));