Hi Experts,
// API endpoint for the Refund call in the Sandbox
string sAPIEndpoint = "https://svcs.paypal.com/AdaptivePayments/Pay";
// Version that you are coding against
//string sVersion = "1.1.0";
string UserID = "paul.monaghan_api1.winwin.ie";
string Pass = "2PXR5EXM24SM5GA3" ;
string Signature = "AFcWxV21C7fd0v3bYYYRCpSSRl31AWz62EdpgWkY0W8EpUk4XQbzVRc7";
// Error Langugage
string sErrorLangugage = "en_US";
// Detail Level
//string sDetailLevel = "ReturnAll";
// Request Data Binding
string sRequestDataBinding = "XML";
// Response Data Binding
string sResponseDataBinding = "XML";
// Application ID
string sAppID = "APP-65N51841B1775092S"; // live
//string sAppID = "APP-80W284485P519543T";
//// other clientDetails fields
//string sIpAddress = "255.255.255.255";
//string sIpAddress = "87.198.128.182";
//string sPartnerName = "WinWin";
//string sDeviceID = "87.198.128.182";
// Currency Code
//string sCurrencyCode = "EUR";
// Action Type
//string sActionType = "PAY";
// ReturnURL and CancelURL used for approval flow
string sReturnURL = "http://localhost:47366/PayPal/Success.aspx";
string sCancelURL = "http://localhost:47366/PayPal/Failed.aspx";
// who pays the fees
string sFeesPayer = "EACHRECEIVER";
// memo field
string sMemo = "testing my first pay call";
// transaction amount
//string sAmount = "1";
// supply your own sandbox accounts for receiver and sender
string sTrackingID = System.Guid.NewGuid().ToString();
//string Sender = "paul.monaghan@winwin.ie";
string receiver = txtseller.Text;
//https://svcs.sandbox.paypal.com/AdaptivePayments/Pay
//&actionType=PAY
//&senderEmail=sender@domain
//&receiverList.receiver(0).email=receiver@domain
//&receiverList.receiver(0).amount=100.00
//¤cyCode=USD
//&feesPayer=EACHRECEIVER
//&memo=Simple payment example.
//&cancelUrl=http://your_cancel_url
//&returnUrl=http://your_return_url
// construct the XML request string
StringBuilder sRequest = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
sRequest.Append("<PayRequest xmlns:ns2=\"https://svcs.paypal.com/AdaptivePayments/Pay\">");
// requestEnvelope fields
sRequest.Append("<requestEnvelope><errorLanguage>");
sRequest.Append(sErrorLangugage);
sRequest.Append("</errorLanguage>");
sRequest.Append("</requestEnvelope>");
sRequest.Append("<actionType>");
sRequest.Append("PAY");
sRequest.Append("</actionType>");
sRequest.Append("<receiverList><receiver><email>");
//sRequest.Append(receiver);
sRequest.Append("007.rohitjain@gmail.com");
//sRequest.Append("paul.monaghan@winwin.ie");
sRequest.Append("</email>");
sRequest.Append("<amount>");
//sRequest.Append(sAmount);
sRequest.Append("1");
sRequest.Append("</amount></receiver></receiverList>");
sRequest.Append("<senderEmail>");
sRequest.Append("paul.monaghan@winwin.ie");
//sRequest.Append("007.rohitjain@gmail.com");
sRequest.Append("</senderEmail>");
sRequest.Append("<currencyCode>");
sRequest.Append("EUR");
sRequest.Append("</currencyCode>");
sRequest.Append("<feesPayer>");
sRequest.Append(sFeesPayer);
sRequest.Append("</feesPayer>");
sRequest.Append("<memo>");
sRequest.Append(sMemo);
sRequest.Append("</memo>");
// clientDetails fields
sRequest.Append("<cancelUrl>");
sRequest.Append(sCancelURL);
sRequest.Append("</cancelUrl>");
sRequest.Append("<returnUrl>");
sRequest.Append(sReturnURL);
sRequest.Append("</returnUrl>");
sRequest.Append("</PayRequest>");
// get ready to make the call
HttpWebRequest oPayRequest = (HttpWebRequest)WebRequest.Create(sAPIEndpoint);
oPayRequest.Method = "POST";
byte[] array = Encoding.UTF8.GetBytes(sRequest.ToString());
oPayRequest.ContentLength = array.Length;
oPayRequest.ContentType = "text/xml;charset=utf-8";
// set the HTTP Headers
oPayRequest.Headers.Add("X-PAYPAL-SECURITY-USERID", UserID);
oPayRequest.Headers.Add("X-PAYPAL-SECURITY-SIGNATURE", Signature);
oPayRequest.Headers.Add("X-PAYPAL-SECURITY-PASSWORD", Pass);
oPayRequest.Headers.Add("X-PAYPAL-APPLICATION-ID", sAppID);
//oPayRequest.Headers.Add("X-PAYPAL-SERVICE-VERSION", sVersion);
oPayRequest.Headers.Add("X-PAYPAL-REQUEST-DATA-FORMAT", sRequestDataBinding);
oPayRequest.Headers.Add("X-PAYPAL-RESPONSE-DATA-FORMAT", sResponseDataBinding);
// send the request
Stream oStream = oPayRequest.GetRequestStream();
oStream.Write(array, 0, array.Length);
oStream.Close();
// get the response
HttpWebResponse oPayResponse = (HttpWebResponse)oPayRequest.GetResponse();
StreamReader oStreamReader = new StreamReader(oPayResponse.GetResponseStream());
string sResponse = oStreamReader.ReadToEnd();
oStreamReader.Close();
I have the above code for paypal adaptive payments , I have put in Application Id , API UserId , API Password , API signature ,
if I remove sendermail from the xml it works as an explicit payment but I want an Implicit payment and when I put in the sendermail ,it is showing me the following error
<?xml version="1.0" encoding="UTF-8" ?>
- <ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/ap">
- <responseEnvelope>
<timestamp>2013-08-30T03:10:15.605-07:00</timestamp>
<ack>Failure</ack>
<correlationId>38e79b9a1772f</correlationId>
<build>6941298</build>
</responseEnvelope>
- <error>
<errorId>550001</errorId>
<domain>PLATFORM</domain>
<subdomain>Application</subdomain>
<severity>Error</severity>
<category>Application</category>
<message>You do not have permission to execute this payment implicitly</message>
</error>
</ns3:FaultMessage>
Does anybody have a solution for this