YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

preapproval failing after update Options
diegolaz
#1 Posted : Thursday, April 29, 2010 12:49:40 AM
Rank: Starting Member

Groups: Registered

Joined: 4/19/2006
Posts: 4
Location: ,
Hello, I was using an older PayPalSoapProtocol.cs file that had the API structure. Its working ok but has an old version of the API.
In a parallel project in VS I'm now using the webreference with https://svcs.paypal.com/AdaptivePayments?wsdl

My (previously working) code:

Code:
request.Headers.Add("CLIENT_AUTH", "No cert");
request.Headers.Add("X-PAYPAL-SECURITY-USERID", WebConfigurationManager.AppSettings["APIUser"]);
request.Headers.Add("X-PAYPAL-SECURITY-SIGNATURE", WebConfigurationManager.AppSettings["APISignature"]);
request.Headers.Add("X-PAYPAL-SECURITY-PASSWORD", WebConfigurationManager.AppSettings["APIPassword"]);               
request.Headers.Add("X-PAYPAL-APPLICATION-ID", WebConfigurationManager.AppSettings["applicationId"]);
request.Headers.Add("X-PAYPAL-MESSAGE-PROTOCOL", "SOAP11");


Code:

AdaptivePayments adps = new AdaptivePayments();
adps.Url = WebConfigurationManager.AppSettings["APIPreapproval"];
adps.Url += "?USER=" + WebConfigurationManager.AppSettings["APIUser"];
adps.Url += "&PWD=" + WebConfigurationManager.AppSettings["APIPassword"];
adps.Url += "&SIGNATURE=" + WebConfigurationManager.AppSettings["APISignature"];

and this are the objects we need to create

Code:

RequestEnvelope envelope = new RequestEnvelope();
envelope.detailLevel = DetailLevelCode.ReturnAll;
envelope.detailLevelSpecified = true;
envelope.errorLanguage = "en_US";
PreapprovalRequest MyPreapprovalRequest = new PreapprovalRequest();
PreapprovalResponse MyPreapprovalResponse = new PreapprovalResponse();
ClientDetailsType ClientDetails = new ClientDetailsType();
ClientDetails.applicationId = WebConfigurationManager.AppSettings["applicationId"];
ClientDetails.ipAddress = WebConfigurationManager.AppSettings["ipAddress"];
ClientDetails.partnerName = WebConfigurationManager.AppSettings["partnerName"];
ClientDetails.deviceId = WebConfigurationManager.AppSettings["deviceId"];

MyPreapprovalRequest.clientDetails = ClientDetails;
MyPreapprovalRequest.requestEnvelope = envelope;
MyPreapprovalResponse = adps.Preapproval(MyPreapprovalRequest);


But I get error with wrong parameters.
Am I missing parameters on the new version or have too much?

Thanks!
Sponsor  
 
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.294 seconds.