SendSession
-
Method
SlimCD.Sessions.SendSession
Purpose
Sends a link via email or sms-text that allows the session to be displayed/filled on a remote PC.
Description
SendSession is used to send a session URL via Email or SMS text message. The recipient can then follow this link on their PC or Mobile device to the previously created hosted payment page where they can enter their payment information and complete the transaction.
Business Rules
Request Fields
FieldNameTypeLengthRequiredDescriptionUserNamestring20requiredUsername or API Access Credential that accesses web service.Passwordstring20requiredPlaintext password for the client account.SiteIDinteger10optionalAssigned by the Slim CD administrator.BatchNumberstring12noThe processor’s batch number. Do not use unless instructed by SLIM CD.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.
2 If an API Access Credential is only authorized for a single sites, passing in the default siteid value of zero will close the currently open batch for that single site.
3 If the API Access Credential is authorized for multiple sites, the SiteID must be specified to indicate which batch to close.
3 If the username is set to a clientid or username other than an API Access Credential, you must specify a non-zero siteidto indicate which batch to close.
5 The batchnumber should always be passed as an empty string to close the open batch. Specifying a batch number will re-close an existing batch and may result in duplicate charges.
Reply Fields
replyouter tag for the reply data blockresponseSuccess, FAIL, Errorresponse code0, 1, 2 (respective) matching the abovereponseurlThe Slimcd.com url which was called for this operationdescriptionIf successful, this will contain the single word, OK. Otherwise it will contain a description of failure or error which occurreddatablockThe confirmation text returned from the server.Reply Hierarchy
- reply
- response
- responsecode
- description
- responseurl
- datablock
Remarks
- SendSession Input Values identify the session and authenticate access to the session information.
Example
- Sample HTTP GET:
1https://stats.slimcd.com/soft/sendsession.asp?clientid=1032&password=289075&sessionid=22ADCBF1F23F19D125DF76B00B6DC75B201CB6CF&phone=&email=bsmith@gmail.com&send_email=yes&send_sms=no<br data-mce-bogus="1">- Sample HTTP POST:
12URL:<a href="https://stats.slimcd.com/soft/sendsession.asp" data-mce-href="https://stats.slimcd.com/soft/sendsession.asp">https://stats.slimcd.com/soft/sendsession.asp</a>POSTDATA:clientid=1032&password=289075&sessionid=22ADCBF1F23F19D125DF76B00B6DC75B201CB6CF&phone=&email=bsmith@gmail.com&send_email=yes&send_sms=no - reply
-
Include
1<script type="text/javascript" src="https://trans.slimcd.com/soft/json/slimcd.js"></script>Method
1function SendSession(request,callback) <br><br>function SendSession(request,timeout,callback)request
1234567891011121314request= {"username": "1032","password": "289075","sessionid": "5A380D260C67BA229484AB557B41DF2CBBED3090","message": "Type your message to recipient here.","send_email": "no","email": "","email_from": "","send_html": "no","send_sms": "no","phone": ""}Reply
123456789101112131415161718callback ( {"response": "Success","responsecode": "0","description": "OK","responseurl": "/soft/SendSession.asp","datablock": {"email_result": {"status": "SENT","info": null},"sms_result": {"status": "NONE","info": null}}} );Sample Code
1234567891011121314151617181920212223242526<script type="text/javascript" src="https://trans.slimcd.com/soft/json/slimcd.js"></script><script type="text/javascript">SlimCD.Sessions.SendSession({"username": "1032","password": "289075","sessionid": "5A380D260C67BA229484AB557B41DF2CBBED3090","message": "Type your message to recipient here.","send_email": "no","email": "","email_from": "","send_html": "no","send_sms": "no","phone": ""},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
- Include
Download full sample source. - Include
- Include
1#import "SlimCD.h"
Method
1234567typedef void (^SessionsSendSessionReplyBlock)(SessionsSendSessionReply *reply);- (void) sessionsSendSessionWithRequest:(SessionsSendSessionRequest*)request replyBlock:(SessionsSendSessionReplyBlock)replyBlock;- (void) sessionsSendSessionWithRequest:(SessionsSendSessionRequest*)request timeout:(NSTimeInterval)timeout replyBlock:(SessionsSendSessionReplyBlock)replyBlock;request
12345678910111213@interface SessionsSendSessionRequest@property (strong) NSString *userName;@property (strong) NSString *password;@property (strong) NSNumber *clientID;@property (strong) NSString *sessionID;@property (strong) NSString *message;@property (strong) NSString *phone;@property (strong) NSString *email;@property (strong) NSString *email_from;@property (strong) NSString *send_html;@endReply
123456@interface SessionsSendSessionReply : SlimCDReply@property (strong) SendReceiptInfo *emailResult;@property (strong) SendReceiptInfo *smsResult;@endSample Code
12345678910111213141516171819202122SlimCD *api = [[SlimCD alloc] init];SessionsSendSessionRequest *request = [[SessionsSendSessionRequest alloc] init];request.userName = @"1032";request.password = @"289075";request.clientID = @1032;request.sessionID = @"12345";request.message = @"Send Session Message";request.email = @"name@domain.com";request.phone = @"9542223333";[api sessionsSendSessionWithRequest:request replyBlock:^(SessionsSendSessionReply *reply ){if ( reply.responseCode == RC_SUCCESS ){NSLog(@"Session sent successfully.");}else{NSLog(@"Unable to send session.");}}]; -
Method
123<textarea class="doc_code" cols="88" readonly="readonly" rows="1"> public void getSendSession(SendSessionRequest sessionSendRequest,int timeout ,SendSessionCallback callback)public void getSendSession(SendSessionRequest sessionSendRequest,SendSessionCallback callback) </textarea>request
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112<textarea class="doc_code" style="width: 1180px; height: 151px;" cols="88" readonly="readonly" rows="10"> public class SendSessionRequest {// request parameters.private String phone;private String send_sms;private String send_html;private String email_from;private String email;private String send_email;private String message;private String sessionid;private String password;private String username;public SendSessionRequest(){// set the default value.phone="";send_sms="";send_html="";email_from="";email="";send_email="";message="";sessionid="";password="";username="";}// setter and getters.public String getPhone() {return phone;}public void setPhone(String phone) {this.phone = phone;}public String getSend_sms() {return send_sms;}public void setSend_sms(String send_sms) {this.send_sms = send_sms;}public String getSend_html() {return send_html;}public void setSend_html(String send_html) {this.send_html = send_html;}public String getEmail_from() {return email_from;}public void setEmail_from(String email_from) {this.email_from = email_from;}public String getEmail() {return email;}public void setEmail(String email) {this.email = email;}public String getSend_email() {return send_email;}public void setSend_email(String send_email) {this.send_email = send_email;}public String getMessage() {return message;}public void setMessage(String message) {this.message = message;}public String getSessionid() {return sessionid;}public void setSessionid(String sessionid) {this.sessionid = sessionid;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}}</textarea>Reply
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263<textarea class="doc_code" style="width: 1181px; height: 14px;" cols="88" readonly="readonly" rows="1"> public class SendSessionReply{// responseprivate SendSessionResult email_result=null;private SendSessionResult sms_result=null;private String response="";private String responsecode="";private String description="";private String responseurl="";private String sentdata="";private String recvdata="";// setter 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 SendSessionResult getEmail_result() {return email_result;}public void setEmail_result(SendSessionResult email_result) {this.email_result = email_result;}public SendSessionResult getSms_result() {return sms_result;}public void setSms_result(SendSessionResult sms_result) {this.sms_result = sms_result;}}</textarea>Sample Code
1234567891011121314151617181920212223242526272829303132<textarea class="doc_code" style="width: 1185px; height: 156px;" cols="88" readonly="readonly" rows="20">// Set the request parameter.SendSessionRequest request=new SendSessionRequest();request.setUsername("1032");request.setPassword("289075");request.setSessionid("5A380D260C67BA229484AB557B41DF2CBBED3090");request.setEmail("no");request.setEmail_from("");request.setMessage("");request.setPhone("");request.setSend_email("");request.setSend_html("no");request.setSend_sms("no");new SessionSendSession().getSendSession(request,new SendSessionCallback() {@Overridepublic void getSendSessionReply(SendSessionReply 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.
1234567891011121314151617181920212223242526272829303132333435Success0OKhttps://stats.slimcd.com/wswebservices/sessions.asmx/SearchSessions0CC5E2FAFC6F503DF03AA6CA693A295071A9DC387/18/2013 9:34:42 AM13MeghansTestForm1032228226448retail test 11174SALEU2.0000TrueTrue<decline_count>0<template_flag>FalseIf 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=SearchSessions
Protocols- HTTP POST
- HTTP GET
This function accepts either name/value pairs or JSON
Request
Reply
12345678910111213141516171819202122232425262728293031323334353637383940{"reply": {"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/sessions.asmx/SearchSessions","datablock": {"Sessions": {"Session": {"SessionID": "0C7622D38DA638D3D167CBB736A75A46FDC4D873","Date": "7/22/2013 1:27:57 AM","FormID": "67","FormName": "simple","ClientID": "1032","SiteID": "228226448","SiteName": "retail test 111","PriceID": "74","TransType": "SALE","first6": null,"last4": null,"Approved": "U","Amount": "10.0000","ApprovedAmt": null,"Reason": null,"GateID": null,"AuthCode": null,"AVSReply": null,"CVV2Reply": null,"Cancelled": "False","Completed": "False","processortoken": null,"decline_count": "0","template_flag": "False"}}}}}Sample Code
Remarks
- None