SAMPLE CODE
cURL
curl 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";
JavaScrip
<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:rn('+reply.description+') '+reply.description);
}
});
</script>
jQUERY/JSON
$.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);
}
});
PHP/JSON
include'slimcd.php';
// Create the Slim CD object
$SlimCD=newSlimCD();
// Create a ProcessTransaction Request class
$request=newTransact_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);
echovar_dump($reply);
C#.NET 2-4
SlimCD.Transact transact=newSlimCD.Transact();
ProcessTransactionRequest request=newProcessTransactionRequest();
ProcessTransactionReply reply=newProcessTransactionReply();
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:rn"+reply.description);
}
VB.NET 2-4
Rem VB.NET2.0orgreater SYNCHRONOUS LIBRARY CALL
Dim transact AsNewSlimCD.Transact()
Dim request AsNewProcessTransactionRequest()
Dim reply AsNewProcessTransactionReply()
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)
Ifreply.response.ToUpper()="SUCCESS"Then
MessageBox.Show("Approved")
Else
MessageBox.Show("There was a problem processing the payment:"&vbCr&vbLf+reply.description)
EndIf
C#.NET 4-5
SlimCD.Transact transact=newSlimCD.Transact();
ProcessTransactionRequest request=newProcessTransactionRequest();
ProcessTransactionReply reply=newProcessTransactionReply();
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=awaittransact.ProcessTransaction(request,60);
if(reply.response.ToUpper()=="SUCCESS")
{
MessageBox.Show("Approved");
}
else
{
MessageBox.Show("There was a problem processing the payment:rn"+reply.description);
}
VB.NET 4-5
Rem VB.NET4.5orgreater ASYNCHRONOUS LIBRARY CALL
Dim transact AsNewSlimCD.Transact()
Dim request AsNewProcessTransactionRequest()
Dim reply AsNewProcessTransactionReply()
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)
Ifreply.response.ToUpper()="SUCCESS"Then
MessageBox.Show("Approved")
Else
MessageBox.Show("There was a problem processing the payment:"&vbCr&vbLf+reply.description)
EndIf
IOS
SlimCD*api=[[SlimCDalloc] init];
TransactProcessTransactionRequest*request=[[TransactProcessTransactionRequestalloc] 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);
}
}];
SOAP/XML
// A WebReferecen to "https://trans.slimcd.com/wswebservices/transact.asmx" is required for this to work.
// In the case below, it is called "Trans"
StringuserName="1032";
Stringpassword="289075";
Trans.transact wsTran=newTrans.transact();
stringxmlDataString="<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=newcertificateIssues();
xn=wsTran.ProcessTransaction(userName,password,xmlDataString);
if(xn==null)
{
this.txtResponse.Text="Got nothing back";
}
else
{
System.IO.StringReader reader=newSystem.IO.StringReader(xn.OuterXml.ToString());
DataSet ds=newDataSet();
ds.ReadXml(reader);
this.txtResponse.Text=ds.GetXml().ToString();
ds=null;
}
}
catch(Exception ex)
{
this.txtResponse.Text="Error Occurred: "+ex.Message;
}
finally
{
wsTran=null;
}
Developer Downloads