Sample Code
-
123456789101112curl https://trans.slimcd.com/soft/json/jsonpayment.asp--data-urlencode "username=R6UT8C6M"--data-urlencode "transtype=SALE"--data-urlencode "amount=10.00"--data-urlencode "cardnumber=4111111111111111"--data-urlencode "expmonth=12"--data-urlencode "expyear=49"--data-urlencode "product=MyCurl"--data-urlencode "ver=1.0"--data-urlencode "key=SVD-072-5QQ6-5K58" ;
-
1234567891011121314151617181920212223<script type="text/javascript" src="https://trans.slimcd.com/soft/json/slimcd.js"></script><script>SlimCD.Transact.ProcessTransaction( {"username": "R6UT8C6M", "transtype": "SALE", "amount": "10.00", "cardnumber": "4111111111111111", "expmonth": "12", "expyear": "49", "product" : "MyJavaScript", "ver" : "1.0"},function (reply) {if (reply.response == "Success") {alert('Approved!');}else {alert('There was a problem processing the payment:\r\n(' + reply.description + ') ' + reply.description);}} ) ;</script>
-
12345678910111213141516171819202122232425262728293031$.support.cors=true;$.ajax({type: 'POST',url: 'https://trans.slimcd.com/soft/json/jsonpayment.asp',crossDomain: true,timeout: 60000,contentType: "application/json",data: { "username":"R6UT8C6M", "password":"", "transtype": "SALE", "amount": "10.00", "cardnumber":"4111111111111111", "expmonth":"12", "expyear":"49", "product" : "MyJQuery", "ver" : "1.0" } ,dataType: 'jsonp',success: function(responseData, textStatus, jqXHR) {if (responseData.reply.response == 'Success') {alert('Approved!') ;}else {alert("reply=" + responseData.reply.response + ":" + responseData.reply.description) ;}},error: function (responseData, textStatus, errorThrown) {alert('POST failed:' + textStatus + '=' + errorThrown);}});
-
123456789101112131415161718192021222324include 'slimcd.php';// Create the Slim CD object$SlimCD = new SlimCD() ;// Create a ProcessTransaction Request class$request = new Transact_ProcessTransactionRequest() ;$request->username = '1032';$request->password = '289075';$request->clientid = '1032';$request->siteid = 228226448 ;$request->priceid = 74 ;$request->transtype = 'SALE' ;$request->amount = '10.00' ;$request->cardnumber = '4111111111111111' ;$request->expmonth = '12' ;$request->expyear = '49' ;$request->product = 'MyPHP' ;$request->ver = '1.0' ;$request->key = 'SVD-072-5QQ6-5K58' ;$reply = $SlimCD->Transact_ProcessTransaction($request);echo var_dump($reply) ;
-
123456789101112131415161718192021222324252627SlimCD.Transact transact = new SlimCD.Transact();ProcessTransactionRequest request = new ProcessTransactionRequest();ProcessTransactionReply reply = new ProcessTransactionReply();request.username = "1032";request.password = "289075";request.clientid = 1032;request.siteid = 228226448 ;request.priceid = 74 ;request.transtype = "SALE" ;request.amount = "10.00" ;request.cardnumber = "4111111111111111" ;request.expmonth = "12" ;request.expyear = "49" ;request.product = "MyCSharp" ;request.ver = "1.0" ;request.key = "SVD-072-5QQ6-5K58" ;reply = transact.ProcessTransaction(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Approved");}else{MessageBox.Show("There was a problem processing the payment:\r\n" + reply.description);}
-
12345678910111213141516171819202122232425Rem VB.NET 2.0 or greater SYNCHRONOUS LIBRARY CALLDim transact As New SlimCD.Transact()Dim request As New ProcessTransactionRequest()Dim reply As New ProcessTransactionReply()request.username = "1032"request.password = "289075"request.clientid = 1032request.siteid = 228226448request.priceid = 74request.transtype = "SALE"request.amount = "10.00"request.cardnumber = "4111111111111111"request.expmonth = "12"request.expyear = "49"request.product = "MyCSharp"request.ver = "1.0"request.key = "SVD-072-5QQ6-5K58"reply = transact.ProcessTransaction(request, 60)If reply.response.ToUpper() = "SUCCESS" ThenMessageBox.Show("Approved")ElseMessageBox.Show("There was a problem processing the payment:" & vbCr & vbLf + reply.description)End If
-
123456789101112131415161718192021222324252627SlimCD.Transact transact = new SlimCD.Transact();ProcessTransactionRequest request = new ProcessTransactionRequest();ProcessTransactionReply reply = new ProcessTransactionReply();request.username = "1032";request.password = "289075";request.clientid = 1032;request.siteid = 228226448 ;request.priceid = 74 ;request.transtype = "SALE" ;request.amount = "10.00" ;request.cardnumber = "4111111111111111" ;request.expmonth = "12" ;request.expyear = "49" ;request.product = "MyCSharp" ;request.ver = "1.0" ;request.key = "SVD-072-5QQ6-5K58" ;reply = await transact.ProcessTransaction(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Approved");}else{MessageBox.Show("There was a problem processing the payment:\r\n" + reply.description);}
-
12345678910111213141516171819202122232425Rem VB.NET 4.5 or greater ASYNCHRONOUS LIBRARY CALLDim transact As New SlimCD.Transact()Dim request As New ProcessTransactionRequest()Dim reply As New ProcessTransactionReply()request.username = "1032"request.password = "289075"request.clientid = 1032request.siteid = 228226448request.priceid = 74request.transtype = "SALE"request.amount = "10.00"request.cardnumber = "4111111111111111"request.expmonth = "12"request.expyear = "49"request.product = "MyCSharp"request.ver = "1.0"request.key = "SVD-072-5QQ6-5K58"reply = Await transact.ProcessTransaction(request, 60)If reply.response.ToUpper() = "SUCCESS" ThenMessageBox.Show("Approved")ElseMessageBox.Show("There was a problem processing the payment:" & vbCr & vbLf + reply.description)End If
-
123456789101112131415161718192021222324252627SlimCD *api = [[SlimCD alloc] init];TransactProcessTransactionRequest *request = [[TransactProcessTransactionRequest alloc] init];request.userName = @"1032";request.password = @"289075";request.clientID = @1032;request.siteID = @228226448;request.priceID = @74;request.transType = @"SALE";request.amount = @"10.00";request.cardNumber = @"4111111111111111";request.expMonth = @"12";request.expYear = @"2049";request.product = @"MyObjectiveC" ;request.ver = @"1.0" ;request.key = @"SVD-072-5QQ6-5K58" ;[api transactProcessTransactionWithRequest:request replyBlock:^(TransactProcessTransactionReply *reply) {if ( reply.responseCode == RC_SUCCESS ){NSLog(@"Approved");}else{NSLog(@"There was a problem processing the payment: %@",reply.responseDescription);}}];
-
123456789101112131415161718192021222324252627282930313233343536373839// set the request parameters.ProcessTransactionRequest request=new ProcessTransactionRequest();// Credentialrequest.setUsername("P7RCWAYW");request.setPassword("2898075");request.setClientid(1032);request.setSiteid(228226448);request.setPriceid(74);request.setKey("");// Transactionrequest.setTranstype("SALE");request.setAmount("11.00");request.setClerkname("asdf");// Card datarequest.setCardnumber("4417122900000002");request.setExpmonth("12");request.setExpyear("49");// Applicationrequest.setProduct("SLIMCDAndroid");request.setVersion("1.0");//To make web service request.new TransactProcessTransaction().processTransaction(request,new ProcessTransactionCallback() {@Overridepublic void getProcessTransactionReply(ProcessTransactionReply reply){if (reply.getResponse().equals("Success"))textBox.setText("Success");elsetextBox.setText("There was a problem:\n" + reply.getResponse()+"\n Descriptin "+ reply.getDescription());}});
-
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647// A WebReferecen to "https://trans.slimcd.com/wswebservices/transact.asmx" is required for this to work.// In the case below, it is called "Trans"String userName = "1032" ;String password = "289075" ;Trans.transact wsTran = new Trans.transact();string xmlDataString = "<request>" ;xmlDataString = xmlDataString + "<clientid>1032</clientid>" ;xmlDataString = xmlDataString + "<siteid>228226448</siteid>" ;xmlDataString = xmlDataString + "<priceid>74</priceid>" ;xmlDataString = xmlDataString + "<transtype>SALE</transtype>" ;xmlDataString = xmlDataString + "<amount>10.00</amount>" ;xmlDataString = xmlDataString + "<cardnumber>4111111111111111</cardnumber>" ;xmlDataString = xmlDataString + "<expmonth>12</expmonth>" ;xmlDataString = xmlDataString + "<expyear>2049</expyear>" ;xmlDataString = xmlDataString + "<product>MySample</product>" ;xmlDataString = xmlDataString + "<ver>1.0</ver>" ;xmlDataString = xmlDataString + "<key>SVD-072-5QQ6-5K58</key>" ;xmlDataString = xmlDataString + "</request>";System.Xml.XmlNode xn;try{this.txtResponse.Text = "";System.Net.ServicePointManager.CertificatePolicy = new certificateIssues();xn = wsTran.ProcessTransaction(userName, password, xmlDataString);if (xn == null){this.txtResponse.Text = "Got nothing back";}else{System.IO.StringReader reader = new System.IO.StringReader(xn.OuterXml.ToString());DataSet ds = new DataSet();ds.ReadXml(reader);this.txtResponse.Text = ds.GetXml().ToString();ds = null;}}catch (Exception ex){this.txtResponse.Text = "Error Occurred: " + ex.Message;}finally{wsTran = null;}
-
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354' This is in VB/ASP and can be modified to run as VBSCRIPTDim lResolve, lConnect, lSend, lReceive , username, passwordusername = "1032"password = "289075"' create a NEW string of XML dataszXML = "<request>"szXML = szXML & "<clientid>1032</clientid>"szXML = szXML & "<siteid>228226448</siteid>"szXML = szXML & "<priceid>74</priceid>"szXML = szXML & "<transtype>SALE</transtype>"szXML = szXML & "<amount>10.00</amount>"szXML = szXML & "<cardnumber>4111111111111111</cardnumber>"szXML = szXML & "<expmonth>12</expmonth>"szXML = szXML & "<expyear>2049</expyear>"szXML = szXML & "<product>MySample</product>"szXML = szXML & "<ver>1.0</ver>"szXML = szXML & "<key>SVD-072-5QQ6-5K58</key>"szXML = szXML & "</request>"myurl = "http://www.slimcd.com/wswebservices/transact.asmx/ProcessTransaction"' URL-Encode THE data portion of the HTTP name/value pairsszPost = "username=" & server.urlencode(username)szPost = szPost & "&password=" & server.urlencode(password)szPost = szPost & "&XMLData=" & server.urlencode(szXML)'Send the data in a FORM POST requestSet objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")lResolve = 20 * 1000lConnect = 20 * 1000lSend = 90 * 1000lReceive = 90 * 1000objXMLHTTP.setTimeouts lResolve, lConnect, lSend, lReceiveerr.clearon error resume nextobjXMLHTTP.open "POST", url , FalseobjXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"objXMLHTTP.send dataif err thenresult = "E*Error:" & err.number & ":" & err.descriptionelse' This is XML to be parsed.result = objXMLHTTP.responseTextend ifset objXMLHTTP=nothing