Monday 8 February 2016

Hosting Tips: How to Silent Transaction in PayPal with ASP.NET?

Leave a Comment
In this tutorial, I wil explain you how to Silent Transaction in PayPal with ASP.NET. The following code describes the complete code for silent transaction in PayPal using Merchant account (Pro). Now, it's time to write the code:

Hosting Tips: How to Silent Transaction in PayPal with ASP.NET?

using System; 
using System.Net; 
using System.Text; 
using System.IO; 
public partial class PayPal 

public void DoDirect() 

 //API Credentials (3-token) 
 string strUsername = "Your userName"; 
 string strPassword = "QFZCWN5HZM8VBG7Q"; 
 string strSignature = "A21eW1ch..NEqJJ-glaLhqkBMlzeAsWqX0ycck-CTc0tKI4pa1u.rgNF"; 
 string strCredentials = "USER=" + strUsername + "&PWD=" + strPassword + "&SIGNATURE=" + strSignature;   

 string strNVPSandboxServer = "https://api-3t.sandbox.paypal.com/nvp"; 
 string strNVPLiveServer = "https://api-3t.paypal.com/nvp"; 
 string strAPIVersion = "2.3" 
 string strNVP = strCredentials + "&METHOD=DoDirectPayment&CREDITCARDTYPE=VISA&ACCT=XXXXXXXXXXXXXXXXX&EXPDATE=092007&CVV2=808&AMT=212.95&FIRSTNAME=Designer&LASTNAME=Fotos&IPADDRESS=255.55.167.002&STREET=1234+Easy+Street&CITY=San+Jose&STATE=CA&COUNTRY=United+States&ZIP=95110&COUNTRYCODE=US&PAYMENTACTION=Sale&VERSION=" + strAPIVersion; 
  //Create web request and web response objects, make sure you using the correct server (sandbox/live) 
  HttpWebRequest wrWebRequest = (HttpWebRequest) WebRequest.Create(strNVPSandboxServer); 
  //Set WebRequest Properties 
  wrWebRequest.Method = "POST"; 
  // write the form values into the request message 
  StreamWriter requestWriter = new StreamWriter(wrWebRequest.GetRequestStream()); 
  requestWriter.Write(strNVP); 
  requestWriter.Close(); 
  // Get the response. 
  HttpWebResponse hwrWebResponse = (HttpWebResponse) wrWebRequest.GetResponse(); 
  StreamReader responseReader = new StreamReader(wrWebRequest.GetResponse().GetResponseStream()); 
  // and read the response 
  string responseData = responseReader.ReadToEnd(); 
  responseReader.Close(); 
  string result = Server.UrlDecode(responseData);  

}  
}

Best ASP.NET Hosting Recommendation

One of the most important things when choosing a good ASP.NET hosting is the feature and reliability. HostForLIFE is the leading provider of Windows hosting and affordable ASP.NET, their servers are optimized for PHP web applications such as the latest ASP.NET version. The performance and the uptime of the hosting service are excellent and the features of the web hosting plan are even greater than what many hosting providers ask you to pay for. 

At HostForLIFE.eu, customers can also experience fast ASP.NET hosting. The company invested a lot of money to ensure the best and fastest performance of the datacenters, servers, network and other facilities. Its datacenters are equipped with the top equipments like cooling system, fire detection, high speed Internet connection, and so on. That is why HostForLIFE.eu guarantees 99.9% uptime for ASP.NET. And the engineers do regular maintenance and monitoring works to assure its ASP.NET hosting are security and always up. 

http://hostforlifeasp.net

0 comments:

Post a Comment