CyberSource ColdFusion Solution
I have received this question so many times via email I decided to post a blog entry for it. CyberSource is a payment solution I have used in the past for a product called Bill Me Later but it can be used for a number of other solutions as well.
Here are the instructions for setting this payment solution up.
1. Download the Simple Order API (32-bit). I installed the Windows Java version.
2. Modify your jvm.config file. This depends on what version of ColdFusion you are using. Also, you will need to edit this file manually because the CyberSource arguments need to appear first. Do not edit the JVM arguments in the ColdFusion administrator because it will add them to the end which will not work.
ColdFusion MX 6.x
Notice that the following line below has been commented out because it interferes with the CyberSource JVM arguments.
# VM configuration
#
# Where to find JVM, if {java.home}/jre exists then that JVM is used
# if not then it must be the path to the JRE itself
java.home=D:/CFusionMX/runtime/jre
#
# If no java.home is specified a VM is located by looking in these places in this
# order:
#
# 1) bin directory for java.dll (windows) or lib/<ARCH>/libjava.so (unix)
# 2) ../jre
# 3) registry (windows only)
# 4) JAVA_HOME env var plus jre (ie $JAVA_HOME/jre)
#
# Arguments to VM
java.args=-server -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Xms256m -Xmx512m -Dsun.io.useCanonCaches=false -Xbootclasspath/a:"{application.home}/../lib/webchartsJava2D.jar" -XX:MaxPermSize=128m -XX:+UseParallelGC
#-Djavax.xml.parsers.SAXParserFactory=com.macromedia.crimson.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=com.macromedia.crimson.jaxp.DocumentBuilderFactoryImpl
#
# commas will be converted to platform specific separator and the result will be passed
# as -Djava.ext.dirs= to the VM
java.ext.dirs={jre.home}/lib/ext
#
# where to find shared libraries
java.library.path={application.home}/../lib,{application.home}/../jintegra/bin,{application.home}/../jintegra/bin/international,{application.home}/../lib/_nti40/bin
system.path.first=false
# JVM classpath
java.class.path=E:/WEBROOT/simapi-2.0.0/lib/cybsclients.jar,E:/WEBROOT/simapi-2.0.0/lib/cybssecurity.jar,E:/WEBROOT/simapi-2.0.0/lib/xalan.jar,E:/WEBROOT/simapi-2.0.0/lib/xercesImpl.jar,E:/WEBROOT/simapi-2.0.0/lib/xml-apis.jar,{application.home}/servers/lib,{application.home}/../lib/cfusion.jar,{application.home}/../lib,{application.home}/../runtime/lib/jrun.jar,{application.home}/../runtime/lib
ColdFusion MX 7.x
# VM configuration
#
# Where to find JVM, if {java.home}/jre exists then that JVM is used
# if not then it must be the path to the JRE itself
java.home=C:/CFusionMX7/runtime/jre
#
# If no java.home is specified a VM is located by looking in these places in this
# order:
#
# 1) bin directory for java.dll (windows) or lib/<ARCH>/libjava.so (unix)
# 2) ../jre
# 3) registry (windows only)
# 4) JAVA_HOME env var plus jre (ie $JAVA_HOME/jre)
#
# Arguments to VM
java.args=-server -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Xms256m -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=128m -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib -XX:+UseParallelGC -Dcoldfusion.classPath={application.home}/../../classes,{application.home}/../lib/updates,{application.home}/../lib/,{application.home}/../gateway/lib/,{application.home}/../wwwroot/WEB-INF/cfform/jars,C:/CFusionMX7/wwwroot/WEB-INF/classes,C:/CFusionMX7/wwwroot/WEB-INF/classes/VeriSign.jar
#
# commas will be converted to platform specific separator and the result will be passed
# as -Djava.ext.dirs= to the VM
java.ext.dirs={jre.home}/lib/ext
#
# where to find shared libraries
java.library.path={application.home}/../lib,{application.home}/../jintegra/bin,{application.home}/../jintegra/bin/international
system.path.first=false
#
# set the current working directory - useful for Windows to control
# the default search path used when loading DLLs since it comes
# before system directory, windows directory and PATH
java.user.dir={application.home}/../../lib
# JVM classpath
#java.class.path={application.home}/servers/lib,{application.home}/../lib/macromedia_drivers.jar,{application.home}/lib/cfmx_mbean.jar,{application.home}/lib
java.class.path=C:/WEBROOT/simapi-2.0.0/lib/cybsclients.jar,C:/WEBROOT/simapi-2.0.0/lib/cybssecurity.jar,C:/WEBROOT/simapi-2.0.0/lib/xalan.jar,C:/WEBROOT/simapi-2.0.0/lib/xercesImpl.jar,C:/WEBROOT/simapi-2.0.0/lib/xml-apis.jar,{application.home}/servers/lib,{application.home}/../lib/macromedia_drivers.jar,{application.home}/lib/cfmx_mbean.jar,{application.home}/lib
3. Restart ColdFusion
4. Run the following test script.
<cfobject type="java" name="oClientProperties" class="java.util.Properties" action="create">
<cfobject type="java" name="oRequestProperties" class="java.util.Properties" action="create">
<cfobject type="java" name="oHashMapResponse" class="java.util.HashMap" action="create">
<cfscript>
oClientProperties.setProperty("merchantID", "your merchant id");
oClientProperties.setProperty("targetAPIVersion", "1.7");
oClientProperties.setProperty("keysDirectory", "E:/WEBROOT/simapi-2.0.0/keys");
oClientProperties.setProperty("sendToProduction", "false");
oClientProperties.setProperty("enableLog", "true");
oClientProperties.setProperty("logDirectory", "E:/WEBROOT/simapi-2.0.0/logs");
oClientProperties.setProperty("logMaximumSize", "10");
oRequestProperties.setProperty( "ccAuthService_run", "true" );
oRequestProperties.setProperty( "merchantReferenceCode", "10000" );
oRequestProperties.setProperty( "billTo_firstName", "John" );
oRequestProperties.setProperty( "billTo_lastName", "Doe" );
oRequestProperties.setProperty( "billTo_street1", "1295 Charleston Road" );
oRequestProperties.setProperty( "billTo_city", "Mountain View" );
oRequestProperties.setProperty( "billTo_state", "CA" );
oRequestProperties.setProperty( "billTo_postalCode", "94043" );
oRequestProperties.setProperty( "billTo_country", "US" );
oRequestProperties.setProperty( "billTo_email", "nobody@cybersource.com" );
oRequestProperties.setProperty( "billTo_ipAddress", "10.7.7.7" );
oRequestProperties.setProperty( "billTo_phoneNumber", "650-965-6000" );
oRequestProperties.setProperty( "shipTo_firstName", "Jane" );
oRequestProperties.setProperty( "shipTo_lastName", "Doe" );
oRequestProperties.setProperty( "shipTo_street1", "100 Elm Street" );
oRequestProperties.setProperty( "shipTo_city", "San Mateo" );
oRequestProperties.setProperty( "shipTo_state", "CA" );
oRequestProperties.setProperty( "shipTo_postalCode", "94401" );
oRequestProperties.setProperty( "shipTo_country", "US" );
oRequestProperties.setProperty( "card_accountNumber", "4111111111111111" );
oRequestProperties.setProperty( "card_expirationMonth", "12" );
oRequestProperties.setProperty( "card_expirationYear", "2021" );
oRequestProperties.setProperty( "purchaseTotals_currency", "USD" );
oRequestProperties.setProperty( "purchaseTotals_grandTotalAmount", "56.78" );
try {
oHashMapResponse = oClient.runTransaction(oRequestProperties, oClientProperties);
if (oHashMapResponse.get("decision") EQ "ACCEPT")
requestID = oHashMapResponse.get("requestID");
} // try
// do some error handling, probably need a couple-three catches catch ("com.cybersource.ws.client.ClientException" e) {
writeoutput("#e.getLogString()#");
} // catch client exception catch ("com.cybersource.ws.client.FaultException" e) {
writeoutput("#e.getLogString()#");
} // catch client exception
//oHashMapResponse = oClient.runTransaction(oRequestProperties, oClientProperties);
</cfscript>
<cfdump var="#oHashMapResponse#">
That should be it. Also make sure you set the following directories to your specific path.
keysDirectory
logDirectory

