Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
charleyyyy #1
ColdFusion + Java Guru Install Cybersource Java Api
Hi,
I need to install a cybersource java api on a coldfusion MX 6 server and call
it as a component to pass variables to their gateway.
Here is the java package I got from cybersource. Very small file...
[url]http://apps.cybersource.com/cgi-bin/pages/dev_kits.cgi?kit=Java/All_Platforms[/url]
Can anyone please help me with this.
Thanks!
charleyyyy Guest
-
[JAVA] - To Make training of JAVA, help me Underestand FLEX and AS 3.0 ?
Do you finds that to make training of JAVA, it helps me to better understand the FLEX and the 3.0? Or it does not make much difference? Sorry... -
#25651 [Bgs]: mixing --with-java and --enable-debug pull out java
ID: 25651 User updated by: fperez at tuzsa dot es Reported By: fperez at tuzsa dot es Status: Bogus Bug Type: ... -
#25651 [NEW]: mixing --with-java and --enable-debug pull out java
From: fperez at tuzsa dot es Operating system: linux redhat 7.3 PHP version: 4.3.3 PHP Bug Type: PHP options/info functions... -
#19327 [Fbk->NoF]: java.lang.UnsatisfiedLinkError: no php_java in java.library.path
ID: 19327 Updated by: sniper@php.net Reported By: chregu@php.net -Status: Feedback +Status: No... -
#19327 [Opn->Fbk]: java.lang.UnsatisfiedLinkError: no php_java in java.library.path
ID: 19327 Updated by: iliaa@php.net Reported By: chregu@php.net -Status: Open +Status: Feedback Bug... -
PaulH #2
Re: ColdFusion + Java Guru Install Cybersource Java Api
it doesn't seem that hard (but nothing does at first glance). copy the two cyb*
jars to cfinstallDir\wwwroot\web-inf\lib\ dir (might need to restart the
cfserver service). the java example (AuthCaptureSample.java) is pretty
rinky-dink but it seems simple enough to convert to cf.
PaulH Guest
-
charleyyyy #3
Re: ColdFusion + Java Guru Install Cybersource Java Api
Hi Paul,
This is a huge chalenge for me and I have already spent hours around this
issue. There are NO CyberSource ColdFusionMX tutorials on the net, my google
searches were all in vain. However there are quite a bit of discussions here on
the forum concerning Cybersource and "paradoxically" none of them was fully
answered.
My question is the following. How do you call the com.cybersource.sample with
CFOBJECT. Is this the only object I have to create. How do I see all the
methods? What is the rolle/yuse of the GTECyberTrustRoot.cer in the package?
Where does this has to be installed in the ColdFusion server?
I read the docs and everything is explained in terms of Java classes. My
knowledge of Java is simple but I am used to using CF components and I am sure
that I can brainstorm the scenarios and call the right methods to pass
transactions to CyberSource.
I would appreciate your answers they would give me a hughe jumpstart in my
quest.
Thanks!
Charley
charleyyyy Guest
-
PaulH #4
Re: ColdFusion + Java Guru Install Cybersource Java Api
i didn't look at many postings concerning cybersource but the few that i did
were having issues w/COM (mx & other java apps will usually have some
difficulty w/COM stuff). as i said, the java example is pretty trivial.
well you wouldn't "call" that sample. you might duplicate it's logic in cf
(for a quick & dirty port see below). to see methods for the classes you need
to use, you'd simply read the API.
as far as the gritty details of this thing, have you read
[url]http://apps.cybersource.com/library/documentation/dev_guides/Web_Services_Client[/url]
s_Java/html/ ?
<cfscript>
// setup needed java bits
clientObj=createObject("java","com.cybersource.ws. client.Client");
//useless overkill?? why not java.util.Properties??
utilObj=createObject("java","com.cybersource.ws.cl ient.Utility");
//or maybe cf equivalent struct
hashMap=createObject("java","java.util.HashMap");
captureHM=hashMap.clone();
//get this thing's properties file, roundabout way, wants commandline args
propFile=arrayNew(1);
propFile[1]="E:\Inetpub\wwwroot\simapi\sample\cybs.properties ";
properties=utilObj.readProperties(propFile);
// defaults
requestID="";
thisReply="";
captureReply="";
// do something with that properties file, ripped from java example
hashMap.put("ccAuthService_run", "true" );
hashMap.put( "merchantReferenceCode", "MRC-14344" );
hashMap.put( "billTo_firstName", "John" );
hashMap.put( "billTo_lastName", "Doe" );
hashMap.put( "billTo_street1", "1295 Charleston Road" );
hashMap.put( "billTo_city", "Mountain View" );
hashMap.put( "billTo_state", "CA" );
hashMap.put( "billTo_postalCode", "94043" );
hashMap.put( "billTo_country", "US" );
hashMap.put( "billTo_email", "nobody@cybersource.com" );
hashMap.put( "billTo_ipAddress", "10.7.7.7" );
hashMap.put( "billTo_phoneNumber", "650-965-6000" );
hashMap.put( "shipTo_firstName", "Jane" );
hashMap.put( "shipTo_lastName", "Doe" );
hashMap.put( "shipTo_street1", "100 Elm Street" );
hashMap.put( "shipTo_city", "San Mateo" );
hashMap.put( "shipTo_state", "CA" );
hashMap.put( "shipTo_postalCode", "94401" );
hashMap.put( "shipTo_country", "US" );
hashMap.put( "card_accountNumber", "4111111111111111" );
hashMap.put( "card_expirationMonth", "12" );
hashMap.put( "card_expirationYear", "2020" );
hashMap.put( "purchaseTotals_currency", "USD" );
// there are two items in this sample
hashMap.put( "item_0_unitPrice", "12.34" );
hashMap.put( "item_1_unitPrice", "56.78" );
try {
thisReply = clientObj.runTransaction(hashMap,properties);
if (thisReply.get("decision") EQ "ACCEPT")
requestID=thisReply.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
// did it work?
if (trim(len(requestID))) { // got something back?
captureHM.put("ccCaptureService_run", "true");
captureHM.put("merchantReferenceCode", "MRC-14344" );
captureHM.put("ccCaptureService_authRequestID", requestID);
captureHM.put("purchaseTotals_currency", "USD");
captureHM.put("item_0_unitPrice", "12.34");
try {
captureReply = clientObj.runTransaction(captureHM,properties);
} //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
}
</cfscript>
<cfdump var="#clientObj#">
<br>
<cfdump var="#thisReply#">
<br>
<cfdump var="#captureReply#">
PaulH Guest
-
krigton #5
Re: ColdFusion + Java Guru Install Cybersource Java Api
Hello Boys
Anyone managed to integrate cybersource with java into coldfusion. I also spent three days with it. I made cfobjects and try to use it without cfscript but no success.
krigton Guest
-
atahualpa #6
Re: ColdFusion + Java Guru Install Cybersource Java Api
Hey gang ..
I'm working here on a fusebox 4 app and I now need to connect the online
donations to cybersource ..
Has anyone here been able to get cybersource working with cold fusion mx ?
Any help or ideas will be appreciated ..
atahualpa Guest
-
JB3178 #7
Re: ColdFusion + Java Guru Install Cybersource Java Api
Paul,
Your code was very useful. I'm trying to get the Cybersource stuff working as
well. Here is the error that was genereated when I attempted to use your code.
Error Occurred While Processing Request
org/apache/xerces/dom/DocumentImpl
The error occurred in E:\webfiles\neweracap.com\sandboxes\jbean\index.cf m:
line 48
46 : hashMap.put( "item_1_unitPrice", "56.78" );
47 : try {
48 : thisReply = clientObj.runTransaction(hashMap,properties);
49 : if (thisReply.get("decision") EQ "ACCEPT")
50 : requestID=thisReply.get("requestID");
JB3178 Guest
-
JB3178 #8
Re: ColdFusion + Java Guru Install Cybersource Java Api
First problem solved. All of the .jar files need to be moved into the
ColdFusion directory. Now that I did that, here is the error that I'm getting.
The system has attempted to use an undefined value, which usually indicates a
programming error, either in your code or some system code.
Null Pointers are another name for undefined values.
The error occurred in E:\webfiles\xxxx\index.cfm: line 48
46 : hashMap.put( "item_1_unitPrice", "56.78" );
47 : try {
48 : thisReply = clientObj.runTransaction(hashMap,properties);
49 : if (thisReply.get("decision") EQ "ACCEPT")
50 : requestID=thisReply.get("requestID");
JB3178 Guest
-
PrinceDog #9
Re: ColdFusion + Java Guru Install Cybersource Java Api
Did any of you figure this out yet? I'm battling with this too. Thanks.
John
[email]john.prince@hotelplanner.com[/email]
[url]http://www.HotelPlanner.com[/url]
PrinceDog Guest
-
PrinceDog #10
Re: ColdFusion + Java Guru Install Cybersource Java Api
I'm at the same point as you now. This is the code I'm using. Were you able to
get past the null pointer error JB3178?
The system has attempted to use an undefined value, which usually indicates a
programming error, either in your code or some system code.
Null Pointers are another name for undefined values.
PrinceDog Guest
-
cfdesigner #11
Re: ColdFusion + Java Guru Install Cybersource Java Api
Help, I am also trying to use the Java Client with CF MX. I've tried many
routes, but I don't want to convert our whole credit card app to ASP just to
grab the keys. I tried the simple API and the XML API and kept getting errors
saying that the MerchantID was invalid. Any custom tags anyone knows about or
work arounds for the simple API? Cybersource is no help.
cfdesigner Guest
-
cfprince #12
Re: ColdFusion + Java Guru Install Cybersource Java Api
Sorry, but I'm still stuck at the point in my message above. The java solution seems to get real close, but I can't get past that error. Please let me know if you solve it. Thanks, J. Prince
cfprince Guest
-
onlinepayments #13
Re: ColdFusion + Java Guru Install Cybersource Java Api
Hi All, I work at CyberSource in the support department, and have been able to
get ColdfusionMX 6.0 to work with the CyberSource Java SOAPI CDK. I am using
the linux version of Coldfusion.
I'm defintely not a Coldfusion expert, but below are the steps I took to get
it to work:
1 - Modified the jvm.config file in the bin directory to look like below:
# JVM classpath
java.class.path=/home/simapijava/simapi-2.0.0/lib/cybsclients.jar,/home/simapija
va/simapi-2.0.0/lib/cybssecurit
y.jar,/home/simapijava/simapi-2.0.0/lib/xalan.jar,/home/simapijava/simapi-2.0.0/
lib/xercesImpl.jar,/home/s
imapijava/simapi-2.0.0/lib/xml-api.jar,{application.home}/lib,{application.home}
/runtime/lib/jrun.jar,{application.home}/
runtime/lib
The xerces version that comes with the CDK is the important portion here, as
it is required in order to sign the soap message with the RSA libraries that
are part of the client. If any other xerces version is used besides the one
included in the CDK, then it will fail with the java.lang.null that is commonly
seen.
2. You would then restart the coldfusion server.
3. Below is the sample code that I'm using. This does not do any exception
handling and basically just runs a transaction.
<cfobject action="create" type="java" class="java.util.Properties"
name="proprequest">
<cfobject action="create" type="java" class="java.util.HashMap"
name="response">
<cfobject action="create" type="java" class="java.util.Properties"
name="props">
<cfobject action="create" type="java" class="com.cybersource.ws.client.Client"
name="clientobj">
<cfobject action="create" type="java" class="java.lang.String"
name="stringhash">
<cfscript>
props.setProperty("merchantID", "yourmechantid");
props.setProperty("targetAPIVersion", "1.13");
props.setProperty("keysDirectory",
"/home/simapijava/simapi-2.0.0/keys");
props.setProperty("sendToProduction", "false");
props.setProperty("enableLog", "false");
props.setProperty("logDirectory", "/opt/coldfusionmx/wwwroot");
props.setProperty("logMaximumSize", "10");
proprequest.setProperty( "ccAuthService_run", "true" );
proprequest.setProperty( "merchantReferenceCode", "MRC-14344" );
proprequest.setProperty( "merchantID", "yourmerchantid" );
proprequest.setProperty( "billTo_firstName", "John" );
proprequest.setProperty( "billTo_lastName", "Doe" );
proprequest.setProperty( "billTo_street1", "1295 Charleston Road" );
proprequest.setProperty( "billTo_city", "Mountain View" );
proprequest.setProperty( "billTo_state", "CA" );
proprequest.setProperty( "billTo_postalCode", "94043" );
proprequest.setProperty( "billTo_country", "US" );
proprequest.setProperty( "billTo_email", "nobody@cybersource.com" );
proprequest.setProperty( "billTo_ipAddress", "10.7.7.7" );
proprequest.setProperty( "billTo_phoneNumber", "650-965-6000" );
proprequest.setProperty( "shipTo_firstName", "Jane" );
proprequest.setProperty( "shipTo_lastName", "Doe" );
proprequest.setProperty( "shipTo_street1", "100 Elm Street" );
proprequest.setProperty( "shipTo_city", "San Mateo" );
proprequest.setProperty( "shipTo_state", "CA" );
proprequest.setProperty( "shipTo_postalCode", "94401" );
proprequest.setProperty( "shipTo_country", "US" );
proprequest.setProperty( "card_accountNumber", "4111111111111111" );
proprequest.setProperty( "card_expirationMonth", "12" );
proprequest.setProperty( "card_expirationYear", "2020" );
proprequest.setProperty( "purchaseTotals_currency", "USD" );
proprequest.setProperty( "purchaseTotals_grandTotalAmount", "56.78" );
stringhash=proprequest.toString();
</cfscript>
<cfoutput><br> #stringhash#<br></cfoutput>
<cfset response=clientobj.runTransaction(proprequest, props)>
<cfset stringhash=response.toString()>
<cfoutput><br> #stringhash#<br></cfoutput>
I've basically done 2 things here that are a little different. I've created a
seperate properties object and fill out the properties in it. I then use this
object when I call runTransaction. This is a change from typically reading the
properties from the file.
The second thing I've done is use the java properties class instead of the
java hashMap for the request. It turns out coldfusion converts all the keys in
the hashMap to lowercase, and these values are case sensitive. Since properties
inherits from hashMap this seems to work fine. For some reason coldfusion does
not change the values in properties to lowercase.
I've run this sample program and am able to run the transaction sucessfully
through coldfusion using the CyberSource Java SOAPI CDK.
Please let me know if you have further questions.
onlinepayments Guest
-
Bill Simpson #14
Re: ColdFusion + Java Guru Install Cybersource Java Api
onlinepayments wrote:> Hi All, I work at CyberSource in the support department, and have been able to
> get ColdfusionMX 6.0 to work with the CyberSource Java SOAPI CDK. I am using
> the linux version of Coldfusion.
>
> I'm defintely not a Coldfusion expert, but below are the steps I took to get
> it to work:
> 1 - Modified the jvm.config file in the bin directory to look like below:
> # JVM classpath
>
> java.class.path=/home/simapijava/simapi-2.0.0/lib/cybsclients.jar,/home/simapija
> va/simapi-2.0.0/lib/cybssecurit
>
> y.jar,/home/simapijava/simapi-2.0.0/lib/xalan.jar,/home/simapijava/simapi-2.0.0/
> lib/xercesImpl.jar,/home/s
>
> imapijava/simapi-2.0.0/lib/xml-api.jar,{application.home}/lib,{application.home}
> /runtime/lib/jrun.jar,{application.home}/
> runtime/lib
>
> The xerces version that comes with the CDK is the important portion here, as
> it is required in order to sign the soap message with the RSA libraries that
> are part of the client. If any other xerces version is used besides the one
> included in the CDK, then it will fail with the java.lang.null that is commonly
> seen.
>
> 2. You would then restart the coldfusion server.
>
> 3. Below is the sample code that I'm using. This does not do any exception
> handling and basically just runs a transaction.
>
> <cfobject action="create" type="java" class="java.util.Properties"
> name="proprequest">
> <cfobject action="create" type="java" class="java.util.HashMap"
> name="response">
> <cfobject action="create" type="java" class="java.util.Properties"
> name="props">
> <cfobject action="create" type="java" class="com.cybersource.ws.client.Client"
> name="clientobj">
> <cfobject action="create" type="java" class="java.lang.String"
> name="stringhash">
>
> <cfscript>
> props.setProperty("merchantID", "yourmechantid");
> props.setProperty("targetAPIVersion", "1.13");
> props.setProperty("keysDirectory",
> "/home/simapijava/simapi-2.0.0/keys");
> props.setProperty("sendToProduction", "false");
> props.setProperty("enableLog", "false");
> props.setProperty("logDirectory", "/opt/coldfusionmx/wwwroot");
> props.setProperty("logMaximumSize", "10");
>
> proprequest.setProperty( "ccAuthService_run", "true" );
> proprequest.setProperty( "merchantReferenceCode", "MRC-14344" );
> proprequest.setProperty( "merchantID", "yourmerchantid" );
>
> proprequest.setProperty( "billTo_firstName", "John" );
> proprequest.setProperty( "billTo_lastName", "Doe" );
> proprequest.setProperty( "billTo_street1", "1295 Charleston Road" );
> proprequest.setProperty( "billTo_city", "Mountain View" );
> proprequest.setProperty( "billTo_state", "CA" );
> proprequest.setProperty( "billTo_postalCode", "94043" );
> proprequest.setProperty( "billTo_country", "US" );
> proprequest.setProperty( "billTo_email", "nobody@cybersource.com" );
> proprequest.setProperty( "billTo_ipAddress", "10.7.7.7" );
> proprequest.setProperty( "billTo_phoneNumber", "650-965-6000" );
> proprequest.setProperty( "shipTo_firstName", "Jane" );
> proprequest.setProperty( "shipTo_lastName", "Doe" );
> proprequest.setProperty( "shipTo_street1", "100 Elm Street" );
> proprequest.setProperty( "shipTo_city", "San Mateo" );
> proprequest.setProperty( "shipTo_state", "CA" );
> proprequest.setProperty( "shipTo_postalCode", "94401" );
> proprequest.setProperty( "shipTo_country", "US" );
> proprequest.setProperty( "card_accountNumber", "4111111111111111" );
> proprequest.setProperty( "card_expirationMonth", "12" );
> proprequest.setProperty( "card_expirationYear", "2020" );
> proprequest.setProperty( "purchaseTotals_currency", "USD" );
>
> proprequest.setProperty( "purchaseTotals_grandTotalAmount", "56.78" );
>
> stringhash=proprequest.toString();
> </cfscript>
>
> <cfoutput><br> #stringhash#<br></cfoutput>
> <cfset response=clientobj.runTransaction(proprequest, props)>
> <cfset stringhash=response.toString()>
> <cfoutput><br> #stringhash#<br></cfoutput>
>
> I've basically done 2 things here that are a little different. I've created a
> seperate properties object and fill out the properties in it. I then use this
> object when I call runTransaction. This is a change from typically reading the
> properties from the file.
>
> The second thing I've done is use the java properties class instead of the
> java hashMap for the request. It turns out coldfusion converts all the keys in
> the hashMap to lowercase, and these values are case sensitive. Since properties
> inherits from hashMap this seems to work fine. For some reason coldfusion does
> not change the values in properties to lowercase.
>
> I've run this sample program and am able to run the transaction sucessfully
> through coldfusion using the CyberSource Java SOAPI CDK.
>
> Please let me know if you have further questions.
We're having this same problem with the null pointer exception. We
removed the xerces jar file and it was unable to load the xerces class,
so we're certain we're using the correct one. Any ideas as to how to
get rid of the null pointer?
Bill Simpson Guest
-
cfprince #15
Re: ColdFusion + Java Guru Install Cybersource Java Api
Thank you for taking the time to try and solve this. I tried your suggestion
and I'm still getting the following error:
"The system has attempted to use an undefined value, which usually indicates a
programming error, either in your code or some system code.
Null Pointers are another name for undefined values."
The only differences between my set up and what you suggested is:
- I'm using ColdFusion MX 6.1 on Windows
- Instead of "/home/simapijava/" -- I'm using -- "d:/simapijava/" throughout
where applicable
Do you have a windows box you could test it on? The error is occuring on the
clientobj.runTransaction(proprequest, props) call. My javaclass paths are
exactly the same and in the same order.
Any help is greatly appreciated.
cfprince Guest
-
MarcMataya #16
Re: ColdFusion + Java Guru Install Cybersource Java Api
Bank of America dropped a huge bomb on me by forcing their merchant accounts to
go to Cybersource only to find that ColdFusion cannot create subscriptions
using the Hosted Order Page (FORM post). I'm now forced into programming an
API which will add a huge layer of support issues and extra coding.
So, I'm now instead looking into just changing companies altogether to
Authorize.NET or VeriSign. Has anyone had any issues with going to these guys
using CF form pages to submit and return result coding via CFM pages
exclusively? Any suggestions on these or other companies with good support and
good online management features?
Thanks!:disgust;:|:Q
MarcMataya Guest
-
Vance Duke #17
Re: ColdFusion + Java Guru Install Cybersource Java Api
I too was just told by the Client that is using Bank of America, to switch to
Cybersource as well. I found this thread and I am already not happy just from
reading the posts. I have implemented Authorize.net on several sites and it is
very straight forward. I am using the "cf_openauthnet" custom tag and have had
great success with it.
I too am going to struggle with Cybersource and see if I can get it to work
and will post back if I encounter anything.
Vance Duke Guest
-
atahualpa #18
Re: ColdFusion + Java Guru Install Cybersource Java Api
I am using authorize.net and it works great ..
I am actually using it together with a cold fusion shopping cart called
CFWEBSTORE ..
As a setting into the credit card authorization you can choose authorize.net
and the rest is simple stuff ..
Site is working and doing well ..
I also got the cybersource code to work, however it took a lot of work (open
ports on firewall, tweak the .net api, etc ..
atahualpa Guest



Reply With Quote

