GetBatchSummary
- Method
SlimCD.Reports.GetBatchSummary2
Purpose
Get the approved batch totals for a particular site/date range, returning standard format for all processors .
Description
GetBatchSummary iterates through batches in the specified date range and creates summations for the batches within the requested range. Transaction counts, gross sales, gross refunds and net income are returned whenever possible.Business Rules
Argument List
Name Required Usage GetBatchSummaryRequest Required Object containing properties for the request timeout Optional Integer wait time, in seconds, before timeout response is generated callback* Optional Function to call upon completion of asynchronous request *for JavaScript only
GetBacthSummary Request Fields
Field Name Type Length Required Description Username string 20 require Username or API Access Credential that accesses web service. Password string 20 require Plaintext password for the client account. SiteID integer 10 optional Assigned by the Slim CD administrator.. StartDate date 10 require Date of beginning of search. EndDate date 10 require Date of end of search. 1. Passwords are required except when the username is set to an API Access Credential, in which case it should be passed in as an empty string.
Reply Fields
reply outer tag for the reply data block response Success, FAIL, Error response code 0, 1, 2 (respective) matching the above description If successful, this will contain the single word, OK. Otherwise it will contain a description of failure or error which occurred reponseurl The Slimcd.com url which was called for this operation datablock The confirmation text returned from the server. Reply Hierarchy
- reply
- response
- responsecode
- description
- responseurl
- datablock
- BatchSummary
- BatchSummaryRecord
- BatchesD
- RecordCount
- Amount
- BatchSummaryRecord
- BatchSummary
Remarks
- General
- Names in name/value pairs are NOT case-sensitive
- Names inside XML tags ARE case-sensitive
- Function-Specific
- None
- reply
- Include
012<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script>
Method
1234function GetBatchSummary(request,callback)function GetBatchSummary(request,timeout,callback)
Request
123456789request= {"username": "R6UT8C6M","password": "","siteid": "0","startdate": "","enddate": ""}
Reply
123456789101112131415161718callback ( {"reply":{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/reports.asmx/GetBatchSummary2","datablock": {"BatchSummary": {"BatchSummaryRecord": {"Batches": "10","RecordCount": "59","Amount": "2594.84"}}}} );
Sample Code
1234567891011121314151617181920<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script><script>// <![CDATA[SlimCD.Reports.GetBatchSummary({"username": "R6UT8C6M","password": "","siteid": "0","startdate": "","enddate": ""},function (reply) {if (reply.response == "Success") {alert ('Batch Closed');} else {alert('There was a problem closing the batch:\r\n' + reply.description);}});// ]]></script>
Downloads
- Include
012include 'slimcd.php';
Method
123function Reports_GetBatchSummary(Reports_GetBatchSummaryRequest $request,$timeout=false)Request
123456789101112class Reports_GetBatchSummaryRequest{// property declarationpublic $username = '';public $password = '';public $siteid = 0;public $StartDate ='';public $EndDate ='';}JSON Reply
1234567891011121314151617{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/reports.asmx/GetBatchSummary2","datablock": {"BatchSummary": {"BatchSummaryRecord": {"Batches": "10","RecordCount": "59","Amount": "2594.84"}}}}Sample Code
123456789101112131415161718192021include 'slimcd.php';// Create the Slim CD object$SlimCD = new SlimCD() ;// Create a GetBatchSummary Request class$request = new Reports_GetBatchSummaryRequest() ;$request->username = 'R6UT8C6M';$request->password = '';$request->siteid = 0;$request->StartDate ='';$request->EndDate ='';$result = $SlimCD->Reports_GetBatchSummary($request);if ($result->response == 'Success') {echo 'Success!' ;}else {echo $result->response . ':' . $result->description ;}Downloads
Download full sample source. - Include
123using SlimCD;
Method
1234public GetBatchSummaryReply GetBatchSummary(GetBatchSummaryRequest request,int timeout);
Request
12345678910public class GetBatchSummaryRequest{public string username{ get; set; }public string password{ get; set; }public int siteid{ get; set; }public string startdate{ get; set; }public string enddate { get; set; }}
Reply
1234567891011121314public class GetBatchSummaryReply{public string response;public string responsecode;public string description;public string responseurl;public string batches;public string recordcount;public string amount;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
12345678910111213141516171819202122SlimCD.Reports reports = new SlimCD.Reports();reports.debug = true;reports.transURL = TransURL;reports.statsURL = StatsURL;GetBatchSummaryRequest request = new GetBatchSummaryRequest();GetBatchSummaryReply reply = new GetBatchSummaryReply();request.username = "R6UT8C6M";request.password = "";request.siteid = 0 ;request.startdate = "";request.enddate = "" ;reply = reports.GetBatchSummary(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Success");}else{MessageBox.Show("There was a problem:\n(" + reply.response & ") " + reply.description);}Downloads
Download full sample source. - Include
123using SlimCD;
Method
0123public async Task GetBatchSummary(GetBatchSummaryRequest request,int timeout);
Request
12345678910public class GetBatchSummaryRequest{public string username{ get; set; }public string password{ get; set; }public int siteid{ get; set; }public string startdate{ get; set; }public string enddate { get; set; }}
Reply
123456789101112131415public class GetSessionFieldsReplypublic class GetBatchSummaryReply{public string response;public string responsecode;public string description;public string responseurl;public string batches;public string recordcount;public string amount;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
12345678910111213141516171819202122SlimCD.Reports reports = new SlimCD.Reports();reports.debug = true;reports.transURL = TransURL;reports.statsURL = StatsURL;GetBatchSummaryRequest request = new GetBatchSummaryRequest();GetBatchSummaryReply reply = new GetBatchSummaryReply();request.username = "R6UT8C6M";request.password = "";request.siteid = 0 ;request.startdate = "";request.enddate = "" ;reply = await reports.GetBatchSummary(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Success");}else{MessageBox.Show("There was a problem:\n(" + reply.response & ") " + reply.description);}Downloads
- Include
012#import "SlimCD.h"
Method
1234567typedef void (^ReportsGetBatchSummaryReplyBlock)(ReportsGetBatchSummaryReply *reply);- (void) reportsGetBatchSummaryWithRequest:(ReportsGetBatchSummaryRequest*)request replyBlock:(ReportsGetBatchSummaryReplyBlock)replyBlock;- (void) reportsGetBatchSummaryWithRequest:(ReportsGetBatchSummaryRequest*)request timeout:(NSTimeInterval)timeout replyBlock:(ReportsGetBatchSummaryReplyBlock)replyBlock;Request
1234567891011@interface ReportsGetBatchSummaryRequest@property (strong) NSString *userName;@property (strong) NSString *password;@property (strong) NSNumber *siteID;@property (strong) NSDate* startDate;@property (strong) NSDate* endDate;@endReply
123456789@interface ReportsGetBatchSummaryReply : SlimCDReply@property (strong) NSString *batches;@property (strong) NSString *recordCount;@property (strong) NSString *amount;@endSample Code
12345678910111213141516171819202122SlimCD *api = [[SlimCD alloc] init];ReportsGetBatchSummaryRequest *request = [[ReportsGetBatchSummaryRequest alloc] init];request.userName = @"1032";request.password = @"289075";request.siteID = @228226448;request.startDate = [NSDate date];request.endDate = [NSDate date];[api reportsGetBatchSummaryWithRequest:request replyBlock:^(ReportsGetBatchSummaryReply *reply ){if ( reply.responseCode == RC_SUCCESS ){NSLog(@"Batch history loaded successfully.");}else{NSLog(@"Unable to load batch history.");}}]; - Method
1234567public void getBatchSummary(GetBatchSummaryRequest reportBatchSummaryRequest,int timeout ,GetBatchSummaryCallback callback)public void getBatchSummary(GetBatchSummaryRequest reportBatchSummaryRequest,GetBatchSummaryCallback callback)
Request
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051public class GetBatchSummaryRequest {private String username;private String password;private int siteid;private String startdate;private String enddate;public GetBatchSummaryRequest(){username="";password="";siteid=0;startdate="";enddate="";}// setters and getters.public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public int getSiteid() {return siteid;}public void setSiteid(int siteid) {this.siteid = siteid;}public String getStartdate() {return startdate;}public void setStartdate(String startdate) {this.startdate = startdate;}public String getEnddate() {return enddate;}public void setEnddate(String enddate) {this.enddate = enddate;}}
Reply
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758public class GetBatchSummaryReply {private String response="";private String responsecode="";private String description="";private String responseurl="";private BatchSummary batchSummary=null;// setters and getters.public BatchSummary getBatchSummary() {return batchSummary;}public void setBatchSummary(BatchSummary batchSummary) {this.batchSummary = batchSummary;}private String sentdata="";private String recvdata="";public String getResponse() {return response;}public void setResponse(String response) {this.response = response;}public String getResponsecode() {return responsecode;}public void setResponsecode(String responsecode) {this.responsecode = responsecode;}public String getDescription() {return description;}public void setDescription(String description) {this.description = description;}public String getResponseurl() {return responseurl;}public void setResponseurl(String responseurl) {this.responseurl = responseurl;}public String getSentdata() {return sentdata;}public void setSentdata(String sentdata) {this.sentdata = sentdata;}public String getRecvdata() {return recvdata;}public void setRecvdata(String recvdata) {this.recvdata = recvdata;}}
Sample Code
1234567891011121314151617181920212223242526// set the request parameter.GetBatchSummaryRequest request=new GetBatchSummaryRequest();request.setUsername("R6UT8C6M");request.setPassword("");request.setSiteid(0);request.setStartdate("7/16/2013");request.setEnddate("7/16/2013");//To make web service request.new ReportsGetBatchSummary().getBatchSummary(request, new GetBatchSummaryCallback(){@Overridepublic void getBatchSummaryReply(GetBatchSummaryReply reply) {if (reply.getResponse().equals("Success"))textBox.setText("Success");elsetextBox.setText("There was a problem:\n" + reply.getResponse()+"\n Descriptin "+ reply.getDescription());}});
Downloads
Download full sample source. - URL
Protocols
- SOAP/XML
- HTTP POST
- HTTP GET
Request
Status Codes
Status Code Status Description Explanation 200 200 OK Approved or declined attempts will return a response with an XML reply block 500 500 Internal Server Error The response will not contain XML, as a server error has occurred. Reply Output is in XML format if a status code of 200 is returned.
123456789<!--?xml version="1.0" encoding="utf-8" ?-->Success0OKhttps://stats.slimcd.com/wswebservices/reports.asmx/GetBatchSummary2If the block’s tag does not indicate “Success”, the tag will contain an error description which can be displayed to the end-user
Sample Code
DOWNLOAD
EXERCISER TOOL
Remarks
- Remarks Go here
- URL
123https://stats.slimcd.com/soft/json/jsonscript.asp?service=GetBatchSummary2
Protocols- HTTP POST
- HTTP GET
This function accepts either name/value pairs or JSON
Request
Reply
123456789101112131415161718{"reply": {"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/reports.asmx/GetBatchSummary2","datablock": {"BatchSummary": {"BatchSummaryRecord": {"Batches": "10","RecordCount": "59","Amount": "2594.84"}}}}Sample Code
Remarks
- None