MultiSession
- Method
SlimCD.Sessions.MultiSession
Purpose
Creates a unique session from a master-session and displays it. Used instead of ShowSession when the form is a template form.
Description
MultiSession is used to display a previously-created session similarly to ShowSession. It is designed to accept limited input and display HTML output so that the SessionID value can be included in the URL that is provided as a command-line when launching in a browser. This also works well when redirecting from one web server to another. Unlike ShowSession, MultiSession is designed to be used by multiple recipients such as for charitable donations. MultiSession creates a unique session from the original template each time it is called.
Business Rules
Argument List
Name Required Usage MultiSessionRequest 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
MultiSession Request Fields
Field Name Type Length Required Description SessionID string 40 require HEX string uniquely representing the session Amount string 20 optional Amount of the transaction, which can override the amount specified by CreateSession. Reply Fields
MultiSession is used to display HTML in a browser or browser control.
- For browser-based references: HTML is displayed.
- For class libraries: It returns a formatted URL.
Reply Hierarchy
It returns either a URL or HTML, not intended to be a structured document to parse.
Remarks
- MultiSession requires a single input field, the SessionID. A form is displayed based on the configuration settings for the form on the SLIM CD server.
- The MultiSession service returns an HTML web page for display in a browser. The displayed form and the actions of that form can be managed using the SLIM CD HOSTED PAYMENT PAGES functionality in the SLIM CD website.
- When using libraries, the libraries will return a formatted url with the specified sessionid
(ex: https://stats.slimcd.com/soft/multisession.asp?sessionid=….&amount=…) - When using JavaScript/PHP (web-based languages), MultiSession will set the browser’s location so that the HTML is displayed (it will redirect the browser to the created url)
- It is possible to configure HOSTED PAYMENT PAGES to perform a PostBack and/or Redirection at the end of the payment. Alternatively, the CheckSession and CancelSession functions can be used to monitor the outcome of the activity in a HOSTED PAYMENT PAGE.
- Include
012<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script>
Method
12345function DestroySession(request,callback)function DestroySession(request,timeout,callback)
Request
1234567request= {"username": "1032","password": "289075","sessionid": "85F9FA841DDB173B10AD35E0B9EA097E9CC68321"}
Reply
1234567891011callback ( {"reply":{"response": "Success","responsecode": "0","description": "OK","responseurl": "/soft/DestroySession.asp","datablock": null}} );
Sample Code
123456789101112131415161718<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script><script>// <![CDATA[SlimCD.Sessions.DestroySession({"username": "1032","password": "289075","sessionid": "6B9AC5C22EF62BB46EDBC2D2C49215D1157E3439",},function (reply) {if (reply.response == "Success") {alert ('Batch Closed');} else {alert('There was a problem closing the batch:\r\n' + reply.description);}});// ]]></script>
Download full sample source. - Include
012include 'slimcd.php';
Method
123function Sessions_DestroySessions (Sessions_DestroySessionsRequest $request,$timeout=false)Request
12345678910class Sessions_DestroySessionsRequest{// property declarationpublic $username = '';public $password = '';public $sessionid="";}JSON Reply
123456789{"response": "Success","responsecode": "0","description": "OK","responseurl": "/soft/DestroySession.asp","datablock": null}Sample Code
12345678910111213141516171819include 'slimcd.php';// Create the Slim CD object$SlimCD = new SlimCD() ;// Create a DestroySession Request class$request = new Sessions_DestroySessionsRequest() ;$request->username = '1032';$request->password = '289075';$request->sessionid = "4C2A7F35504D2466CAB2D35A4A270735A49F4708";$result = $SlimCD->Sessions_DestroySessions($request);if ($result->response == 'Success') {echo 'Success!' ;}else {echo $result->response . ':' . $result->description ;}Downloads Download full sample source.
- Include
123using SlimCD;
Method
123public DestroySessionReply DestroySession(DestroySessionRequest request, int timeout);
Request
12345678public class DestroySessionRequest{public string username { get; set; }public string password { get; set; }public string sessionid { get; set; }}
Reply
123456789101112public class DestroySessionReply{public string response;public string responsecode;public string description;public string responseurl;public string datablock;public string senddata;public string recvdata;}
Cross Reference:ClientSample Code
1234567891011121314151617SlimCD.Sessions sessions = new SlimCD.Sessions();DestroySessionRequest request = new DestroySessionRequest();DestroySessionReply reply = new DestroySessionReply();request.username = 1032;request.password = 289075;request.sessionid ="BCCE198856FD39E18BC00B70FCFEDA693D3A4FD9";reply = sessions.DestroySession(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
0123public async Task DestroySession(DestroySessionRequest request,int timeout);
Request
12345678public class DestroySessionRequest{public string username { get; set; }public string password { get; set; }public string sessionid { get; set; }}
Reply
123456789101112public class DestroySessionReply{public string response;public string responsecode;public string description;public string responseurl;public string datablock;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
1234567891011121314151617SlimCD.Sessions sessions = new SlimCD.Sessions();DestroySessionRequest request = new DestroySessionRequest();DestroySessionReply reply = new DestroySessionReply();request.username = 1032;request.password = 289075;request.sessionid ="BCCE198856FD39E18BC00B70FCFEDA693D3A4FD9";reply = await sessions.DestroySession(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.
- Method
1234567public void getDestroySession(DestroySessionRequest sessionDestroyRequest,int timeout ,DestroySessionCallback callback)public void getDestroySession(DestroySessionRequest sessionDestroyRequest,DestroySessionCallback callback)
Request
12345678910111213141516171819202122232425262728293031323334353637383940414243public class DestroySessionRequest {// request parameters.private String username;private String password;private String sessionid;public DestroySessionRequest(){username="";password="";sessionid="";}// 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 String getSessionid() {return sessionid;}public void setSessionid(String sessionid) {this.sessionid = sessionid;}}
Reply
123456789101112131415public class DestroySessionReply {private String datablock="";// setter and getters.public String getDatablock() {return datablock;}public void setDatablock(String datablock) {this.datablock = datablock;}}
Sample Code
12345678910111213141516171819202122232425// Set the request parameter.DestroySessionRequest request=new DestroySessionRequest();request.setUsername("1032");request.setPassword("289075");request.setSessionid("B0625D4FF1783B493AF0D67F8F8777F55A50B49D");new SessionDestroySession().getDestroySession(request,new DestroySessionCallback(){@Overridepublic void getDestroySessionReply(DestroySessionReply 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.
1234567891011<!--?xml version="1.0" encoding="utf-8" ?--><!--?xml version="1.0" encoding="utf-8" ?-->Success0OK/soft/destroysession.aspAF61FC3FDEF3F2855B599598CD3A11FA485AFC49If 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
SIMPLE HTML FORM TO SHOW DestroySESSION
Remarks
- Remarks Go here
- URL
123https://stats.slimcd.com/soft/json/jsonscript.asp?service=DestroySession
Protocols- HTTP POST
- HTTP GET
This function accepts either name/value pairs or JSON
Request
Reply
1234567891011{"reply": {"response": "Success","responsecode": "0","description": "OK","responseurl": "/soft/DestroySession.asp","datablock": null}}Sample Code
Remarks
- None