GetOpenBatch
- Method
SlimCD.Reports.GetOpenBatch2
Purpose
Get all transactions in the current unsettled batch, returning a standard BatchTransaction.Description
Returns one BatchTransaction record for each transaction in the current batch. Note that for most processors, transactions in the open batch can still be VOIDed, UPDATEd, or have TIPEDIT performed.Business Rules
Argument List
Name Required Usage GetOpenBatchRequest 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
GetOpenBatch Request Fields
Field Name Type Length Required Description Username string 20 require Username or API Access Credential that accesses web service. Password int 20 require Plaintext password for the client account. SiteID integer 10 optional Assigned by the Slim CD administrator.. StartDate date 10 require * Plaintext password for the client account. EndDate date 10 require * Plaintext password for the client account. 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
- OpenBatchReport
- BatchTransaction
- gateid
- transactiondate
- transtype
- processor
- siteid
- batchno
- approved
- cardtype
- cardid
- cardnumber
- amount
- authcode
- cvv2reply
- avsreply
- trackindicator
- voided
- requestingip
- firstname
- lastname
- address
- city
- state
- zip
- country
- phone
- clerkname
- po
- salestax
- salestaxtype
- tip
- clienttransref
- giftbalance
- cashback
- BatchTransaction
- OpenBatchReport
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 GetOpenBatch(request,callback)function GetOpenBatch(request,timeout,callback)
Request
1234567request= {"username": "1032","password": "289075","siteid": "228226448"}
Reply
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152callback ( {"reply":{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/reports.asmx/GetOpenBatch2","datablock": {"OpenBatchReport": {"BatchTransaction": [{"gateid": "84333700","transactiondate": "10/4/2013 10:13:01 AM","transtype": "SALE","processor": "VTL","siteid": "228226448","batchno": "056","approved": "Y","cardtype": "V","cardid": "3199080","cardnumber": "4111-XXXX-XXXX-1111","amount": "2.00","authcode": "TAS773","cvv2reply": "M","avsreply": "N","trackindicator": "0","voided": "0","requestingip": "173.84.33.225","firstname": "TRACY","lastname": "MOYER","address": "831 PITTSFORD VICTOR RD","city": "PITTSFORD","state": "NY","zip": "14534","country": null,"phone": "(585) 218-9215","email": "moyer stormfrog.com","clerkname": null,"po": null,"salestax": "0.10","salestaxtype": "1","tip": "0.0000","clienttransref": "13926061683","giftbalance": "0.00","cashback": null}]}}}} );
Sample Code
123456789101112131415161718<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script><script>// <![CDATA[SlimCD.Reports.GetOpenBatch({"username": "1032","password": "289075","siteid": "228226448"},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_GetOpenBatch(Reports_GetOpenBatchRequest $request,$timeout=false)Request
12345678910class Reports_GetOpenBatchRequest{// property declarationpublic $username = '';public $password = '';public $siteid = 0;}JSON Reply
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/reports.asmx/GetOpenBatch2","datablock": {"OpenBatchReport": {"BatchTransaction": [{"gateid": "84333700","transactiondate": "10/4/2013 10:13:01 AM","transtype": "SALE","processor": "VTL","siteid": "228226448","batchno": "056","approved": "Y","cardtype": "V","cardid": "3199080","cardnumber": "4111-XXXX-XXXX-1111","amount": "2.00","authcode": "TAS773","cvv2reply": "M","avsreply": "N","trackindicator": "0","voided": "0","requestingip": "173.84.33.225","firstname": "TRACY","lastname": "MOYER","address": "831 PITTSFORD VICTOR RD","city": "PITTSFORD","state": "NY","zip": "14534","country": null,"phone": "(585) 218-9215","email": "moyer stormfrog.com","clerkname": null,"po": null,"salestax": "0.10","salestaxtype": "1","tip": "0.0000","clienttransref": "13926061683","giftbalance": "0.00","cashback": null}]}}}Sample Code
1234567891011121314151617181920include 'slimcd.php';// Create the Slim CD object$SlimCD = new SlimCD() ;// Create a GetOpenBatch Request class$request = new Reports_GetOpenBatchRequest() ;$request->username = 1032;$request->password = 289075;$request->siteid = 228226448;$result = $SlimCD->Reports_GetOpenBatch($request);if ($result->response == 'Success') {echo 'Success!' ;}else {echo $result->response . ':' . $result->description ;}Downloads
Download full sample source. - Include
123using SlimCD;
Method
123public GetOpenBatchReply GetOpenBatch(GetOpenBatchRequest request, int timeout);
Request
12345678public class GetOpenBatchRequest{public string username { get; set; }public string password { get; set; }public int siteid { get; set; }}
Reply
123456789101112public class GetOpenBatchReply{public string response;public string responsecode;public string description;public string responseurl;public string OpenBatchReport;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
1234567891011121314151617181920SlimCD.Reports reports = new SlimCD.Reports();reports.debug = true;reports.transURL = TransURL;reports.statsURL = StatsURL;GetOpenBatchRequest request = new GetOpenBatchRequest();GetOpenBatchReply reply = new GetOpenBatchReply();request.username = 1032;request.password = 289075;request.siteid = 228226448;reply = reports.GetOpenBatch(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
012public async Task GetOpenBatch(GetOpenBatchRequest request, int timeout);
Request
12345678public class GetOpenBatchRequest{public string username { get; set; }public string password { get; set; }public int siteid { get; set; }}
Reply
123456789101112public class GetOpenBatchReply{public string response;public string responsecode;public string description;public string responseurl;public string OpenBatchReport;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
1234567891011121314151617181920SlimCD.Reports reports = new SlimCD.Reports();reports.debug = true;reports.transURL = TransURL;reports.statsURL = StatsURL;GetOpenBatchRequest request = new GetOpenBatchRequest();GetOpenBatchReply reply = new GetOpenBatchReply();request.username = 1032;request.password = 289075;request.siteid = 228226448;reply = await reports.GetOpenBatch(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 (^ReportsGetOpenBatchReplyBlock)(ReportsGetOpenBatchReply *reply);- (void) reportsGetOpenBatchWithRequest:(ReportsGetOpenBatchRequest*)request replyBlock:(ReportsGetOpenBatchReplyBlock)replyBlock;- (void) reportsGetOpenBatchWithRequest:(ReportsGetOpenBatchRequest*)request timeout:(NSTimeInterval)timeout replyBlock:(ReportsGetOpenBatchReplyBlock)replyBlock;Request
123456789@interface ReportsGetOpenBatchRequest@property (strong) NSString *userName;@property (strong) NSString *password;@property (strong) NSNumber *siteID;@endReply
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647@interface ReportsGetOpenBatchReply : SlimCDReply// Array of BatchTransactionRecord objects.@property (strong) NSArray *openBatches;@end@interface BatchTransactionRecord : SlimCDObject@property (strong) NSNumber *gateID;@property (strong) NSString *transactionDate;@property (strong) NSString *transType;@property (strong) NSString *processor;@property (strong) NSNumber *siteID;@property (strong) NSString *batchNo;@property (strong) NSString *approved;@property (strong) NSString *cardType;@property (strong) NSString *cardID;@property (strong) NSString *cardNumber;@property (strong) NSString *amount;@property (strong) NSString *authCode;@property (strong) NSString *cvv2Reply;@property (strong) NSString *avsReply;@property (strong) NSString *trackIndicator;@property (strong) NSString *voided;@property (strong) NSString *requestingIP;@property (strong) NSString *firstName;@property (strong) NSString *lastName;@property (strong) NSString *address;@property (strong) NSString *city;@property (strong) NSString *state;@property (strong) NSString *zip;@property (strong) NSString *country;@property (strong) NSString *phone;@property (strong) NSString *email;@property (strong) NSString *clerkName;@property (strong) NSString *po;@property (strong) NSString *salesTax;@property (strong) NSString *salesTaxType;@property (strong) NSString *tip;@property (strong) NSString *clientTransref;@property (strong) NSString *giftBalance;@property (strong) NSString *cashBack;@endSample Code
1234567891011121314151617181920SlimCD *api = [[SlimCD alloc] init];ReportsGetOpenBatchRequest *batchRequest = [[ReportsGetOpenBatchRequest alloc] init];batchRequest.userName = @"1032";batchRequest.password = @"289075";batchRequest.siteID = @228226448;[api reportsGetOpenBatchWithRequest:batchRequest replyBlock:^(ReportsGetOpenBatchReply *reply) {if ( reply.responseCode == RC_SUCCESS ){NSLog(@"Open batch loaded successfully.");}else{NSLog(@"Unable to load open batch.");}}]; - Method
1234567public void getOpenBatch(GetOpenBatchRequest reportOpenBatchRequest,int timeout ,GetOpenBatchCallback callback)public void getOpenBatch(GetOpenBatchRequest reportOpenBatchRequest,GetOpenBatchCallback callback)
Request
12345678910111213141516171819202122232425262728293031323334353637383940414243public class GetOpenBatchRequest{private String username;private String password;private int siteid;// set the default value.public GetOpenBatchRequest(){username="";password="";siteid=0;}// 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;}}
Reply
12345678910111213141516public class GetOpenBatchReply{private OpenBatchReport openBatchReport=null;// setters and getters.public OpenBatchReport getOpenBatchReport() {return openBatchReport;}public void setOpenBatchReport(OpenBatchReport openBatchReport) {this.openBatchReport = openBatchReport;}}
Sample Code
123456789101112131415161718192021222324// set the request parameters.GetOpenBatchRequest request=new GetOpenBatchRequest();request.setUsername("1032");request.setPassword("289075");request.setSiteid(228226448);// 228226448//To make web service request.new ReportsGetOpenBatch().getOpenBatch(request, new GetOpenBatchCallback() {@Overridepublic void getOpenBatchReply(GetOpenBatchReply 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" ?-->Error2permissions failurehttps://stats.slimcd.com/wswebservices/reports.asmx/GetOpenBatch2If 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=GetOpenBatch2
Protocols- HTTP POST
- HTTP GET
This function accepts either name/value pairs or JSON
Request
Reply
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152{"reply":{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/reports.asmx/GetOpenBatch2","datablock": {"OpenBatchReport": {"BatchTransaction": [{"gateid": "84333700","transactiondate": "10/4/2013 10:13:01 AM","transtype": "SALE","processor": "VTL","siteid": "228226448","batchno": "056","approved": "Y","cardtype": "V","cardid": "3199080","cardnumber": "4111-XXXX-XXXX-1111","amount": "2.00","authcode": "TAS773","cvv2reply": "M","avsreply": "N","trackindicator": "0","voided": "0","requestingip": "173.84.33.225","firstname": "TRACY","lastname": "MOYER","address": "831 PITTSFORD VICTOR RD","city": "PITTSFORD","state": "NY","zip": "14534","country": null,"phone": "(585) 218-9215","email": "moyer stormfrog.com","clerkname": null,"po": null,"salestax": "0.10","salestaxtype": "1","tip": "0.0000","clienttransref": "13926061683","giftbalance": "0.00","cashback": null}]}}}}Sample Code
Remarks
- None