1

I use .Net, and Visual Studio 2010.

I downloaded the WSDLs and corrected the maxOccurs error, and adding the WSDL as a Web Reference works just fine.

The problem occurs when I call SetExpressCheckout. The error simply says, Version is not supported. I have checked the version of the WSDL, which is 76.0 - and should be correct AFAIK.

The Web Service endpoint being used is this: https://api.sandbox.paypal.com/2.0/

Is there anywhere I need to specify the version, or is the service endpoint being used wrong?

MartinHN
  • 19,542
  • 19
  • 89
  • 131
  • Can someone help to answer the following please ? http://stackoverflow.com/questions/8762703/integrating-paypal-in-c-net-solution-using-wsdl-soap – dparkar Jan 06 '12 at 18:37

1 Answers1

1

If anyone has the same problem, you need to specify the version:

PayPalAPIAASoapBinding api = new PayPalAPIAASoapBinding();

// Service Provider's API Credentials
api.RequesterCredentials = new CustomSecurityHeaderType();
api.RequesterCredentials.Credentials = new UserIdPasswordType();
api.RequesterCredentials.Credentials.Username = this.Username;
api.RequesterCredentials.Credentials.Password = this.Password;
api.RequesterCredentials.Credentials.Signature = this.ApiSignature;

// The merchant's PayPal e-mail address (3rd party authentication)
api.RequesterCredentials.Credentials.Subject = this.CustomerId;

SetExpressCheckoutReq req = new SetExpressCheckoutReq();
req.SetExpressCheckoutRequest = new SetExpressCheckoutRequestType();
req.SetExpressCheckoutRequest.SetExpressCheckoutRequestDetails = new SetExpressCheckoutRequestDetailsType();
req.SetExpressCheckoutRequest.Version = "74.0";

Right now the Sandbox runs in v 74.0, and production in 76.0. PayPal doesn't always run same versions across their environments.

MartinHN
  • 19,542
  • 19
  • 89
  • 131
  • 1
    Tip: Get the source of any sandbox and/or live PayPal page and find the comment block near the top. That'll show the latest version of the environment you're currently on. (I.e. web version: 76.0-1971782) – Robert Jun 29 '11 at 14:29
  • @Robert Thanks, that would be useful when switching back and forth, and after updating the WSDL reference. – MartinHN Jun 29 '11 at 15:31
  • Fixed version error for me. I guessed there was a version parameter somewhere, but could not get my paws on it. Thank u! – brando Jan 28 '15 at 23:52