thanks a lot for publishing your findings. I am testing this with CF8 and cannot get pass this exception:
The cause of this exception was that: java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault cannot be cast to org.apache.xml.dtm.DTMManager.
Any idea on how what I might be doing wrong?
Thanks,
Thanks again for having publishing this here.
No problem. I've gotten so many requests for it I decided to blog on it so I'm glad you found it useful.
<a href="http://www.cuhk.edu.hk/clc/summer.htm ">Summer School</a> ,
<a href="http://www.cuhk.edu.hk/clc/e_putonghua.htm ">study in china</a>,
<a href="http://www.cuhk.edu.hk/clc/new/en/ ">Chinese School</a>,
<a href="http://www.huangjinjiage.org/ ">http://www.huangjinjiage.org/</a>,
<a href="http://www.weddings-studio.com/hunshaxiang_hong_ko... ">?????</a>
<a href="http://www.weddings-studio.com/jiehunxiang_hong_ko... ">?????</a>
<a href="http://www.weddings-studio.com/hunsasheying.html ">??????</a>
<a href="http://www.weddings-studio.com/wedding_photo.html ">Wedding Photo Services</a>
<a href="http://www.cupid-photo.com/makeup.html ">????</a>
<a href="http://www.9lolo.com/gold_price.htm ">????</a>
<a href="http://www.mandarincoach.com/mandarin_learning.htm... ">Mandarin</a>
<a href="http://www.wedding-foryou.com/hunshaxiang_hong_kon... ">?????</a>
<a href="http://www.cupid-photo.com/ ">??????</a>
<a href="http://www.mandarincoach.com/putonghua_course.htm ">Putonghua</a>
<a href="http://www.wedding-foryou.com/hunsasheying.html ">????</a>
????????????????????<a href="http://www.childrenplaygroup.com/huashi.html"... href="http://www.hk-beauty-centre.com/beauty.php"&g... href="http://www.hk-beauty-centre.com/jian_fei.php"...;?????????????????
?????????<a href="http://www.cupid-photo.com/">????</a>...;
<a href="http://www.englishcourse-hk.com/putonghua_course.h...;
<a href="http://www.mandarincoach.com/putonghua_course.htm&...;
<a href="http://www.officefurniture-centre.com/product_1.ht...;
<a href="http://www.blowater.com.hk/index.php/5554">...;
<a href="http://blog.yam.com/jadelung">????</a&g...;
<a href="http://blog.udn.com/jadelung">?????</a&...;
<a href="http://blog.xuite.net/jadelung/blog">?????...;
<a href="http://blog.roodo.com/jadelung">????</a...;
<a href="http://jade3link.uwants.com">????</a>...;
<a href="http://blog.youth-online.com/?2140/">?????...;
<a href="http://blog.teamagazine.com.hk/jade3link/index.php...;
<a href="http://loe.sjc.org.hk/blog/jadelung/">????...;
<a href="http://space.kyohk.net/?352617">???????<...;
антим
аулнетизм