GetReceipt
- Method
SlimCD.Transact.GetReceipt
Purpose
Retrieves a plain-text receipt.
Description
GetReceipt returns a content-type of text/plain that contains the data for the receipt. If an error occurs, GetReceipt sets the HTTP status code and status text to represent the error. If successful, the status code is set to 200 and the text for the receipt is returned as the body of the response.
Business Rules
Argument List
Name Required Usage GetReceiptRequest 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
GetReceipt 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
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 GetReceipt(request,callback)function GetReceipt(request,timeout,callback)
Request
1234567request= {"username": "R6UT8C6M","password": "","gateid": "78022528"}
Reply
123456789101112131415161718callback ( {"reply": {"response": "Success","responsecode": "0","description": "OK","responseurl": "/soft/json/jsonscript.asp","datablock": "Receipt - Ticket #:78022528\n\nRETAIL TEST ACCOUNT\nretail test 111\n610N University Drive\nCoral Springs,FL 33071\n(954) 752-9309\n\n\nDate:7/12/2013 4:04:26 AM\nTransType: AMEX SALE\nName:zeyuan wu\nCard Number: XXXX-XXXX-XXXX-431\nExpiration: XX/XX\nMerchant ID: 888000000961 / 00000001\nAuth Code: AXS290\n\nAmount: $12.00\nBalance: $1,234.00\n\nCARDMEMBER ACKNOWLEDGES RECEIPT OF\nGOODS AND/OR SERVICES IN THE AMOUNT OF\nTHE TOTALSHOWN HEREON AND AGREES TO\nPERFORM THE OBLIGATIONS SET FORTH BY\nTHE CARDMEMBER'sAGREEMENT WITH ISSUER\n\n\n [SIGNATURE ON FILE]\n____________________________________\nSIGNATURE\n\n "}} );
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.Sessions.GetReceipt({"username": "R6UT8C6M","password": "","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
123Images_DownloadSignature(Images_DownloadSignatureRequest $request,$timeout=false)Request
12345678910class Images_DownloadSignatureRequest{// property declarationpublic $username = '';public $password = '';public $gateid=0;}JSON Reply
123456789101112131415161718192021222324252627282930313233343536373839{"response": "Success","responsecode": "0","description": "Image download succeeded for 78022528","responseurl": "http://stats.slimcd.com/wswebservices/images.asmx/DownloadSignature","datablock": {"filetype": "1","fileformat": "application/octet-stream","imagedata": "030010D613508A6908A6908A6908A6908A6908A6908A6908B6908B6908B6908C6908C6908D6A08D6A08E6A08E6A08F6A0906A0916A0926A0926909369094690966809667098660996509A6409B6309C6209D6009D5F09E5E09F5D0A05B0A15A0A1580A2570A3550A3530A4510A5500A64E0A64C0A74A0A8490A8480A9460AA450AA440AB430AB420AB410AC400AC400AC400AB410AB410AB420AB430AA440A9450A9450A8470A8480A7490A64A0A64B0A54C0A44E0A34F0A3500A2510A2530A1540A05509F5709F5809E5909E5A09D5B09C5D09C5E09B5F09B6009A61099620996309865097660966709668095690946A0936B0926C0926D0916E0906F08F7108E7208D7208D7308C7408C7508B7608B7608A770897808978088790887A0877B0877B0867C0867C0857D0857D0847E0847E0837E0837E0837E0827E0827E0827E0817E0817E0807E0807F0807E0807E07F7E07F7E07F7E07F7E07E7E07E7E07E7E07E7E07F7D07F7D07F7C07F7C07F7B0807B0807A081790827808377084760867508774088730897208A7108B7108C7008C7008D7008D7008D7008D7008E7008E7008E7008E7108E7208E7208F7308F7308F7408F7508F75090760907709077091780917809278092790937909479095790967909679097780987809878099780997809A7809A7809A7809B7809B7809B7809B7809B7809A7009A7009A7009970099700997009871098710987109871098710987109871098710A5770A5770A5770A5780A4780A4780A4780A4780A4780A4780A5780A5780A6780A6780A7780A8770A9760AA750AB740AD720AE700B06E0B16C0B36A0B4680B5660B6640B8620B9600BA5F0BA5D0BB5C0BC5A0BC5A0BD590BD590BD590BD590BD590BC590BC5A0BB5B0BB5C0BA5E0B95F0B9600B8620B8630B7640B7650B7660B7660B7670B7680B7680B8690B8690B9690B9690BA690BB690BC680BD670BE660C0650C1630C2610C45F0C55D0C65C0C85A0C8590C9570CA570CA560CA560CA570C9580C85A0C75C0C55E0C3610C2640C1660C0690BF6B0BF6D0BF6F0C0700C1710C2710C3720C3720C3720C3720CB720CA720CA720CA720CA720CA720CA720CB720CC720CC710CE700CF6F0D16E0D26C0D46B0D5690D6670D8660D8640D9620DA600DB5E0DC5C0DD5A0DE580DE570DF550E0540E0520E0510E1510E1500E1500E0510E0510DF530DE540DC560DB590D95B0D85D0D65F0D5620D4640D2660D1690D06B0CF6C0CE6E0CD700CC710CC720CC730CC740CC750CC750CC750CD750CD760CE750CF750D0750D1740D2740D3730D5730D6720D7720D8710D9710DA710DB700DC700DC700DD700DE6F0DE6F0DF6F0DF6F0E06F0E0700E1700E26F0E36F0E46F0E56F0E66F0E76E0E76E0E86E0E86E0E96E0E96F0E96F0E96F0E96F0E9700E9700E9700EA700EA710EA700EB700EC700EE6F0F06D0F26C0F4690F6670F9640FB610FD5E0FF5A1025710354105511074E1084B1094910948109461094510945108451074510546103481004C0FC500F9540F55A0F25F0EF630ED680EA6C0E8700E7740E5770E47A0E37C0E27D0E17E0E17E0E17F0E17F0E27F0E27F0E37F0E57E0E67D0E97B0EB780EE750F2720F66E0FB69100651066010C5A112571175411D5112151125501274F1275012750"}}Sample Code
12345678910111213141516171819include 'slimcd.php';// Create the Slim CD object$SlimCD = new SlimCD() ;// Create a DownloadSignature Request class$request = new Images_DownloadSignatureRequest() ;$request->username = 1032;$request->password = 289075;$request->gateid=78022528;$result = $SlimCD->Images_DownloadSignature($request);if ($result->response == 'Success') {echo 'Success!' ;}else {echo $result->response . ':' . $result->description ;}Downloads
- Include
123using SlimCD;
Method
123public DownloadSignatureReply DownloadSignature(DownloadSignatureRequest request, int timeout);
Request
12345678public class DownloadSignatureRequest{public string username { get; set; }public string password { get; set; }public int gateid { get; set; }}
Reply
1234567891011121314public class DownloadSignatureReply{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;DownloadSignatureRequest request = new DownloadSignatureRequest();DownloadSignatureReply reply = new DownloadSignatureReply();request.username = 1032;request.password = 289075;request.gateid = 78022528;reply = images.DownloadSignature(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 DownloadSignature(DownloadSignatureRequest request,int timeout);
Request
12345678public class DownloadSignatureRequest{public string username { get; set; }public string password { get; set; }public int gateid { get; set; }}
Reply
1234567891011121314public class DownloadSignatureReply{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;DownloadSignatureRequest request = new DownloadSignatureRequest();DownloadSignatureReply reply = new DownloadSignatureReply();request.username = 1032;request.password = 289075;request.gateid = 78022528;reply = await images.DownloadSignature(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 (^ImagesGetReceiptReplyBlock)(ImagesGetReceiptReply *reply);- (void) imagesGetReceiptWithRequest:(ImagesGetReceiptRequest*)request replyBlock:(ImagesGetReceiptReplyBlock)replyBlock;- (void) imagesGetReceiptWithRequest:(ImagesGetReceiptRequest*)request timeout:(NSTimeInterval)timeout replyBlock:(ImagesGetReceiptReplyBlock)replyBlock;Request
123456789@interface ImagesGetReceiptRequest@property (strong) NSString *userName;@property (strong) NSString *password;@property (strong) NSNumber *gateID;@endReply
1234567@interface ImagesGetReceiptReply : SlimCDReply@property (strong) NSString *receiptText;@endSample Code
123456789101112131415SlimCD *api = [[SlimCD alloc] init];ImagesGetReceiptRequest *request = [[ImagesGetReceiptRequest alloc] init];request.userName = @"1032";request.password = @"289075";request.gateID = @12345;[api imagesGetReceiptWithRequest:request replyBlock:^(ImagesGetReceiptReply *reply ){if ( reply.responseCode == RC_SUCCESS ){}}]; -
Method
123<textarea class="doc_code" cols="88" readonly="readonly" rows="1"> public void getReceipt(GetReceiptRequest imagesGetReceiptRequest,int timeout, GetReceiptCallback callback)public void getReceipt( GetReceiptRequest imagesGetReceiptRequest,GetReceiptCallback callback) </textarea>request
123456789101112131415161718192021222324252627282930313233343536373839404142<textarea class="doc_code" cols="88" readonly="readonly" rows="10"> public class GetReceiptRequest {// request parameters.private String username;private String password;private int gateid;public GetReceiptRequest(){// set default values.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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657<textarea class="doc_code" cols="88" readonly="readonly" rows="1"> public class GetReceiptReply {// response.private String receiptText="";private String response="";private String responsecode="";private String description="";private String responseurl="";private String sentdata="";private String recvdata="";// setters and getters.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;}public String getReceiptText() {return receiptText;}public void setReceiptText(String receiptText) {this.receiptText = receiptText;}}</textarea>Sample Code
12345678910111213141516171819202122232425262728<textarea class="doc_code" cols="88" readonly="readonly" rows="20">// To set the request parameter.GetReceiptRequest request=new GetReceiptRequest();request.setUsername("R6UT8C6M");request.setPassword("");request.setGateid(78022528);// To call the web service.new ImagesGetReceipt().getReceipt(request, new GetReceiptCallback() {@Overridepublic void getReceiptReply(GetReceiptReply 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
Reply Output is in XML format.
123456789<!--?xml version="1.0" encoding="utf-8" ?-->Success0OKhttps://trans.slimcd.com/wswebservices/transact.asmx/CloseBatchY*875873Status Codes
Status Code Status Description Explanation 200 200 OK All CloseBatch attempts will return XML with this response. 500 500 Internal Server Error The response will not contain XML, as a server error has occurred. Sample Code
Remarks
- Remarks Go here
Downloads
ONLINE EXERCISER TOOL
- URL
1234https://stats.slimcd.com/soft/json/jsonscript.asp?service=GetReceipt<span style="color: #3366ff;"><strong>Protocols</strong></span>- HTTP POST
- HTTP GET
12345678This function accepts either name/value pairs or JSON<span style="color: #3366ff;"><strong>Request</strong></span>[tabs][tab title="JSON"]1234567{"username": "R6UT8C6M","password": "","gateid": "78022528"}Reply
123456789101112131415161718{"reply": {"response": "Success","responsecode": "0","description": "OK","responseurl": "/soft/json/jsonscript.asp","datablock": "Receipt - Ticket #:78022528\n\nRETAIL TEST ACCOUNT\nretail test 111\n610N University Drive\nCoral Springs,FL 33071\n(954) 752-9309\n\n\nDate:7/12/2013 4:04:26 AM\nTransType: AMEX SALE\nName:zeyuan wu\nCard Number: XXXX-XXXX-XXXX-431\nExpiration: XX/XX\nMerchant ID: 888000000961 / 00000001\nAuth Code: AXS290\n\nAmount: $12.00\nBalance: $1,234.00\n\nCARDMEMBER ACKNOWLEDGES RECEIPT OF\nGOODS AND/OR SERVICES IN THE AMOUNT OF\nTHE TOTALSHOWN HEREON AND AGREES TO\nPERFORM THE OBLIGATIONS SET FORTH BY\nTHE CARDMEMBER'sAGREEMENT WITH ISSUER\n\n\n [SIGNATURE ON FILE]\n____________________________________\nSIGNATURE\n\n "}}Sample Code
Remarks
- None