GetClosedBatchTransactions
- Method
SlimCD.Reports.GetClosedBatchTransactions2
Purpose
Get the transactions in a specific batch, returning a standard BatchTransaction.
Description
GetClosedBatchTransactions lists the individual credit card transactions for the siteid and batched specified. A BatchTransaction item is returned for each transaction in the batch. Note that batches only contain credit/debit card transactions and not check or gift card transactions.Business Rules
Argument List
Name Required Usage GetClosedBatchTransactionsRequest 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
GetClosedBatchTransactions 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.. BatchID int 12 require Value returned from GetBatchHistory that identifies an individual batch. 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
- CloseBatchReport
- 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
- CloseBatchReport
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 GetClosedBatchTransactions(request,callback)function GetClosedBatchTransactions(request,timeout,callback)
Request
12345678request= {"username": "R6UT8C6M","password": "","siteid": "0","batchid": "892004"}
Reply
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849callback ( {"reply":{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/reports.asmx/GetClosedBatchTransactions2","datablock": {"CloseBatchReport": {"BatchTransaction": {"gateid": "78246851","transactiondate": "7/16/2013 12:00:59 AM","transtype": "SALE","processor": "VTL","siteid": "228226448","batchno": "945","approved": "Y","cardtype": "A","cardid": "11959","cardnumber": "3714-XXXX-XXXX-431","amount": "12.00","authcode": "AXS896","cvv2reply": null,"avsreply": null,"trackindicator": "0","voided": "0","requestingip": "192.168.101.120","firstname": "zeyuan","lastname": "wu","address": null,"city": null,"state": null,"zip": null,"country": null,"phone": "na","email": null,"clerkname": "ADMIN","po": null,"salestax": "0.00","salestaxtype": "0","tip": "0.0000","clienttransref": null,"giftbalance": "1234.00","cashback": null}}}} );
Sample Code
12345678910111213141516171819<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script><script>// <![CDATA[SlimCD.Reports.GetClosedBatchTransactions({"username": "R6UT8C6M","password": "","siteid": "0","batchid": "892004"},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_GetClosedBatchTransactions(Reports_GetClosedBatchTransactionsRequest $request,$timeout=false)Request
1234567891011class Reports_GetClosedBatchTransactionsRequest{// property declarationpublic $username = '';public $password = '';public $siteid = 0;public $batchid = 0;}JSON Reply
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/reports.asmx/GetClosedBatchTransactions2","datablock": {"CloseBatchReport": {"BatchTransaction": {"gateid": "78246851","transactiondate": "7/16/2013 12:00:59 AM","transtype": "SALE","processor": "VTL","siteid": "228226448","batchno": "945","approved": "Y","cardtype": "A","cardid": "11959","cardnumber": "3714-XXXX-XXXX-431","amount": "12.00","authcode": "AXS896","cvv2reply": null,"avsreply": null,"trackindicator": "0","voided": "0","requestingip": "192.168.101.120","firstname": "zeyuan","lastname": "wu","address": null,"city": null,"state": null,"zip": null,"country": null,"phone": "na","email": null,"clerkname": "ADMIN","po": null,"salestax": "0.00","salestaxtype": "0","tip": "0.0000","clienttransref": null,"giftbalance": "1234.00","cashback": null}}}}Sample Code
123456789101112131415161718192021include 'slimcd.php';// Create the Slim CD object$SlimCD = new SlimCD() ;// Create a GetClosedBatchTransactions Request class$request = new Reports_GetClosedBatchTransactionsRequest() ;$request->username = 'R6UT8C6M';$request->password = '';$request->siteid = 0;$request->batchid = 892004;$result = $SlimCD->Reports_GetClosedBatchTransactions($request);if ($result->response == 'Success') {echo 'Success!' ;}else {echo $result->response . ':' . $result->description ;}Downloads
Download full sample source. - Include
123using SlimCD;
Method
123public GetClosedBatchTransactionsReply GetClosedBatchTransactions(GetClosedBatchTransactionsRequest request, int timeout);
Request
123456789public class GetClosedBatchTransactionsRequest{public string username{ get; set; }public string password{ get; set; }public int siteid{ get; set; }public int batchid { get; set; }}
Reply
123456789101112public class GetClosedBatchTransactionsReply{public string response;public string responsecode;public string description;public string responseurl;public string Batches;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;GetClosedBatchTransactionsRequest request = new GetClosedBatchTransactionsRequest();GetClosedBatchTransactionsReply reply = new GetClosedBatchTransactionsReply();request.username ="R6UT8C6M" ;request.password ="" ;request.siteid =0 ;request.batchid = "892004";reply = reports.GetClosedBatchTransactions(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 GetClosedBatchTransactions(GetClosedBatchTransactionsRequest request, int timeout);
Request
123456789public class GetClosedBatchTransactionsRequest{public string username{ get; set; }public string password{ get; set; }public int siteid{ get; set; }public int batchid { get; set; }}
Reply
12345678910111213public class GetSessionFieldsReplypublic class GetClosedBatchTransactionsReply{public string response;public string responsecode;public string description;public string responseurl;public string Batches;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;GetClosedBatchTransactionsRequest request = new GetClosedBatchTransactionsRequest();GetClosedBatchTransactionsReply reply = new GetClosedBatchTransactionsReply();request.username ="R6UT8C6M" ;request.password ="" ;request.siteid =0 ;request.batchid = "892004";reply = await reports.GetClosedBatchTransactions(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Success");}else{MessageBox.Show("There was a problem:\n(" + reply.response & ") " + reply.description);}Downloads
- Method
12345typedef void (^ReportsGetClosedBatchReplyBlock)(ReportsGetClosedBatchReply *reply);- (void) reportsGetClosedBatchWithRequest:(ReportsGetClosedBatchRequest*)request replyBlock:(ReportsGetClosedBatchReplyBlock)replyBlock;- (void) reportsGetClosedBatchWithRequest:(ReportsGetClosedBatchRequest*)request timeout:(NSTimeInterval)timeout replyBlock:(ReportsGetClosedBatchReplyBlock)replyBlock;
Request
12345678910@interface ReportsGetClosedBatchRequest : SlimCDRequest@property (strong) NSString *userName;@property (strong) NSString *password;@property (strong) NSNumber *siteID;@property (strong) NSNumber *batchID;@endReply
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647@interface ReportsGetClosedBatchReply : SlimCDReply// Array of BatchTransactionRecord@property (strong) NSArray *closedBatches;@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];ReportsGetClosedBatchRequest *request = [[ReportsGetClosedBatchRequest alloc] init];request.userName = @"1032";request.password = @"289075";request.siteID = @228226448;request.batchID = @12345;[api reportsGetClosedBatchWithRequest:request replyBlock:^(ReportsGetClosedBatchReply *reply) {if ( reply.responseCode == RC_SUCCESS ){NSLog(@"Closed batch transactions loaded successfully.");}else{NSLog(@"Unable to load closed batch transactions.");}}]; - Method
1234567public void getClosedBatchTransactions(GetClosedBatchTransactionsRequestreportClosedBatchTransactionsRequest,int timeout ,GetClosedBatchTransactionsCallback callback)public void getClosedBatchTransactions(GetClosedBatchTransactionsRequestreportClosedBatchTransactionsRequest,GetClosedBatchTransactionsCallback callback)
Request
123456789101112131415161718192021222324252627282930313233343536373839404142public class GetClosedBatchTransactionsRequest {private String username;private String password;private int siteid;private int batchid;public GetClosedBatchTransactionsRequest(){username="";password="";siteid=0;batchid=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;}public int getBatchid() {return batchid;}public void setBatchid(int batchid) {this.batchid = batchid;}}Reply
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657public class GetClosedBatchTransactionsReply {private String response="";private String responsecode="";private String description="";private String responseurl="";private CloseBatchReport closeBatchReport=null;private String sentdata="";private String recvdata="";// setters and getetrs.public CloseBatchReport getCloseBatchReport() {return closeBatchReport;}public void setCloseBatchReport(CloseBatchReport closeBatchReport) {this.closeBatchReport = closeBatchReport;}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.GetClosedBatchTransactionsRequest request=new GetClosedBatchTransactionsRequest();request.setUsername("R6UT8C6M");request.setPassword("");request.setSiteid(228226448);request.setBatchid(892004);new ReportsGetClosedBatchTransactions().getClosedBatchTransactions(request,new GetClosedBatchTransactionsCallback(){@Overridepublic void getClosedBatchTransactionsReply(GetClosedBatchTransactionsReply 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/GetClosedBatchTransactions2If 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=GetClosedBatchTransactions2
Protocols- HTTP POST
- HTTP GET
This function accepts either name/value pairs or JSON
Request
Reply
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051{"reply": {"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/reports.asmx/GetClosedBatchTransactions2","datablock": {"CloseBatchReport": {"BatchTransaction": {"gateid": "78246851","transactiondate": "7/16/2013 12:00:59 AM","transtype": "SALE","processor": "VTL","siteid": "228226448","batchno": "945","approved": "Y","cardtype": "A","cardid": "11959","cardnumber": "3714-XXXX-XXXX-431","amount": "12.00","authcode": "AXS896","cvv2reply": null,"avsreply": null,"trackindicator": "0","voided": "0","requestingip": "192.168.101.120","firstname": "zeyuan","lastname": "wu","address": null,"city": null,"state": null,"zip": null,"country": null,"phone": "na","email": null,"clerkname": "ADMIN","po": null,"salestax": "0.00","salestaxtype": "0","tip": "0.0000","clienttransref": null,"giftbalance": "1234.00","cashback": null}}}}}Sample Code
Remarks
- None