DownloadReceipt
- Method
SlimCD.Images.DownloadReceipt
Purpose
Download a receipt from the database.
Description
Downloads the receipt data that was stored for a specific gateid. The check data is returned in the same format as was used for upload. Data is base-64 encoded.
Business Rules
Argument List
Name Required Usage DownloadReceiptRequest 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
DownloadReceipt 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. GateID integer 12 require Gateway ID for previous transaction. 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
- filetype
- fileformat
- imagedata
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 DownloadReceipt(request,callback)function DownloadReceipt(request,timeout,callback)
Request
1234567request= {"username": "1032","password": "289075","gateid": "78022528"}
Reply
1234567891011121314callback ( {"reply":{"response": "Success","responsecode": "0","description": "Image download succeeded for 78022528","responseurl": "http://stats.slimcd.com/wswebservices/images.asmx/DownloadReceipt","datablock": {"filetype": "X","fileformat": "text/plain","imagedata": "text receipt"}} );
Sample Code
1234567891011121314151617181920<script src="https://trans.slimcd.com/soft/json/slimcd.js">// <![CDATA[<script type="text/javascript" src="https://trans.slimcd.com/soft/json/slimcd.js">// ]]></script><script>// <![CDATA[SlimCD.Images.DownloadReceipt({"username": "1032","password": "289075","gateid": "78022528"},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 Images_DownloadReceipt(Images_DownloadReceiptRequest $request,$timeout=false)Request
12345678910class Images_DownloadReceiptRequest{// property declarationpublic $username = '';public $password = '';public $gateid=0;}JSON Reply
12345678910111213{"response": "Success","responsecode": "0","description": "Image download succeeded for 78022528","responseurl": "http://stats.slimcd.com/wswebservices/images.asmx/DownloadReceipt","datablock": {"filetype": "X","fileformat": "text/plain","imagedata": "text receipt"}}Sample Code
12345678910111213141516171819include 'slimcd.php';// Create the Slim CD object$SlimCD = new SlimCD() ;// Create a DownloadReceipt Request class$request = new Images_DownloadReceiptRequest() ;$request->username = 1032;$request->password = 289075;$request->gateid=78022528;$result = $SlimCD->Images_DownloadReceipt($request);if ($result->response == 'Success') {echo 'Success!' ;}else {echo $result->response . ':' . $result->description ;}Downloads
- Include
123using SlimCD;
Method
123public DownloadReceiptReply DownloadReceipt(DownloadReceiptRequest request, int timeout);
Request
12345678public class DownloadReceiptRequest{public string username { get; set; }public string password { get; set; }public int gateid { get; set; }}
Reply
123456789101112131415public class DownloadReceiptReply{public string response;public string responsecode;public string description;public string responseurl;public string filetype;public string fileformat;public string imagedata;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
1234567891011121314151617181920SlimCD.Images images = new SlimCD.Images();images.debug = true;images.transURL = TransURL;images.statsURL = StatsURL;DownloadReceiptRequest request = new DownloadReceiptRequest();DownloadReceiptReply reply = new DownloadReceiptReply();request.username = 1032;request.password = 289075;request.gateid = 78022528;reply = images.DownloadReceipt(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Success");}else{MessageBox.Show("There was a problem:\n(" + reply.response & ") " + reply.description);}Downloads
- Include
123using SlimCD;
Method
0123public async Task DownloadReceipt(DownloadReceiptRequest request,int timeout);
Request
12345678public class DownloadReceiptRequest{public string username { get; set; }public string password { get; set; }public int gateid { get; set; }}
Reply
123456789101112131415public class DownloadReceiptReply{public string response;public string responsecode;public string description;public string responseurl;public string filetype;public string fileformat;public string imagedata;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
1234567891011121314151617181920SlimCD.Images images = new SlimCD.Images();images.debug = true;images.transURL = TransURL;images.statsURL = StatsURL;DownloadReceiptRequest request = new DownloadReceiptRequest();DownloadReceiptReply reply = new DownloadReceiptReply();request.username = 1032;request.password = 289075;request.gateid = 78022528;reply = await images.DownloadReceipt(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Success");}else{MessageBox.Show("There was a problem:\n(" + reply.response & ") " + reply.description);}Downloads
- INCLUDE
123#import "SlimCD.h"
Method
1234567typedef void (^ImagesDownloadReceiptReplyBlock)(ImagesDownloadReceiptReply *reply);- (void) imagesDownloadReceiptWithRequest:(ImagesDownloadReceiptRequest*)request replyBlock:(ImagesDownloadReceiptReplyBlock)replyBlock;- (void) imagesDownloadReceiptWithRequest:(ImagesDownloadReceiptRequest*)request timeout:(NSTimeInterval)timeout replyBlock:(ImagesDownloadReceiptReplyBlock)replyBlock;Request
123456789@interface ImagesDownloadReceiptRequest@property (strong) NSString *userName;@property (strong) NSString *password;@property (strong) NSNumber *gateID;@endReply
123456789@interface ImagesDownloadReceiptReply : SlimCDReply@property (strong) NSString *fileType;@property (strong) NSString *fileFormat;@property (strong) NSString *imageData;@endSample Code
123456789101112131415SlimCD *api = [[SlimCD alloc] init];ImagesDownloadReceiptRequest *request = [[ImagesDownloadReceiptRequest alloc] init];request.userName = @"1032";request.password = @"289075";request.gateID = @12345;[api imagesDownloadReceiptWithRequest:request replyBlock:^(ImagesDownloadReceiptReply *reply ){if ( reply.responseCode == RC_SUCCESS ){}}]; -
Method
123<textarea class="doc_code" cols="88" readonly="readonly" rows="1"> public void getDownloadReceipt(DownloadReceiptRequest imagesDownloadReceiptRequest,int timeout, DownloadReceiptCallback callback)public void getDownloadReceipt( DownloadReceiptRequest imagesDownloadReceiptRequest,DownloadReceiptCallback callback) </textarea>request
12345678910111213141516171819202122232425262728293031323334353637383940414243<textarea class="doc_code" cols="88" readonly="readonly" rows="10"> public class DownloadReceiptRequest {// request parameters.private String username;private String password;private int gateid;// set default value.public DownloadReceiptRequest(){username="";password="";gateid=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 getGateid() {return gateid;}public void setGateid(int gateid) {this.gateid = gateid;}}</textarea>Reply
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273<textarea class="doc_code" cols="88" readonly="readonly" rows="1"> public class DownloadReceiptReply{// response parameters.private String filetype="";private String fileformat="";private String imagedata="";private String response="";private String responsecode="";private String description="";private String responseurl="";private String sentdata="";private String recvdata="";// setters and getters.public String getFiletype() {return filetype;}public void setFiletype(String filetype) {this.filetype = filetype;}public String getFileformat() {return fileformat;}public void setFileformat(String fileformat) {this.fileformat = fileformat;}public String getImagedata() {return imagedata;}public void setImagedata(String imagedata) {this.imagedata = imagedata;}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;}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;}}</textarea>Sample Code
1234567891011121314151617181920212223242526<textarea class="doc_code" cols="88" readonly="readonly" rows="20">DownloadReceiptRequest request=new DownloadReceiptRequest();request.setUsername("9");request.setPassword("289075");request.setGateid(78022528);// To call the web service.new ImagesDownloadReceipt().getDownloadReceipt(request, new DownloadReceiptCallback() {@Overridepublic void getDownloadReceiptReply(DownloadReceiptReply reply) {if (reply.getResponse().equals("Success")){textBox.setText("Success");}else{textBox.setText("There was a problem:\n" + reply.getResponse() +"\n Descriptin "+ reply.getDescription());}}});</textarea>Downloads
- 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.
12345678910111213<!--?xml version="1.0" encoding="utf-8" ?-->Success0Image download succeeded for 78022528https://stats.slimcd.com/wswebservices/images.asmx/DownloadReceiptXtext/plainIf 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
Downloads
Exerciser Tool
Remarks
- Remarks Go here
- URL
123https://stats.slimcd.com/soft/json/jsonscript.asp?service=DownloadReceipt
Protocols- HTTP POST
- HTTP GET
This function accepts either name/value pairs or JSON
Request
Reply
1234567891011121314{"reply":{"response": "Success","responsecode": "0","description": "Image download succeeded for 78022528","responseurl": "http://stats.slimcd.com/wswebservices/images.asmx/DownloadReceipt","datablock": {"filetype": "X","fileformat": "text/plain","imagedata": "text receipt"}}Sample Code
Remarks
- None