First Data’s directions for setting up their web service in Visual Studio is very confusing and I ended up calling them for help. Visual Studio 2010 has different directions than previous versions of Visual Studio. Here is how I got it to work.
First install the certificate, go into Internet Options in the Control Panel. Choose the Content tab then Certificates. On the Personal tab, click Import… and follow the wizard here to add your certificate. I did this mostly by accident only because I have had to do this before for other stuff I have done in the past. You might not need to do those other instructions in their documentation. I am using Windows XP, so your mileage may vary. (Bonus points if you leave a comment with Vista/7 instructions.)
After that you can setup the web service:
- Download all of the files they list in the documentation. I put them all into
C:\FDGGWSClient
. Puta1.xsd
,fdggwsapi.xsd
, andv1.xsd
intoC:\FDGGWSClient\schemas_us
. Putorder.wsdl
intoC:\FDGGWSClient\wsdl
. I also put the certificate (WSxxxxxxxx._.1.pem
) in the root folder (C:\FDGGWSClient
). - In Visual Studio 2010, right click on References and choose Add Service Reference. Click on Advanced… then on the bottom of the new window click Add Web Reference…
- The URL you enter here is the file path to
order.wsdl
. In my case it’sC:\FDGGWSClient\wsdl\order.wsdl
.
This should allow it to work.
The other thing I did was create a separate class for all of the processing. So my constructor had:
private FDGGWSApiOrderService oFDGGWSApiOrderService = null;
///
/// Initializes a new instance of the test version of the class.
///
/// if set to true [test].
public ProcessCreditCard()
{
ServicePointManager.Expect100Continue = false;
// Initialize Service Object
oFDGGWSApiOrderService = new FDGGWSApiOrderService();
// Set the WSDL URL
oFDGGWSApiOrderService.Url = @Settings.Default.CcApiUrl;
// Configure Client Certificate
oFDGGWSApiOrderService.ClientCertificates.Add(X509Certificate.CreateFromCertFile(Settings.Default.CertFile));
// Set the Authentication Credentials
NetworkCredential nc = new NetworkCredential(Settings.Default.CertUser, Settings.Default.CertPass);
oFDGGWSApiOrderService.Credentials = nc;
}
Then I created a method to create the rest of the information needed to send the transaction to them.
First Data has been notorious on how to set up and start using their services. I hope this helps you get started.
Like this? Give my answer some love on StackOverflow.
No responses yet