ParseAggregate Method
Parses the aggregate returned from another component's GetDetailAggregate method.
Syntax
tsysdetailrecord.parseAggregate(aggregate, [callback])
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
This method takes the XML aggregate returned from the TSYSRetail or TSYSECommerce class, parses it, and then fills all the properties of the DetailRecord class. While normally you can pass the results of the GetDetailAggregate method call directly to the TSYSSettle class, sometimes it is necessary to adjust the contents of the XML aggregate first.
For example, to add a gratuity to a charge:
DetailRecord.ParseAggregate(TSYSRetail.GetDetailAggregate()) DetailRecord.Gratuity = "500" DetailRecord.SettlementAmount = DetailRecord.AuthorizedAmount + DetailRecord.Gratuity TSYSSettle.DetailAggregate[0] = DetailRecord.GetDetailAggregate()